Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Matrix Inverse


Symbolic visualization of A⁻¹ = adj(A) / det A — cofactors, transpose, determinant, divide.

Size of A (square)?The inverse of a square matrix A is the matrix A⁻¹ with A·A⁻¹ = A⁻¹·A = I. It exists exactly when det A ≠ 0. The adjugate formula builds it in four moves: compute every cofactor (a signed minor), transpose the cofactor matrix to get the adjugate, compute det A by expanding along the first row, then divide every entry of the adjugate by det A. Row reduction of [A | I] is the other standard route and scales better; this one shows the structure.
A3×32×2 or 3×3 — the cofactors are written out in full
A3×3
a1,1
a1,2
a1,3
a2,1
a2,2
a2,3
a3,1
a3,2
a3,3
C3×3
?
?
?
?
?
?
?
?
?
Step 1 / 22

Step explanations

1Inverse of A by the adjugate formula
A is 3×3. Its inverse, when it exists, is A⁻¹ = adj(A) / det A. The run computes every cofactor of A (a signed minor), transposes the cofactor matrix to get the adjugate, computes det A from the first-row cofactors, and finally divides every entry of the adjugate by det A. The last step is the one that can fail: if det A = 0 there is no inverse.
Nine small determinants, a transpose, one big determinant, a division. Learn more about the opening scene · what it is








Key Terms

Inverse — the matrix A1A^{-1} with AA1=A1A=IA A^{-1} = A^{-1} A = I. It exists exactly when detA0\det A \neq 0, and then it is unique.

MinorMi,jM_{i,j}, the determinant of the submatrix left after striking row ii and column jj of AA.

CofactorCi,j=(1)i+jMi,jC_{i,j} = (-1)^{i+j} M_{i,j}, the minor with the checkerboard sign attached.

Cofactor matrix — the matrix CC whose (i,j)(i,j) entry is Ci,jC_{i,j}.

AdjugateadjA=CT\operatorname{adj} A = C^T, the transpose of the cofactor matrix; also called the classical adjoint.

Adjugate formulaA1=adjAdetAA^{-1} = \dfrac{\operatorname{adj} A}{\det A}.

Singular matrix — a square matrix with detA=0\det A = 0; it has no inverse.

Row reduction — the other standard route: reduce [AI][A \mid I] to [IA1][I \mid A^{-1}] by row operations. It scales to any size; the adjugate formula shows the structure.

Getting Started with the Visualizer

Set the size of AA, then watch A1A^{-1} build in four phases.

• Use the Size stepper to choose 2×22 \times 2 or 3×33 \times 3; the cofactors are written out in full, which is why larger sizes are not offered
• Hover the ? icon for a reminder of what the inverse is and how the adjugate formula relates to row reduction
• Press play or step manually through the scene player; the speed selector and step log let you control pace and review
• The run computes every cofactor, transposes them into the adjugate, expands the determinant along the first row, and divides — the same four moves at either size
• Everything is symbolic: the entries of AA stay as ai,ja_{i,j}, so what you see is the formula, not a numerical example

The Four Phases

The visualizer separates the adjugate formula into four phases.

Phase 1 — cofactors: one scene per entry in row-major order. Row ii and column jj of AA are struck, the minor Mi,jM_{i,j} is read from what remains, and the cofactor Ci,j=(1)i+jMi,jC_{i,j} = (-1)^{i+j} M_{i,j} is written into the cofactor matrix
Phase 2 — transpose: the cofactor matrix is transposed in one scene, producing adjA\operatorname{adj} A
Phase 3 — determinant: detA=a1,1C1,1+a1,2C1,2+\det A = a_{1,1} C_{1,1} + a_{1,2} C_{1,2} + \cdots, the expansion along the first row using the cofactors already in hand, in one scene
Phase 4 — divide: one scene per entry; (A1)i,j=(adjA)i,j/detA(A^{-1})_{i,j} = (\operatorname{adj} A)_{i,j} / \det A

At 3×33 \times 3 that is 9+1+1+99 + 1 + 1 + 9 steps plus the intro and outro; at 2×22 \times 2, 4+1+1+44 + 1 + 1 + 4. Phase 3 is where the construction can fail: if detA=0\det A = 0 there is nothing to divide by and AA has no inverse.

