MatrixCalc

Matrix Calculator

Add, subtract, multiply, transpose, determinant, inverse, rank, trace and power. Up to 50×50.

Matrix A
rows: 3
cols: 3
Matrix B
rows: 3
cols: 3
Operations
Result
Pick an operation to see the result here. Errors will show up in this area.

Tips: adjust sizes (max 50×50). For A×B, cols(A)=rows(B). det/inverse/trace/power require square matrices.

React, Tailwind & shadcn/ui. No external math deps. — English

Matrix inverse calculator

Invert a square matrix and follow every row operation — by Gauss-Jordan elimination on [A | I], the adjugate formula or Montante's method. Exact fractions, not rounded decimals.

Enter your matrix, open the Advanced tab and press A⁻¹. If the matrix is singular you get a clear message instead of a wrong answer. The step-by-step panel shows the intermediate values as exact fractions — 3/5 rather than 0.6000000001 — because it runs on rational arithmetic rather than floating point.

When an inverse exists

Only for square matrices, and only when the determinant is non-zero. The inverse is the matrix that undoes the original: A·A⁻¹ = I. There is no such thing as an approximate inverse of a singular matrix — if the determinant is zero, information was destroyed and cannot be recovered.

Worked example

Gauss-Jordan writes the identity beside the matrix and reduces the left half to I:

4710
2601
103/5−7/10
01−1/52/5

Whatever the right half became is the inverse. Always verify by multiplying: A·A⁻¹ should give exactly the identity, and the A × B button does that check for you in two clicks.

Common mistakes

  • Inverting the entries one by one. The inverse is not the matrix of reciprocals — 1/a(i,j) has nothing to do with it.
  • Getting the order wrong. (A·B)⁻¹ = B⁻¹·A⁻¹, not A⁻¹·B⁻¹.
  • Solving systems through the inverse. For Ax = b, row-reducing [A | b] is fewer operations and numerically more accurate.
  • Using the adjugate on big matrices. It needs determinants of size n−1. Past 3×3 it is far slower than elimination.

Frequently asked questions

Why does the calculator say my matrix has no inverse?
Its determinant is zero, which makes it singular. Check whether one row is a multiple or a sum of the others — that is what causes it.
Can a non-square matrix be inverted?
Not in the usual sense. Rectangular matrices can only have a one-sided or pseudo-inverse, which is a different operation.
Why are the steps shown as fractions?
The step-by-step engine uses exact rational arithmetic, so intermediate values stay precise. You can switch the panel to decimals at any time.
How do I check my answer is right?
Multiply the inverse by the original matrix. The result must be the identity: ones on the diagonal, zeros everywhere else.

Want the full explanation? Read the guide: How to find the inverse of a matrix

Other calculators