MatrixStep

Inverse Matrix Calculator

Computes A⁻¹ by Gauss-Jordan elimination and shows each row operation.

INPUT

Integers, fractions (1/3) and decimals (0.25) are accepted. Empty cells count as 0. Paste a block of numbers from a spreadsheet or textbook into the first cell to fill the whole matrix.

RESULT

LaTeX is the math code you can paste into Overleaf, Notion equation blocks or Word's equation editor.

What is an inverse matrix?

The inverse A⁻¹ is the matrix with AA⁻¹ = A⁻¹A = I. It exists only for square matrices whose determinant is not zero.

Gauss-Jordan elimination applies row operations to [A | I] until the left half becomes the identity. The right half is then A⁻¹.

Full explanation with examples: How to Find the Inverse of a Matrix by Gauss-Jordan Elimination

Exam tipFor a 2×2 matrix, A⁻¹ = 1/(ad − bc) · [d −b; −c a] is the fastest route.

How to do it by hand

  1. Check the determinant first. If det(A) = 0 there is no inverse and you can stop.
  2. Write the identity matrix of the same size next to A to form the augmented matrix [A | I].
  3. Column by column, make the pivot 1 (divide its row by the pivot) and clear the rest of that column to 0 (subtract multiples of the pivot row from the other rows).
  4. When the last column is done the left half is I, and whatever is left on the right is A⁻¹.
  5. Check: multiply A by A⁻¹ and confirm you get the identity.
Worked example

Let's invert A = [2 1; 5 3]. det = 2·3 − 1·5 = 1, so the inverse exists.

[2 1 | 1 0; 5 3 | 0 1] → R₁ ÷ 2 → [1 ½ | ½ 0; 5 3 | 0 1]

R₂ − 5R₁ → [1 ½ | ½ 0; 0 ½ | −5/2 1] → R₂ × 2 → [1 ½ | ½ 0; 0 1 | −5 2]

R₁ − ½R₂ → [1 0 | 3 −1; 0 1 | −5 2]. So A⁻¹ = [3 −1; −5 2].

For 2×2 the formula 1/(ad−bc)·[d −b; −c a] = 1/1·[3 −1; −5 2] gives the same thing at once.

Where is it used?

  • Solving Ax = b as x = A⁻¹b, especially when the same A has to be solved for many different b.
  • Undoing a coordinate transform (reversing a rotation or scaling), decrypting a Hill cipher, and the normal equations of regression (XᵀX)⁻¹Xᵀy.
  • In real numerical work you rarely form the inverse explicitly; LU decomposition solves the system faster. Think of the inverse as the concept and LU as the tool.

Common mistakes

  • Applying a row operation to the left half only. The bar is just a separator; every operation applies to the whole row.
  • In the 2×2 formula, flipping the signs of b and c but forgetting to swap a and d. Diagonal entries swap places; off-diagonal entries change sign.
  • Converting fractions to decimals halfway through. 0.333… will not check out at the end. Keep exact fractions.

How to use

  1. Set the matrix size with the row and column buttons. Up to 6×6 is supported.
  2. Type numbers into the cells and the result updates instantly. Enter fractions as 1/3 and negatives as -2.
  3. Enter moves to the next cell; the ← → ↑ ↓ arrow keys move between cells.
  4. Open ‘Steps’ to see the full working. ‘Copy LaTeX’ copies the result as math code you can paste into Overleaf, a Notion equation block or Word's equation editor.

FAQ

How do I know a matrix has no inverse?
If the determinant is 0 there is no inverse. During elimination this shows up as a row of zeros on the left half.
Can I see the result as decimals?
Press ‘Decimal’ above the result to round to four decimal places. The calculation itself always uses exact fractions.
How can I check that AA⁻¹ = I?
Enter A and the inverse into the matrix multiplication calculator and confirm the product is the identity matrix.

Related guides