Matrix Calculator

A professional-grade, mobile-first matrix calculator for students, engineers, and researchers. Compute addition, subtraction, multiplication, determinant, inverse, transpose, rank, trace, RREF, and solve Ax = b with accessible, high-precision algorithms and instant results.

Calculator

Matrix dimensions
Supported dimensions: 1–6. Square matrices are required for determinant, trace, and inverse.

Matrix A

Matrix B

All empty cells are treated as 0. Inline validation runs when fields lose focus.

Results

Ready. Choose an operation and edit the matrices to begin.

Data Source and Methodology

Authoritative references:

Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.

Algorithms implemented: Gaussian elimination with partial pivoting for determinant, inverse, RREF, and solving linear systems; direct element-wise definitions for addition, subtraction, transpose, trace, and rank via RREF.

The Formula Explained

Matrix addition: \( C = A + B,\; c_{ij} = a_{ij} + b_{ij} \).

Matrix subtraction: \( C = A - B,\; c_{ij} = a_{ij} - b_{ij} \).

Matrix multiplication: \( C = A B,\; c_{ij} = \sum_{k=1}^{n} a_{ik} b_{kj} \).

Transpose: \( A^{\top},\; (A^{\top})_{ij} = a_{ji} \).

Trace (square A): \( \operatorname{tr}(A) = \sum_{i=1}^{n} a_{ii} \).

Determinant (via elimination): \( \det(A) = (-1)^s \prod_{i=1}^{n} u_{ii} \), where \( U \) is the upper-triangular matrix after elimination and \( s \) the number of row swaps.

Inverse (if nonsingular): Use Gauss–Jordan on \( [A \mid I] \to [I \mid A^{-1}] \).

RREF: Apply Gauss–Jordan to reduce A to row-reduced echelon form.

Rank: Number of nonzero rows in RREF within a tolerance \( \varepsilon \).

Solve \( A x = b \): Use RREF of \( [A \mid b] \); if \( A \) invertible, \( x = A^{-1} b \).

Glossary of Variables

How It Works: A Step-by-Step Example

Task: Multiply two 2×2 matrices.

Let \( A = \begin{bmatrix}1 & 2 \\ 3 & 4\end{bmatrix} \), \( B = \begin{bmatrix}2 & 0 \\ 1 & 2\end{bmatrix} \).

Then \( C = A B \) with entries \( c_{ij} = \sum_{k=1}^{2} a_{ik} b_{kj} \).

Compute: \( c_{11} = 1\cdot2 + 2\cdot1 = 4 \), \( c_{12} = 1\cdot0 + 2\cdot2 = 4 \), \( c_{21} = 3\cdot2 + 4\cdot1 = 10 \), \( c_{22} = 3\cdot0 + 4\cdot2 = 8 \).

Result: \( C = \begin{bmatrix}4 & 4 \\ 10 & 8\end{bmatrix} \).

Frequently Asked Questions (FAQ)

What is the maximum matrix size?

Up to 6×6 in this tool to ensure responsiveness and great performance on mobile devices.

Do empty inputs count as zeros?

Yes. Blank cells are treated as 0 to streamline data entry.

How does the tool ensure numerical stability?

Partial pivoting is used during elimination. Small values under a tolerance (1e−10) are treated as zero in RREF/rank.

Can it detect when A is singular?

Yes. If the pivot falls under tolerance, the inverse is not computed and an explanatory error is shown.

How can I copy results?

Use “Copy as CSV” to paste into spreadsheets, or “Copy as LaTeX” to paste into scientific documents.

Is there a way to analyze solution sets?

Use RREF(A) or Solve Ax = b. For underdetermined systems, the tool shows one solution if available and you can inspect the RREF for free variables.

Tool developed by Ugo Candido. Content reviewed by the CalcDomain Math Editors.
Last reviewed for accuracy on: .