Key facts
- A matrix has an inverse only if it is square and its determinant is not zero.
- For a 2 × 2 matrix [[a, b], [c, d]], A⁻¹ = (1 ÷ (ad − bc)) × [[d, −b], [−c, a]].
- [[4, 7], [2, 6]] has determinant 10 and inverse [[3/5, −7/10], [−1/5, 2/5]].
- The default 3 × 3 matrix [[1, 2, 3], [0, 1, 4], [5, 6, 0]] has determinant 1 and the all-integer inverse [[−24, 18, 5], [20, −15, −4], [−5, 4, 1]].
- Larger inverses are found by row-reducing [A | I] until the left half becomes I; the right half is then A⁻¹.
How the inverse is found
2 × 2 matrices
A⁻¹ = (1 ÷ det A) × [[d, −b], [−c, a]], where det A = ad − bcSwap the diagonal entries, change the signs of the other two, and divide every entry by the determinant.
Larger matrices: Gauss-Jordan elimination
- Write the augmented matrix [A | I].
- Use row operations (swap rows, multiply a row by a non-zero number, add a multiple of one row to another) to turn the left half into the identity matrix.
- The right half is now A⁻¹. If a column has no non-zero pivot, the matrix is singular and has no inverse.
How to use the inverse matrix calculator
- Type the matrix one row per line, with entries separated by spaces or commas. Fractions like 1/2 and decimals are fine.
- Read the inverse in the table, with exact fractions.
- Check the steps: the 2 × 2 formula, or the list of row operations for larger matrices.
- Confirm the check line A × A⁻¹ = I.
Step-by-step examples: matrix inverses
Example 1: a 2 × 2 matrix
A = [[4, 7], [2, 6]]. det A = 4·6 − 7·2 = 10. A⁻¹ = (1/10) × [[6, −7], [−2, 4]] = [[3/5, −7/10], [−1/5, 2/5]]. Check: 4·(3/5) + 7·(−1/5) = 12/5 − 7/5 = 1 ✓.
Example 2: a 3 × 3 matrix by row reduction
A = [[1, 2, 3], [0, 1, 4], [5, 6, 0]], det A = 1.
- R₃ → R₃ − 5·R₁
- R₁ → R₁ − 2·R₂
- R₃ → R₃ + 4·R₂
- R₁ → R₁ + 5·R₃
- R₂ → R₂ − 4·R₃
The right half becomes A⁻¹ = [[−24, 18, 5], [20, −15, −4], [−5, 4, 1]]. Because det A = 1, every entry is an integer.
Example 3: a singular matrix
[[1, 2], [2, 4]] has determinant 1·4 − 2·2 = 0. Its rows are multiples of each other, so it has no inverse.
Properties of the inverse
| Property | Rule |
|---|---|
| Inverse of a product | (AB)⁻¹ = B⁻¹A⁻¹ |
| Inverse of the inverse | (A⁻¹)⁻¹ = A |
| Inverse of a transpose | (Aᵀ)⁻¹ = (A⁻¹)ᵀ |
| Determinant | det(A⁻¹) = 1 ÷ det A |
| Uniqueness | An invertible matrix has exactly one inverse |
Using the inverse to solve equations
A system Ax = b has the solution x = A⁻¹b when A is invertible. For the system 4x + 7y = 1, 2x + 6y = 0, multiplying by the inverse above gives x = 3/5 and y = −1/5. For large systems, elimination is faster and more accurate than computing the inverse; the system of equations calculator does that directly.
Adjugate method
Another formula is A⁻¹ = adj(A) ÷ det A, where adj(A) is the transpose of the cofactor matrix. It is elegant for 3 × 3 matrices by hand but takes many more steps than row reduction for larger ones.
Mistakes to avoid with matrix inverses
- Trying to invert a non-square matrix. Only square matrices can have inverses.
- Forgetting to divide by the determinant in the 2 × 2 formula.
- Rounding decimals early, which can make A × A⁻¹ come out slightly off. Exact fractions avoid this.
Inverting a matrix, from geodesy to secret codes
A square matrix has an inverse exactly when its determinant is not zero, and the inverse "undoes" the matrix just as dividing undoes multiplying. The standard hand method is Gauss–Jordan elimination: write the matrix next to the identity and row-reduce until the left side becomes the identity. It combines the elimination used by Carl Friedrich Gauss in his astronomical and surveying work with a refinement published in 1888 by the German geodesist Wilhelm Jordan in his handbook on surveying.
Matrix inverses once powered a famous cipher. In 1929 the American mathematician Lester S. Hill described the Hill cipher, which encrypts groups of letters by multiplying them by a key matrix modulo 26; decrypting needs the inverse matrix modulo 26. In statistics, the least-squares formula for linear regression contains the inverse of XᵀX. For matrices that are not square or not invertible, the Moore–Penrose inverse, developed by E. H. Moore in 1920 and Roger Penrose in 1955, gives the best possible substitute. In numerical software, engineers usually solve Ax = b directly rather than computing an inverse, because it is faster and more accurate. In US high schools, Common Core standard N-VM.C.10 links a nonzero determinant to having an inverse. To test invertibility first, use the determinant calculator; for systems of equations, the system of equations calculator; and for other operations, the matrix calculator.
Related: the matrix calculator, the determinant calculator and the matrix multiplication calculator.
How this calculator works
- Enter rows on separate lines with numbers separated by spaces or commas; matrices up to 8 × 8 are supported.
- All arithmetic is exact: fractions stay as fractions (for example 1/3), so there is no rounding error.
- Operations: determinant, inverse (with Gauss–Jordan steps and a check that A × A⁻¹ = I), multiplication (with the reverse product BA for comparison), powers up to 20, rank (with the reduced row echelon form), transpose, addition and subtraction.
- Size mismatches, such as multiplying a 2 × 3 by a 2 × 3, are explained rather than ignored.
Frequently asked questions
How do you find the inverse of a 2×2 matrix?
Swap a and d, change the signs of b and c, and divide every entry by the determinant ad − bc.
How do you find the inverse of a 3×3 matrix?
Row-reduce [A | I] until the left side is the identity, or use the adjugate divided by the determinant.
When does a matrix have no inverse?
When it is not square or its determinant is zero (a singular matrix).
What is the inverse of [[4, 7], [2, 6]]?
[[3/5, −7/10], [−1/5, 2/5]], since the determinant is 10.
How can I check an inverse?
Multiply A by A⁻¹. The result should be the identity matrix.
What is the inverse used for?
Solving systems of equations, undoing linear transformations and many formulas in statistics and engineering.
Is (AB)⁻¹ equal to A⁻¹B⁻¹?
No. It is B⁻¹A⁻¹, with the order reversed.
Why does the calculator show fractions?
Exact fractions avoid rounding errors, so the check A × A⁻¹ = I comes out exactly.