Matrix Calculator

Rows × Cols
For A×B, cols(A) must equal rows(B)

Matrix Calculator – Multiply, Invert, Determinant, Rank & Eigenvalues

Use our free Matrix Calculator to perform fast, accurate matrix operations online. Enter your matrices and instantly compute addition, subtraction, multiplication, transpose, determinant, inverse, rank, trace, and eigenvalues. Supports sizes from 2×2 up to 5×5.

What this Matrix Calculator can do

  • Matrix arithmetic: add A + B, subtract A − B, multiply A × B
  • Transpose: compute Aᵀ
  • Determinant: det(A) for square matrices
  • Inverse: A⁻¹ with step-by-step Gauss–Jordan (when invertible)
  • Rank: rank(A) via reduced row-echelon form
  • Trace: tr(A) (sum of diagonal)
  • Eigenvalues (numeric): QR-iteration approximation for square matrices
  • Precision controls: choose decimal places and show/hide steps

How to use the calculator

  • Choose an operation (Add, Subtract, Multiply, Determinant, Inverse, Rank, Transpose, Trace, Eigenvalues).
  • Set dimensions (Rows × Cols) for Matrix A (and B for two-matrix operations).
  • Enter values in the grid (blank cells are treated as 0).
  • Click Calculate to get the result.
  • Optional: toggle Show steps for inverses (Gauss–Jordan) or notes for eigenvalues (QR iteration).

Examples

1) Matrix multiplication (A × B)

If
A = \[1,2\[1, 2, 3,43, 4] and B = \[2,0\[2, 0, 1,21, 2]
then A × B = \[1⋅2+2⋅1,1⋅0+2⋅2\[1·2 + 2·1, 1·0 + 2·2, 3⋅2+4⋅1,3⋅0+4⋅23·2 + 4·1, 3·0 + 4·2] = \[4,4\[4, 4, 10,810, 8].

2) Determinant (det(A))

For A = \[a,b\[a, b, c,dc, d], det(A) = ad − bc.
Example: \[3,5\[3, 5, 2,72, 7] → det = 3·7 − 5·2 = 11.

3) Inverse (A⁻¹)

For a non-singular 2×2:
A⁻¹ = (1/det(A)) · \[d,−b\[d, −b, −c,a−c, a].
Example: A = \[4,7\[4, 7, 2,62, 6] → det = 10 →
A⁻¹ = (1/10)·\[6,−7\[6, −7, −2,4−2, 4] = \[0.6,−0.7\[0.6, −0.7, −0.2,0.4−0.2, 0.4].

4) Rank(A)

Rank is the number of non-zero rows in RREF(A). The tool shows the final result (optionally with steps).

5) Eigenvalues (numeric)

For symmetric matrices, eigenvalues are real; for general square matrices, values are approximated via QR iteration.

When to use each operation

  • Matrix multiplication: compose linear transformations, solve systems via A⁻¹b (when applicable).
  • Determinant: test invertibility (det ≠ 0) and scaling of volume.
  • Inverse: solve A x = b (or use LU/QR for better numerical stability on large systems).
  • Rank: detect linear dependence and system consistency.
  • Eigenvalues: study stability, modes, PCA, diagonalisation (when possible).

FAQs

Q: What sizes are supported?
2×2 up to 5×5 (square features like det/inverse/eigenvalues require square matrices).

Q: What does “Matrix is singular” mean?
det(A) = 0 → no inverse. Try rank(A) to diagnose dependence.

Q: Why are eigenvalues approximate?
They’re computed numerically (QR iteration). Results are typically accurate for well-conditioned matrices.

Q: What precision can I choose?
Select 3–10 decimal places.

Q: Can I copy the result?
Yes — use the Copy Results button to export scalar values or summaries.

Was this calculator helpful?

Rate your experience to help us improve.

Thanks for rating! See the average and total ratings above.

Not rated yet—be the first to rate this calculator.