The Opening Scene: A Matrix and an Empty Cofactor Grid

The player opens with AA on the left and an empty grid of the same shape on the right, waiting to hold the cofactors. At the default size AA is 3×33 \times 3.

Nothing is computed yet. What the scene establishes is the plan: the inverse will not be attacked directly, but assembled from nine smaller determinants, one per entry of AA.
A3×3a1,1a1,2a1,3a2,1a2,2a2,3a3,1a3,2a3,3C3×3?????????
Opening scene, frozen

A beside an empty grid of the same shape, waiting for its nine cofactors. The inverse is assembled from smaller determinants, one per entry, not attacked directly.

The shape is worth a moment. The inverse of an n×nn \times n matrix is n×nn \times n, and so are the cofactor matrix and the adjugate that lead to it. Nothing changes size along the way; only a single number, detA\det A, is extracted.

Only square matrices have inverses. A rectangular AA cannot satisfy AA1=A1A=IA A^{-1} = A^{-1} A = I, because the two products would have different shapes.

Phase 1: Cofactors, One Entry at a Time

The first sweep visits every entry of AA in row-major order. For each, the entry's own row and column are struck, the determinant of what remains is the minor, and the sign (1)i+j(-1)^{i+j} turns the minor into the cofactor.

The frozen picture below is the centre entry at 3×33 \times 3: row 22 and column 22 struck, the four corner entries forming the minor, and C2,2=a1,1a3,3a1,3a3,1C_{2,2} = a_{1,1} a_{3,3} - a_{1,3} a_{3,1} being written with four cofactors already in place.
A3×3a1,1a1,2a1,3a2,1a2,2a2,3a3,1a3,2a3,3C3×3a2,2a3,3a2,3a3,2a2,3a3,1a2,1a3,3a2,1a3,2a2,2a3,1a1,3a3,2a1,2a3,3a1,1a3,3a1,3a3,1????
Phase 1, the centre cofactor

Row 2 and column 2 struck through, the four corners forming the minor, and C2,2 being written with four cofactors already in place. The sign is + here: the centre of the checkerboard.

The sign follows a checkerboard: ++ at the corners and centre, - at the four edge-centres. The tool folds the sign into the written cofactor, so a negated minor appears with its two terms swapped rather than with a leading minus; the caption states which happened.

This phase is nine 2×22 \times 2 determinants, and that is the whole cost of the method at this size. It is also why the method does not scale: at 4×44 \times 4 it would be sixteen 3×33 \times 3 determinants.

Phase 2: Transposing into the Adjugate

The second phase is a single scene: the cofactor matrix is transposed, so the cofactor of ai,ja_{i,j} moves to row jj, column ii. The result is the adjugate.

The frozen picture below shows the cofactor matrix on the left and the adjugate on the right, every entry in its mirrored position.
C3×3a2,2a3,3a2,3a3,2a2,3a3,1a2,1a3,3a2,1a3,2a2,2a3,1a1,3a3,2a1,2a3,3a1,1a3,3a1,3a3,1a1,2a3,1a1,1a3,2a1,2a2,3a1,3a2,2a1,3a2,1a1,1a2,3a1,1a2,2a1,2a2,1adj A3×3a2,2a3,3a2,3a3,2a1,3a3,2a1,2a3,3a1,2a2,3a1,3a2,2a2,3a3,1a2,1a3,3a1,1a3,3a1,3a3,1a1,3a2,1a1,1a2,3a2,1a3,2a2,2a3,1a1,2a3,1a1,1a3,2a1,1a2,2a1,2a2,1
Phase 2, the transpose

Every cofactor moving to its mirrored position. The diagonal stays, the off-diagonal entries swap - this is the step that makes A · adj A come out as a multiple of I.

This is the step most often skipped, and skipping it is fatal unless AA happens to be symmetric. The reason for the transpose is in the product AadjAA \cdot \operatorname{adj} A: for the (i,i)(i,i) entry to be the cofactor expansion of detA\det A along row ii, row ii of AA must meet column ii of the adjugate, and that column has to hold the cofactors of row ii. Only the transpose puts them there.

