Inverse Matrix Calculator
The inverse of a square matrix A is the matrix A⁻¹ that multiplies it back to the identity, and it exists only when the determinant of A is not zero. This page opens the matrix calculator with A⁻¹ already selected, so the first screen is already inverting: type over the grid, up to 8 rows by 8 columns, and the inverse appears as you type, with the second matrix out of the way because an inverse needs only one. Every entry is held as one whole number over another rather than as a decimal, so [1 2; 3 4] inverts to [-2 1; 3/2 -1/2] and [2 -1 0; -1 2 -1; 0 -1 2] inverts to [3/4 1/2 1/4; 1/2 1 1/2; 1/4 1/2 3/4] with nothing rounded at any step. The determinant and the rank of A are shown beside the result, and when A⁻¹ × A comes back as the exact identity the page says so in words.
| -2 | 1 |
| 3/2 | -1/2 |
The matrix that multiplies A back to the identity, in exact fractions.
Checked: A⁻¹ × A comes back as the exact identity matrix, with no rounding to look past.
Common questions
- How do I invert a 2×2 matrix here?
- Type the four numbers into grid A and read the answer off the right of the equals sign. The page starts on [1 2; 3 4], whose inverse is [-2 1; 3/2 -1/2]: that is the textbook rule of swapping the diagonal, negating the other two and dividing by the determinant ad − bc, which is −2 here. Put [4 7; 2 6] in instead and the determinant is 10 and the inverse is [3/5 -7/10; -1/5 2/5]. A cell takes a whole number, a decimal like 0.5, a fraction like 1/3, exponent notation like 1.5e-2, or the long minus sign that comes with anything pasted out of a PDF, and a cell left blank counts as zero.
- What happens when the matrix has no inverse?
- The page shows no result and says, in full: A is singular: its determinant is 0, so it has no inverse. At least one row is a combination of the others, so change an entry until no row can be built from the rest. The classic case is [1 2 3; 4 5 6; 7 8 9], where the third row is twice the second minus the first. Worked in decimals its determinant comes out at about 0.00000000000000067 rather than 0, so a calculator that trusts that number inverts it anyway and hands back entries around a thousand trillion. This one computes the determinant exactly, gets 0, and refuses. Pick the det A operation on the same page to see that zero for yourself.
- Can it invert a 3×3 or a larger matrix?
- Yes, up to 8 rows by 8 columns, with the row and column steppers above grid A. The method is Gauss-Jordan elimination on A with the identity written beside it: reduce the left half to the identity and the right half is the inverse, and a missing pivot is exactly the case where the determinant is zero. Invert [2 -1 0; -1 2 -1; 0 -1 2] and you get [3/4 1/2 1/4; 1/2 1 1/2; 1/4 1/2 3/4]. At 8×8 the answer still arrives on the keystroke, however awkward the fractions get, because the work is a single elimination pass rather than a cofactor expansion.
- Why does the answer come back as fractions instead of decimals?
- Because inverting divides by the determinant, and that answer usually is a fraction: the 3/2 in the inverse of [1 2; 3 4] is exactly three halves, and a third is a third rather than 0.3333333333. Holding every entry as a pair of whole numbers also means no error accumulates across the elimination, so an entry that should cancel to zero is zero. When a decimal is what you want, the Display switch under the stage turns the same exact values into decimals for reading at 0 to 10 places on the stepper, so 3/2 reads as 1.5 and 1/3 reads as 0.333 at three places while the value behind it is untouched.
- How do I check the inverse is right?
- The page checks it for you: it multiplies the answer back by A, and when A⁻¹ × A is the exact identity matrix it says so under the result. That check means something here because the arithmetic is exact, so the identity is a clean 1 on the diagonal and 0 everywhere else rather than 0.9999999999 and a scatter of tiny numbers. Beside the result, the Determinant cell reads not zero, so A can be inverted, and the Rank of A cell counts the rows that are not combinations of the others. The inverse copies out as plain text with aligned columns or as a LaTeX pmatrix, with each fraction written as \frac, for pasting into a write-up.
- Can I invert a rectangular matrix?
- No, and no calculator can: only a square matrix has an inverse, because A⁻¹ has to multiply A on either side and give the identity. Ask for one anyway and the page says which shape it got, for example: Only a square matrix has an inverse, and A is 2×3. Give A the same number of rows and columns. Use the column stepper to square the grid, or switch the operation to rref A, which reduces a rectangular matrix and is the usual way to solve an augmented system that has no inverse to fall back on.
- Does opening this page change the calculator I use for other operations?
- No. The operation is set to A⁻¹ for this page only, ahead of whatever the calculator last remembered, and that memory is left as it was: open the full matrix calculator again and it is still on the operation you left it on. The matrix you type does travel with you, because it is usually the one you are still working on. Everything runs in your browser, so nothing is uploaded and no account is involved.
Exact: matrices are computed in rational arithmetic, so an inverse of an integer matrix is shown as fractions rather than rounded decimals, and a singular matrix is reported as singular instead of producing huge numbers.