ZestCalc

Matrix Inverse Calculator

Invert any square matrix with exact fractions, watch [A | I] become [I | A⁻¹], and see the inverse undo what the matrix did.

Matrix

Enter a square matrix, or start from an example.

Up to 12 rows and 12 columns.

Use integers, decimals, or fractions such as 1/3. Paste rows from a spreadsheet or a Python list into any cell.

Input

A=[2111]A = \begin{bmatrix} 2 & 1 \\ 1 & 1 \end{bmatrix}

Inverse

Updates as you type.

1-1
-12

Multiplying back gives the identity, so this is the inverse:

[2111][1−1−12]=I\begin{bmatrix} 2 & 1 \\ 1 & 1 \end{bmatrix}\begin{bmatrix} 1 & -1 \\ -1 & 2 \end{bmatrix} = I

Work it out

2110
1101

Write A beside the identity. Every row operation that turns the left side into I also turns the right side into the inverse.

Step 0 of 4
Show all 4 row operations

What the inverse is

The inverse of a square matrix AA is the matrix A−1A^{-1} that undoes it:

AA−1=A−1A=IA A^{-1} = A^{-1} A = I

If AA transforms space, A−1A^{-1} transforms it back. That is only possible when AA doesn't collapse space, so a matrix has an inverse exactly when its determinant isn't 00. Otherwise it is called singular.

For a 2×22 \times 2 matrix there is a short formula:

[abcd]−1=1ad−bc[d−b−ca]\begin{bmatrix} a & b \\ c & d \end{bmatrix}^{-1} = \frac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

How to compute one

Row reduction works at every size. Write AA beside the identity and reduce:

[ A∣I ]⟶[ I∣A−1 ]\left[\, A \mid I \,\right] \longrightarrow \left[\, I \mid A^{-1} \,\right]

This works because each row operation is the same as multiplying on the left by some matrix. The operations that together turn AA into II must multiply to A−1A^{-1}, and the right side records that product as it is built up.

The adjugate formula expresses the inverse directly, as A−1=1det⁡Aadj⁡AA^{-1} = \frac{1}{\det A} \operatorname{adj} A. The adjugate is the transpose of the matrix of cofactors. It is useful for small matrices and for theory, but needs many determinants as the size grows.

Tips for using the calculator

  • Open Steps to watch the right side turn into the inverse, or switch to the adjugate formula to compare.
  • Open See with a 2×22 \times 2 matrix and apply A−1A^{-1} to watch the grid return to where it started. Try a singular matrix to see why it can't.
  • In Practice, the numbers are chosen so that both the matrix and its inverse have integer entries.
  • Use the links under the result to send the inverse to another calculator, or copy a link to come back to this matrix later.

A matrix's invertibility can also be read from its determinant in the Determinant Calculator, or from its pivots in the RREF Calculator. To check a result by hand, multiply it back with the Matrix Multiplication Calculator.