The diagonal survives the transpose unchanged, which is why the 2×22 \times 2 shortcut swaps the diagonal entries of AA but negates the off-diagonal ones in place.

Phase 3: The Determinant from the First Row

The third phase is also a single scene. The determinant is expanded along the first row: each entry a1,ja_{1,j} is multiplied by its cofactor C1,jC_{1,j}, already computed in phase 1, and the products are added.

The frozen picture below shows the first row of AA against the first row of the cofactor matrix, with the detA\det A slot filled.
A3×3a1,1a1,2a1,3a2,1a2,2a2,3a3,1a3,2a3,3·C3×3a2,2a3,3a2,3a3,2a2,3a3,1a2,1a3,3a2,1a3,2a2,2a3,1a1,3a3,2a1,2a3,3a1,1a3,3a1,3a3,1a1,2a3,1a1,1a3,2a1,2a2,3a1,3a2,2a1,3a2,1a1,1a2,3a1,1a2,2a1,2a2,1det A|A|
Phase 3, the determinant

The first row of A against the first row of the cofactor matrix, det A filled. One row of products, reusing work already done - and the number that decides whether an inverse exists.

Reusing the cofactors is the efficiency of the method: the determinant costs one row of multiplications rather than a fresh calculation. Any row or column would do, since expanding along any of them gives the same number.

This is the decision point. If detA=0\det A = 0 the run should stop: the adjugate still exists, but dividing by zero is impossible and AA has no inverse. Geometrically, a zero determinant means AA flattens space, and a flattening cannot be undone.

Phase 4: Dividing by the Determinant

The last sweep divides every entry of the adjugate by detA\det A, one entry per scene, filling A1A^{-1}.

The frozen picture below is the centre entry at 3×33 \times 3: C2,2/AC_{2,2} / |A| being written, with four entries of the inverse already in place.
adj A3×3a2,2a3,3a2,3a3,2a1,3a3,2a1,2a3,3a1,2a2,3a1,3a2,2a2,3a3,1a2,1a3,3a1,1a3,3a1,3a3,1a1,3a2,1a1,1a2,3a2,1a3,2a2,2a3,1a1,2a3,1a1,1a3,2a1,1a2,2a1,2a2,1÷det A|A|=A⁻¹3×3C1,1/|A|C2,1/|A|C3,1/|A|C1,2/|A|C2,2/|A|????
Phase 4, mid-sweep

The centre entry of A−1 being formed from the adjugate and det A, four entries already in place. One common divisor for every entry.

Every entry is divided by the same number, so the inverse is the adjugate rescaled. At 2×22 \times 2 the entries are short enough to write out; at 3×33 \times 3 the tool names them Cj,i/AC_{j,i} / |A| rather than expanding each cofactor a second time.

The completed matrix satisfies AA1=IA A^{-1} = I. Row ii of AA against column ii of A1A^{-1} is the expansion of detA\det A along row ii, divided by detA\det A, which is 11. Row ii against column jj for iji \neq j is the expansion of a determinant with two equal rows, which is 00. The whole construction, and the single number that governs it, is on the screen at once.

Reading the Scene Player

Each scene combines highlights, arrows, and a caption.

• In phase 1, the pivot entry ai,ja_{i,j} is highlighted primary, the rest of its row and column are greyed and lined through, the surviving block is secondary, and the destination cofactor is accent; one arrow runs from the pivot to its cofactor
• In phase 2, every cofactor is secondary and every entry of the adjugate accent, with the caption describing the mirror swap
• In phase 3, the first row of AA is primary, the first row of the cofactor matrix secondary, and the detA\det A slot accent
• In phase 4, the active adjugate entry is primary, the detA\det A slot secondary, and the destination entry of A1A^{-1} accent, with arrows from both
• Cofactor cells show the full signed minor, for example a2,2a3,3a2,3a3,2a_{2,2} a_{3,3} - a_{2,3} a_{3,2}; at 3×33 \times 3 the entries of A1A^{-1} are written as Cj,i/AC_{j,i} / |A| to stay readable, and at 2×22 \times 2 they are written out
• The step log on the right keeps a record of every completed step across all phases

