Inverse matrix calculator with steps
The inverse of a square matrix A is the matrix A⁻¹ that multiplies with it to give the identity: AA⁻¹ = A⁻¹A = I. It exists only when the determinant of A is not 0. Our inverse matrix calculator, part of the Matrix Calculator, finds the inverse of any invertible matrix up to 5 by 5 with exact fractions, using the 2 by 2 formula or Gauss-Jordan elimination, and shows each step.
Matrix Calculator
Multiply, invert and find determinants and eigenvalues
How to find an inverse in the calculator
- Open the Matrix Calculator and choose the Inverse chip at the top of the Matrices section.
- Set the size of A. Only square matrices have inverses, so there is one size button, from 1 to 5.
- Type the entries. Fractions (type a slash) and decimals work.
- Read A⁻¹ at the top, with the determinant beside it. The answer stays exact, so you will often see fractions.
- Follow the working: for a 2 by 2, the formula; for 3 by 3 and bigger, A set beside the identity matrix and every row operation that turns A into I.
- To see a 3 by 3 straight away, press Inverse in the Examples section.
If the determinant is 0, the calculator tells you the matrix has no inverse instead of giving an answer.
Inverse of a 2x2 matrix
For a 2 by 2 matrix there is a formula. Swap the two entries on the main diagonal, change the signs of the other two, and divide everything by the determinant ad − bc:
Example 1: a 2 by 2 inverse
Find the inverse of A = [4, 7; 1, 2], writing each matrix row by row. The determinant is 4 × 2 − 7 × 1 = 1, so dividing by it changes nothing:
Check by multiplying: A × A⁻¹ has top left entry 4 × 2 + 7 × (−1) = 1, and the other entries come out as 0, 0 and 1. That is the identity, so the inverse is right.
Example 2: an inverse with fractions
For A = [4, 3; 6, 2], the determinant is 4 × 2 − 3 × 6 = −10. Swap, change signs, and divide by −10:
| −1/5 | 3/10 |
| 3/5 | −2/5 |
The calculator gives these fractions exactly. Decimals would be −0.2, 0.3, 0.6 and −0.4.
Inverse of a 3x3 matrix by Gauss-Jordan elimination
For 3 by 3 and bigger, write A and the identity side by side as [A | I]. Use row operations to turn the left half into I. Whatever you do to the left, do to the right as well, and when the left is I, the right is A⁻¹. Three row operations are allowed: swap two rows, multiply a row by a number that isn't 0, and add a multiple of one row to another.
Example 3: a 3 by 3 inverse
Find the inverse of A = [1, 2, 1; 0, 1, 1; 1, 3, 3]. Its determinant is 1, so it has an inverse. Each row below shows the left half | the right half.
| Step | Row 1 | Row 2 | Row 3 |
|---|---|---|---|
| Start: [A | I] | 1, 2, 1 | 1, 0, 0 | 0, 1, 1 | 0, 1, 0 | 1, 3, 3 | 0, 0, 1 |
| R3 − R1 | 1, 2, 1 | 1, 0, 0 | 0, 1, 1 | 0, 1, 0 | 0, 1, 2 | −1, 0, 1 |
| R1 − 2R2 | 1, 0, −1 | 1, −2, 0 | 0, 1, 1 | 0, 1, 0 | 0, 1, 2 | −1, 0, 1 |
| R3 − R2 | 1, 0, −1 | 1, −2, 0 | 0, 1, 1 | 0, 1, 0 | 0, 0, 1 | −1, −1, 1 |
| R1 + R3 | 1, 0, 0 | 0, −3, 1 | 0, 1, 1 | 0, 1, 0 | 0, 0, 1 | −1, −1, 1 |
| R2 − R3 | 1, 0, 0 | 0, −3, 1 | 0, 1, 0 | 1, 2, −1 | 0, 0, 1 | −1, −1, 1 |
The left half is now the identity, so the right half is the inverse: A⁻¹ = [0, −3, 1; 1, 2, −1; −1, −1, 1]. The calculator may choose its row operations in a different order, but the inverse is always the same, because a matrix has only one inverse.
For a second check, load the Inverse example in the calculator: A = [2, 1, 1; 1, 3, 2; 1, 0, 0] has determinant −1 and inverse [0, 0, 1; −2, 1, 3; 3, −1, −5].
Example 4: a matrix with no inverse
A = [2, 4; 3, 6] has determinant 2 × 6 − 4 × 3 = 0, so it has no inverse. It is called singular. Its second row is 1.5 times its first, so the rows point the same way and the matrix squashes the plane onto a line, which can't be undone. In Gauss-Jordan elimination, a singular matrix shows up as a row of zeros on the left.
Try one
Using an inverse to solve equations
Simultaneous equations can be written as Ax = b, where A holds the coefficients. Multiply both sides by A⁻¹ on the left and x = A⁻¹b. For 4x + 7y = 15 and x + 2y = 4, A = [4, 7; 1, 2], whose inverse is example 1's answer:
So x = 2 and y = 1. In the calculator, find A⁻¹ first, then use A × B with the column of right-hand sides as B.
Common mistakes
- Swapping the wrong entries. In the 2 by 2 formula, a and d swap places, and b and c only change sign.
- Forgetting to divide by the determinant, or dividing by its size and losing a minus sign.
- Taking 1 over each entry. That is not the inverse.
- Doing a row operation to only half of [A | I]. Every operation applies to the whole row.
- Not checking the determinant first. If it is 0, stop: there is no inverse.
- Multiplying on the wrong side when solving. x = A⁻¹b, not bA⁻¹.
Common questions
How do I know if a matrix has an inverse?
Can a non-square matrix have an inverse?
How do I check my inverse?
What is the inverse of a product?
Why does the calculator give fractions?
Revision cards
Read the front, say your answer, then flip to check.
Where to go next
- Solve it
Matrix Calculator
Multiply, invert and find determinants and eigenvalues
Open the tool - Test it
College Linear Algebra
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper