Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Find an Inverse by Gauss-Jordan Elimination

Write AA and the identity side by side and row reduce the whole block. When the left half has become II, the right half is A−1A^{-1}; if a zero row appears on the left, AA has no inverse.

Recognize the task

A square matrix, usually 3×33 \times 3 or larger, whose inverse is wanted, or any size when you want one method that always works: (120011121)−1\begin{pmatrix} 1 & 2 & 0 \\ 0 & 1 & 1 \\ 1 & 2 & 1 \end{pmatrix}^{-1}. Test: is the matrix square? Row reduction itself tells you whether it is invertible.
The method is in the inverse by row reduction lesson section; it runs Gauss-Jordan elimination on the block [A∣I][A \mid I].

Steps

StepOn A=(120011121)A = \begin{pmatrix} 1 & 2 & 0 \\ 0 & 1 & 1 \\ 1 & 2 & 1 \end{pmatrix}
1Write the block [A | I]. Put the identity of the same size to the right of AA.(120100011010121001)\left(\begin{array}{ccc|ccc} 1 & 2 & 0 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 & 1 & 0 \\ 1 & 2 & 1 & 0 & 0 & 1 \end{array}\right)
2Clear the entries below each pivot. Use elementary row operations on whole rows, all six entries. Swap rows if a pivot is 00.R3−R1R_3 - R_1: row 3 becomes (0,0,1∣−1,0,1)(0, 0, 1 \mid -1, 0, 1)
3Clear the entries above each pivot. Work upward from the last pivot, as in Gauss-Jordan elimination for systems.R2−R3R_2 - R_3: (0,1,0∣1,1,−1)(0, 1, 0 \mid 1, 1, -1); then R1−2R2R_1 - 2R_2: (1,0,0∣−1,−2,2)(1, 0, 0 \mid -1, -2, 2)
4Scale each pivot to 1. Divide a row by its pivot. You may also do this before clearing; here every pivot is already 11.(100−1−2201011−1001−101)\left(\begin{array}{ccc|ccc} 1 & 0 & 0 & -1 & -2 & 2 \\ 0 & 1 & 0 & 1 & 1 & -1 \\ 0 & 0 & 1 & -1 & 0 & 1 \end{array}\right)
5Read the inverse from the right half and check. Multiply AA by the result (matrix multiplication); it must give II.A−1=(−1−2211−1−101)A^{-1} = \begin{pmatrix} -1 & -2 & 2 \\ 1 & 1 & -1 \\ -1 & 0 & 1 \end{pmatrix}, AA−1=IAA^{-1} = I ✓

Worked examples

Example 1 · a 2×2 matrix

no fractions
(21105301)\left(\begin{array}{cc|cc} 2 & 1 & 1 & 0 \\ 5 & 3 & 0 & 1 \end{array}\right)
AA next to II
2R2−5R12R_2 - 5R_1: (0,1∣−5,2)(0, 1 \mid -5, 2)
clears below the pivot
R1−R2R_1 - R_2: (2,0∣6,−2)(2, 0 \mid 6, -2), then 12R1\tfrac{1}{2}R_1: (1,0∣3,−1)(1, 0 \mid 3, -1)
clear above, then scale
A−1=(3−1−52)A^{-1} = \begin{pmatrix} 3 & -1 \\ -5 & 2 \end{pmatrix}

Example 2 · a zero pivot

row swap
A=(011101110)A = \begin{pmatrix} 0 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 0 \end{pmatrix}: swap R1R_1 and R2R_2
a pivot cannot be 00
R3−R1R_3 - R_1, then R3−R2R_3 - R_2: row 3 is (0,0,−2∣−1,−1,1)(0, 0, -2 \mid -1, -1, 1)
−12R3-\tfrac{1}{2}R_3, then R2−R3R_2 - R_3 and R1−R3R_1 - R_3
scale the pivot, clear above
A−1=12(−1111−1111−1)A^{-1} = \frac{1}{2}\begin{pmatrix} -1 & 1 & 1 \\ 1 & -1 & 1 \\ 1 & 1 & -1 \end{pmatrix}

Example 3 · a singular matrix

no inverse
A=(121243364)A = \begin{pmatrix} 1 & 2 & 1 \\ 2 & 4 & 3 \\ 3 & 6 & 4 \end{pmatrix}: R2−2R1R_2 - 2R_1, R3−3R1R_3 - 3R_1
left half rows (0,0,1)(0, 0, 1) and (0,0,1)(0, 0, 1); R3−R2R_3 - R_2 gives (0,0,0)(0, 0, 0)
a zero row on the left
AA is not invertible
the left half cannot reach II
Watch every row operation in the Gaussian elimination visualizer, or check the result in the matrix calculator.

See it happen

Each row operation is a multiplication on the left by an elementary matrix. The operations that turn AA into II multiply together to A−1A^{-1}. Because they act on both halves at once, the right half records exactly that product: it starts as II and ends as A−1A^{-1}.

Common mistakes

Stopping at echelon form

✗ reading the right half once the left half is triangular
✓ keep clearing above the pivots until the left half is exactly II

Operating on the left half only

✗ R3−R1R_3 - R_1 applied to (1,2,1)(1, 2, 1) but not to (0,0,1)(0, 0, 1)
✓ every operation acts on the whole row of 2n2n entries

Mixing in column operations

✗ subtracting one column from another to simplify
✓ only row operations keep the right half equal to the product of the steps

Missing the singular case

✗ "the inverse has a zero row"
✓ a zero row in the left half means no inverse exists