Choosing the Size

The stepper offers 2×22 \times 2 and 3×33 \times 3, and the limit is deliberate.

• At 2×22 \times 2 every minor is a single entry, so the whole formula is visible at once: swap the diagonal, negate the off-diagonal, divide by a1,1a2,2a1,2a2,1a_{1,1} a_{2,2} - a_{1,2} a_{2,1}
• At 3×33 \times 3 every minor is a 2×22 \times 2 determinant, and the nine cofactors are the real work; this is the size at which the checkerboard of signs starts to matter
• At 4×44 \times 4 each cofactor would be a 3×33 \times 3 determinant with six terms, and sixteen of them; the expressions no longer fit in a cell, and the method itself becomes impractical by hand
• For larger matrices, row reduction of [AI][A \mid I] is the method of choice; the Gaussian elimination tool animates that process on numerical matrices

What the Inverse Is

The inverse of a square matrix AA is the matrix A1A^{-1} satisfying

AA1=A1A=IA A^{-1} = A^{-1} A = I


It exists if and only if detA0\det A \neq 0, and when it exists it is unique. For a 2×22 \times 2 matrix the formula is short enough to memorize:

(abcd)1=1adbc(dbca)\begin{pmatrix} a & b \\ c & d \end{pmatrix}^{-1} = \frac{1}{ad - bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}


The general version of that formula is the adjugate formula,

A1=1detAadjA,(adjA)i,j=Cj,i=(1)i+jMj,iA^{-1} = \frac{1}{\det A}\,\operatorname{adj} A, \qquad (\operatorname{adj} A)_{i,j} = C_{j,i} = (-1)^{i+j} M_{j,i}


where Mj,iM_{j,i} is the minor obtained by deleting row jj and column ii. The 2×22 \times 2 case is exactly this: the cofactor of aa is dd, of bb is c-c, of cc is b-b, of dd is aa, and transposing puts b-b and c-c where the formula shows them.

Why it works: the (i,i)(i,i) entry of AadjAA \cdot \operatorname{adj} A is kai,kCi,k\sum_k a_{i,k} C_{i,k}, the cofactor expansion of detA\det A along row ii. The (i,j)(i,j) entry for iji \neq j is kai,kCj,k\sum_k a_{i,k} C_{j,k}, which is the expansion of a matrix whose rows ii and jj are equal, and that determinant is zero. So AadjA=(detA)IA \cdot \operatorname{adj} A = (\det A)\,I.

For the full treatment, including properties of inverses and the row reduction method, see the matrix inverse theory page; for minors and cofactors in depth, see the cofactors theory page.

Key Properties

The inverse interacts cleanly with the other matrix operations, with one famous reversal.

Existence: A1A^{-1} exists exactly when detA0\det A \neq 0, equivalently when the columns of AA are linearly independent, equivalently when Ax=0A\mathbf{x} = \mathbf{0} has only the trivial solution
Uniqueness: a matrix has at most one inverse
Involution: (A1)1=A(A^{-1})^{-1} = A
Product (order reverses): (AB)1=B1A1(AB)^{-1} = B^{-1} A^{-1}
Transpose: (AT)1=(A1)T(A^T)^{-1} = (A^{-1})^T
Scalar: (kA)1=1kA1(kA)^{-1} = \dfrac{1}{k} A^{-1} for k0k \neq 0
Determinant: det(A1)=1detA\det(A^{-1}) = \dfrac{1}{\det A}
Adjugate identity: AadjA=adjAA=(detA)IA \cdot \operatorname{adj} A = \operatorname{adj} A \cdot A = (\det A)\,I, which holds even when detA=0\det A = 0
Solving systems: if AA is invertible, Ax=bA\mathbf{x} = \mathbf{b} has the unique solution x=A1b\mathbf{x} = A^{-1}\mathbf{b}

Why It Matters

The inverse is the matrix that undoes a linear transformation, and that idea appears everywhere.

