MatrixCalc

How to find the inverse of a matrix

Gauss-Jordan elimination on [A | I], the adjugate formula and the 2×2 shortcut — with the conditions a matrix must satisfy to be invertible.

The inverse A⁻¹ of a square matrix is the matrix that undoes it: A·A⁻¹ = A⁻¹·A = I. It exists only when det(A) ≠ 0. A matrix with zero determinant is called singular, and it has no inverse at all — not a big one, not an approximate one, none.

The 2×2 shortcut

Swap the diagonal, negate the off-diagonal, divide by the determinant:

ab
cd
⁻¹ = 1/(ad − bc) ·
d−b
−ca

Gauss-Jordan on the augmented matrix

This is the general method and the one our calculator shows step by step. Write A next to the identity matrix, then run row operations until the left half becomes the identity. Whatever the right half turned into is A⁻¹:

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

If at some point a row on the left becomes all zeros, stop: the matrix is singular and the inverse does not exist.

The adjugate (cofactor) formula

A⁻¹ = adj(A) / det(A), where the adjugate is the transpose of the cofactor matrix. Build the matrix of cofactors C(i,j) = (−1)^(i+j)·M(i,j), transpose it, divide by the determinant.

It is elegant and it is what proofs use, but it needs determinants of size n−1. Beyond 3×3, use Gauss-Jordan.

Useful checks and properties

  • Always verify: multiply your answer by the original and confirm you get the identity.
  • (A·B)⁻¹ = B⁻¹·A⁻¹ — the order reverses.
  • (Aᵀ)⁻¹ = (A⁻¹)ᵀ
  • An orthogonal matrix satisfies A⁻¹ = Aᵀ, which makes inversion free.
  • To solve Ax = b, do not compute A⁻¹ and multiply. Row-reduce [A | b] instead — fewer operations and better numerical accuracy.

Keep reading

Want to try it? Open the matrix calculator and switch on the step-by-step panel.