Solving linear systems: Ax=bA\mathbf{x} = \mathbf{b} becomes x=A1b\mathbf{x} = A^{-1}\mathbf{b}; in practice the system is solved directly, but the inverse is the concept behind it
Change of basis: converting coordinates back requires the inverse of the change-of-basis matrix
Undoing transformations: in graphics and robotics, the inverse of a rotation, scaling or shear returns an object to where it started
Diagonalization: A=PDP1A = P D P^{-1} needs P1P^{-1} to move between the standard basis and the eigenbasis
Cramer's rule: the adjugate formula, applied to x=A1b\mathbf{x} = A^{-1}\mathbf{b}, gives each unknown as a ratio of determinants
Statistics and least squares: the normal equations involve (ATA)1(A^T A)^{-1}, and covariance matrices are inverted to form precision matrices
Invertibility as a test: whether detA\det A is zero decides whether a system has a unique solution, whether a transformation is reversible, and whether a set of vectors is a basis

Worked Example

A 2×22 \times 2 case first:

A=(2153),detA=2315=1A = \begin{pmatrix} 2 & 1 \\ 5 & 3 \end{pmatrix}, \quad \det A = 2 \cdot 3 - 1 \cdot 5 = 1


Cofactors: C1,1=3C_{1,1} = 3, C1,2=5C_{1,2} = -5, C2,1=1C_{2,1} = -1, C2,2=2C_{2,2} = 2. Transpose to get the adjugate and divide by 11:

A1=(3152)A^{-1} = \begin{pmatrix} 3 & -1 \\ -5 & 2 \end{pmatrix}


Now a 3×33 \times 3 case:

A=(123014560)A = \begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 5 & 6 & 0 \end{pmatrix}


Cofactors, row by row: C1,1=024=24C_{1,1} = 0 - 24 = -24, C1,2=(020)=20C_{1,2} = -(0 - 20) = 20, C1,3=05=5C_{1,3} = 0 - 5 = -5; C2,1=(018)=18C_{2,1} = -(0 - 18) = 18, C2,2=015=15C_{2,2} = 0 - 15 = -15, C2,3=(610)=4C_{2,3} = -(6 - 10) = 4; C3,1=83=5C_{3,1} = 8 - 3 = 5, C3,2=(40)=4C_{3,2} = -(4 - 0) = -4, C3,3=10=1C_{3,3} = 1 - 0 = 1.

Determinant along the first row: detA=1(24)+220+3(5)=1\det A = 1 \cdot (-24) + 2 \cdot 20 + 3 \cdot (-5) = 1.

Transpose the cofactor matrix and divide by 11:

A1=(2418520154541)A^{-1} = \begin{pmatrix} -24 & 18 & 5 \\ 20 & -15 & -4 \\ -5 & 4 & 1 \end{pmatrix}


Check the first row of AA1A A^{-1}: (1,2,3)(1, 2, 3) against the columns gives 24+4015=1-24 + 40 - 15 = 1, 1830+12=018 - 30 + 12 = 0, 58+3=05 - 8 + 3 = 0. Set the visualizer to 3×33 \times 3 and step through to see the same nine cofactors, the transpose, and the division assembled symbolically.

Common Mistakes

A few mistakes recur.

Forgetting to transpose — the adjugate is the transpose of the cofactor matrix; using CC itself gives a wrong answer whenever AA is not symmetric
Losing the checkerboard signsCi,jC_{i,j} carries (1)i+j(-1)^{i+j}; at 3×33 \times 3 the four edge-centre cofactors are negated and the corners and centre are not
Dividing before checking the determinant — if detA=0\det A = 0 the adjugate still exists but the inverse does not; the adjugate identity gives AadjA=0A \cdot \operatorname{adj} A = 0
Mixing up the 2×22 \times 2 shortcut — swap the diagonal entries, negate the off-diagonal ones, then divide; swapping the off-diagonal entries instead is the classic slip
Reversing the order in a product(AB)1=B1A1(AB)^{-1} = B^{-1} A^{-1}, not A1B1A^{-1} B^{-1}
Assuming every square matrix is invertible — singular matrices are common, and any matrix with a zero row, two equal rows, or proportional columns is one
Expecting integer inverses — the entries of A1A^{-1} are cofactors divided by detA\det A, so fractions are the rule unless detA=±1\det A = \pm 1