CipherMatrix

Inverse Matrix Calculator

Enter a square matrix up to 5×5 to compute its inverse with Gauss–Jordan elimination on [A | I], with exact fractions, every row operation shown and a final verification.

What is the inverse of a matrix?

The inverse of a square matrix A is the matrix A⁻¹ such that A·A⁻¹ = A⁻¹·A = I, where I is the identity matrix. It plays the role of division: if Ax = b then x = A⁻¹b. Not every square matrix has an inverse. It exists exactly when the determinant is not zero, equivalently when the rank equals the size, or when the rows are linearly independent. Matrices without an inverse are called singular.

Computing the inverse with Gauss–Jordan elimination

Place A next to the identity matrix to form [A | I]. Apply row operations (swap, scale, add a multiple of a row) until the left block becomes I. Because every operation is equivalent to multiplying by an invertible matrix, the right block ends up as A⁻¹. The calculator displays each of these operations with the pivot highlighted, and handles row swaps automatically when a pivot position holds a zero.

This method scales to any size, unlike the cofactor formula A⁻¹ = adj(A)/det(A), which becomes unwieldy beyond 3×3. For small matrices the cofactor method is shown in the determinant and inverse tool for 2×2 and 3×3 matrices.

Detecting a singular matrix

If during elimination a column has no usable pivot, the left block cannot reach the identity and the matrix is singular. The calculator reports the rank and confirms the conclusion with an independently computed determinant of 0. Examples are a matrix with two equal rows, a row of zeros, or one row that is the sum of two others.

Applications

Inverses are used to solve linear systems, to undo linear transformations in computer graphics, to change coordinates, to decrypt the Hill cipher (where the key matrix must be inverted modulo 26) and in statistics, for example in the normal equations of linear regression. Using exact fractions avoids the rounding errors that make numerical inverses unreliable for nearly singular matrices.

Worked examples

These examples are computed by the same engine as the calculator above, so you can compare each step with your own working.

2×2

  • Matrix A: [[4, 7], [2, 6]]
det(A)
10
Inverse A⁻¹
[3/5, −7/10] [−1/5, 2/5]
shown as a matrix in the solution
For a 2×2 matrix the inverse is also 1/(ad − bc) · [[d, −b], [−c, a]] with ad − bc = 10.

Step-by-step solution

Formula used
[A | I] → [I | A⁻¹] by row operations
A⁻¹ exists ⇔ det(A) ≠ 0
A·A⁻¹ = A⁻¹·A = I
  1. NoteMethod
    Write the augmented matrix [A | I] and apply row operations until the left half becomes the identity matrix I. The same operations turn the right half into A⁻¹.
    If the left half cannot be reduced to I, the matrix is singular and has no inverse.
    A =4726
  2. StartStart with [A | I]
    A is 2×4. Work column by column from left to right. The current pivot row is called r (starting at row 1).
    Allowed row operations (they never change the rank): swap two rows, multiply a row by a nonzero number, add a multiple of one row to another.
    47102601
  3. PivotPivot selection (column 1)
    pivot = a₁₁ = 4
    Scan column 1 from row 1 downward: the first nonzero entry is a₁₁ = 4 (row 1). It already sits in the pivot position (1, 1).
    47102601
  4. Row multiplyRow multiplication
    R₁ ← (1/4)·R₁
    Divide row 1 by the pivot 4 (multiply by 1/4 = 1/4) so the pivot becomes 1.
    new R₁ = [4, 7, 1, 0] · (1/4) = [1, 7/4, 1/4, 0]
    1741402601
  5. Row additionElimination below the pivot (column 1)
    R₂ ← R₂ - 2·R₁
    Goal: turn a₂₁ = 2 into 0 using the pivot row R₁. (R₂ ← R₂ - (2)·R₁)
    new R₂ = [2, 6, 0, 1] - (2)·[1, 7/4, 1/4, 0] = [0, 5/2, -1/2, 1]
    174140052−121
  6. PivotPivot selection (column 2)
    pivot = a₂₂ = 5/2
    Scan column 2 from row 2 downward: the first nonzero entry is a₂₂ = 5/2 (row 2). It already sits in the pivot position (2, 2).
    174140052−121
  7. Row multiplyRow multiplication
    R₂ ← (2/5)·R₂
    Divide row 2 by the pivot 5/2 (multiply by 1/5/2 = 2/5) so the pivot becomes 1.
    new R₂ = [0, 5/2, -1/2, 1] · (2/5) = [0, 1, -1/5, 2/5]
    17414001−1525
  8. ResultRow echelon form (REF) reached
    Each pivot is 1, each pivot lies to the right of the pivot above it, and everything below a pivot is 0.
    Number of pivots = 2.
    17414001−1525
  9. Row additionEliminate above the pivot (column 2)
    R₁ ← R₁ - 7/4·R₂
    Goal: turn a₁₂ = 7/4 into 0 using the pivot row R₂. (R₁ ← R₁ - (7/4)·R₂)
    new R₁ = [1, 7/4, 1/4, 0] - (7/4)·[0, 1, -1/5, 2/5] = [1, 0, 3/5, -7/10]
    1035−71001−1525
  10. ResultReduced row echelon form (RREF) reached
    Every pivot is 1 and is the only nonzero entry in its column. The RREF of a matrix is unique.
    1035−71001−1525
  11. ResultRead the inverse from the right half
    A⁻¹ =35−710−1525
  12. CheckVerify A · A⁻¹ = I and A⁻¹ · A = I
    det(A) = 10 ≠ 0 (computed separately by elimination).
    A·A⁻¹ =1001A⁻¹·A =1001

3×3

  • Matrix A: [[2, 1, 1], [1, 3, 2], [1, 0, 0]]
det(A)
−1
Inverse A⁻¹
[0, 0, 1] [−2, 1, 3] [3, −1, −5]
shown as a matrix in the solution

Step-by-step solution

Formula used
[A | I] → [I | A⁻¹] by row operations
A⁻¹ exists ⇔ det(A) ≠ 0
A·A⁻¹ = A⁻¹·A = I
  1. NoteMethod
    Write the augmented matrix [A | I] and apply row operations until the left half becomes the identity matrix I. The same operations turn the right half into A⁻¹.
    If the left half cannot be reduced to I, the matrix is singular and has no inverse.
    A =211132100
  2. StartStart with [A | I]
    A is 3×6. Work column by column from left to right. The current pivot row is called r (starting at row 1).
    Allowed row operations (they never change the rank): swap two rows, multiply a row by a nonzero number, add a multiple of one row to another.
    211100132010100001
  3. PivotPivot selection (column 1)
    pivot = a₁₁ = 2
    Scan column 1 from row 1 downward: the first nonzero entry is a₁₁ = 2 (row 1). It already sits in the pivot position (1, 1).
    211100132010100001
  4. Row multiplyRow multiplication
    R₁ ← (1/2)·R₁
    Divide row 1 by the pivot 2 (multiply by 1/2 = 1/2) so the pivot becomes 1.
    new R₁ = [2, 1, 1, 1, 0, 0] · (1/2) = [1, 1/2, 1/2, 1/2, 0, 0]
    112121200132010100001
  5. Row additionElimination below the pivot (column 1)
    R₂ ← R₂ - R₁
    Goal: turn a₂₁ = 1 into 0 using the pivot row R₁. (R₂ ← R₂ - (1)·R₁)
    new R₂ = [1, 3, 2, 0, 1, 0] - (1)·[1, 1/2, 1/2, 1/2, 0, 0] = [0, 5/2, 3/2, -1/2, 1, 0]
    11212120005232−1210100001
  6. Row additionElimination below the pivot (column 1)
    R₃ ← R₃ - R₁
    Goal: turn a₃₁ = 1 into 0 using the pivot row R₁. (R₃ ← R₃ - (1)·R₁)
    new R₃ = [1, 0, 0, 0, 0, 1] - (1)·[1, 1/2, 1/2, 1/2, 0, 0] = [0, -1/2, -1/2, -1/2, 0, 1]
    11212120005232−12100−12−12−1201
  7. PivotPivot selection (column 2)
    pivot = a₂₂ = 5/2
    Scan column 2 from row 2 downward: the first nonzero entry is a₂₂ = 5/2 (row 2). It already sits in the pivot position (2, 2).
    11212120005232−12100−12−12−1201
  8. Row multiplyRow multiplication
    R₂ ← (2/5)·R₂
    Divide row 2 by the pivot 5/2 (multiply by 1/5/2 = 2/5) so the pivot becomes 1.
    new R₂ = [0, 5/2, 3/2, -1/2, 1, 0] · (2/5) = [0, 1, 3/5, -1/5, 2/5, 0]
    1121212000135−152500−12−12−1201
  9. Row additionElimination below the pivot (column 2)
    R₃ ← R₃ + 1/2·R₂
    Goal: turn a₃₂ = -1/2 into 0 using the pivot row R₂. (R₃ ← R₃ - (-1/2)·R₂)
    new R₃ = [0, -1/2, -1/2, -1/2, 0, 1] - (-1/2)·[0, 1, 3/5, -1/5, 2/5, 0] = [0, 0, -1/5, -3/5, 1/5, 1]
    1121212000135−1525000−15−35151
  10. PivotPivot selection (column 3)
    pivot = a₃₃ = -1/5
    Scan column 3 from row 3 downward: the first nonzero entry is a₃₃ = -1/5 (row 3). It already sits in the pivot position (3, 3).
    1121212000135−1525000−15−35151
  11. Row multiplyRow multiplication
    R₃ ← (-5)·R₃
    Divide row 3 by the pivot -1/5 (multiply by 1/(-1/5) = -5) so the pivot becomes 1.
    new R₃ = [0, 0, -1/5, -3/5, 1/5, 1] · (-5) = [0, 0, 1, 3, -1, -5]
    1121212000135−152500013−1−5
  12. ResultRow echelon form (REF) reached
    Each pivot is 1, each pivot lies to the right of the pivot above it, and everything below a pivot is 0.
    Number of pivots = 3.
    1121212000135−152500013−1−5
  13. Row additionEliminate above the pivot (column 3)
    R₁ ← R₁ - 1/2·R₃
    Goal: turn a₁₃ = 1/2 into 0 using the pivot row R₃. (R₁ ← R₁ - (1/2)·R₃)
    new R₁ = [1, 1/2, 1/2, 1/2, 0, 0] - (1/2)·[0, 0, 1, 3, -1, -5] = [1, 1/2, 0, -1, 1/2, 5/2]
    1120−112520135−152500013−1−5
  14. Row additionEliminate above the pivot (column 3)
    R₂ ← R₂ - 3/5·R₃
    Goal: turn a₂₃ = 3/5 into 0 using the pivot row R₃. (R₂ ← R₂ - (3/5)·R₃)
    new R₂ = [0, 1, 3/5, -1/5, 2/5, 0] - (3/5)·[0, 0, 1, 3, -1, -5] = [0, 1, 0, -2, 1, 3]
    1120−11252010−2130013−1−5
  15. Row additionEliminate above the pivot (column 2)
    R₁ ← R₁ - 1/2·R₂
    Goal: turn a₁₂ = 1/2 into 0 using the pivot row R₂. (R₁ ← R₁ - (1/2)·R₂)
    new R₁ = [1, 1/2, 0, -1, 1/2, 5/2] - (1/2)·[0, 1, 0, -2, 1, 3] = [1, 0, 0, 0, 0, 1]
    100001010−2130013−1−5
  16. ResultReduced row echelon form (RREF) reached
    Every pivot is 1 and is the only nonzero entry in its column. The RREF of a matrix is unique.
    100001010−2130013−1−5
  17. ResultRead the inverse from the right half
    A⁻¹ =001−2133−1−5
  18. CheckVerify A · A⁻¹ = I and A⁻¹ · A = I
    det(A) = −1 ≠ 0 (computed separately by elimination).
    A·A⁻¹ =100010001A⁻¹·A =100010001

Singular 3×3

  • Matrix A: [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
Inverse
Does not exist
det(A) = 0, rank = 2
det(A)
0
The rows of A are linearly dependent, so A collapses space onto a smaller dimension and cannot be undone.

Step-by-step solution

Formula used
A⁻¹ exists ⇔ det(A) ≠ 0 ⇔ rank(A) = n
  1. NoteMethod
    Write the augmented matrix [A | I] and apply row operations until the left half becomes the identity matrix I. The same operations turn the right half into A⁻¹.
    If the left half cannot be reduced to I, the matrix is singular and has no inverse.
    A =123456789
  2. StartStart with [A | I]
    A is 3×6. Work column by column from left to right. The current pivot row is called r (starting at row 1).
    Allowed row operations (they never change the rank): swap two rows, multiply a row by a nonzero number, add a multiple of one row to another.
    123100456010789001
  3. PivotPivot selection (column 1)
    pivot = a₁₁ = 1
    Scan column 1 from row 1 downward: the first nonzero entry is a₁₁ = 1 (row 1). It already sits in the pivot position (1, 1).
    123100456010789001
  4. Row additionElimination below the pivot (column 1)
    R₂ ← R₂ - 4·R₁
    Goal: turn a₂₁ = 4 into 0 using the pivot row R₁. (R₂ ← R₂ - (4)·R₁)
    new R₂ = [4, 5, 6, 0, 1, 0] - (4)·[1, 2, 3, 1, 0, 0] = [0, -3, -6, -4, 1, 0]
    1231000−3−6−410789001
  5. Row additionElimination below the pivot (column 1)
    R₃ ← R₃ - 7·R₁
    Goal: turn a₃₁ = 7 into 0 using the pivot row R₁. (R₃ ← R₃ - (7)·R₁)
    new R₃ = [7, 8, 9, 0, 0, 1] - (7)·[1, 2, 3, 1, 0, 0] = [0, -6, -12, -7, 0, 1]
    1231000−3−6−4100−6−12−701
  6. PivotPivot selection (column 2)
    pivot = a₂₂ = -3
    Scan column 2 from row 2 downward: the first nonzero entry is a₂₂ = -3 (row 2). It already sits in the pivot position (2, 2).
    1231000−3−6−4100−6−12−701
  7. Row multiplyRow multiplication
    R₂ ← (-1/3)·R₂
    Divide row 2 by the pivot -3 (multiply by 1/(-3) = -1/3) so the pivot becomes 1.
    new R₂ = [0, -3, -6, -4, 1, 0] · (-1/3) = [0, 1, 2, 4/3, -1/3, 0]
    12310001243−1300−6−12−701
  8. Row additionElimination below the pivot (column 2)
    R₃ ← R₃ + 6·R₂
    Goal: turn a₃₂ = -6 into 0 using the pivot row R₂. (R₃ ← R₃ - (-6)·R₂)
    new R₃ = [0, -6, -12, -7, 0, 1] - (-6)·[0, 1, 2, 4/3, -1/3, 0] = [0, 0, 0, 1, -2, 1]
    12310001243−1300001−21
  9. No pivotColumn 3: no pivot
    Every entry of column 3 from row 3 downward is 0, so this column has no pivot. Move one column to the right (the pivot row stays at R₃).
    12310001243−1300001−21
  10. PivotPivot selection (column 4)
    pivot = a₃₄ = 1
    Scan column 4 from row 3 downward: the first nonzero entry is a₃₄ = 1 (row 3). It already sits in the pivot position (3, 4).
    12310001243−1300001−21
  11. ResultRow echelon form (REF) reached
    Each pivot is 1, each pivot lies to the right of the pivot above it, and everything below a pivot is 0.
    Number of pivots = 3.
    12310001243−1300001−21
  12. Row additionEliminate above the pivot (column 4)
    R₁ ← R₁ - R₃
    Goal: turn a₁₄ = 1 into 0 using the pivot row R₃. (R₁ ← R₁ - (1)·R₃)
    new R₁ = [1, 2, 3, 1, 0, 0] - (1)·[0, 0, 0, 1, -2, 1] = [1, 2, 3, 0, 2, -1]
    12302−101243−1300001−21
  13. Row additionEliminate above the pivot (column 4)
    R₂ ← R₂ - 4/3·R₃
    Goal: turn a₂₄ = 4/3 into 0 using the pivot row R₃. (R₂ ← R₂ - (4/3)·R₃)
    new R₂ = [0, 1, 2, 4/3, -1/3, 0] - (4/3)·[0, 0, 0, 1, -2, 1] = [0, 1, 2, 0, 7/3, -4/3]
    12302−1012073−430001−21
  14. Row additionEliminate above the pivot (column 2)
    R₁ ← R₁ - 2·R₂
    Goal: turn a₁₂ = 2 into 0 using the pivot row R₂. (R₁ ← R₁ - (2)·R₂)
    new R₁ = [1, 2, 3, 0, 2, -1] - (2)·[0, 1, 2, 0, 7/3, -4/3] = [1, 0, -1, 0, -8/3, 5/3]
    10−10−8353012073−430001−21
  15. ResultReduced row echelon form (RREF) reached
    Every pivot is 1 and is the only nonzero entry in its column. The RREF of a matrix is unique.
    10−10−8353012073−430001−21
  16. ResultThe matrix is singular
    The left half cannot be reduced to the identity: rank(A) = 2 < 3.
    Consistent with det(A) = 0 (computed independently).
    A singular matrix has no inverse.

3×3 with fractions

  • Matrix A: [[1/2, 0, 1], [0, 1, 0], [1, 0, 1/3]]
det(A)
−5/6
Inverse A⁻¹
[−2/5, 0, 6/5] [0, 1, 0] [6/5, 0, −3/5]
shown as a matrix in the solution

Step-by-step solution

Formula used
[A | I] → [I | A⁻¹] by row operations
A⁻¹ exists ⇔ det(A) ≠ 0
A·A⁻¹ = A⁻¹·A = I
  1. NoteMethod
    Write the augmented matrix [A | I] and apply row operations until the left half becomes the identity matrix I. The same operations turn the right half into A⁻¹.
    If the left half cannot be reduced to I, the matrix is singular and has no inverse.
    A =12010101013
  2. StartStart with [A | I]
    A is 3×6. Work column by column from left to right. The current pivot row is called r (starting at row 1).
    Allowed row operations (they never change the rank): swap two rows, multiply a row by a nonzero number, add a multiple of one row to another.
    12011000100101013001
  3. PivotPivot selection (column 1)
    pivot = a₁₁ = 1/2
    Scan column 1 from row 1 downward: the first nonzero entry is a₁₁ = 1/2 (row 1). It already sits in the pivot position (1, 1).
    12011000100101013001
  4. Row multiplyRow multiplication
    R₁ ← (2)·R₁
    Divide row 1 by the pivot 1/2 (multiply by 1/1/2 = 2) so the pivot becomes 1.
    new R₁ = [1/2, 0, 1, 1, 0, 0] · (2) = [1, 0, 2, 2, 0, 0]
    1022000100101013001
  5. Row additionElimination below the pivot (column 1)
    R₃ ← R₃ - R₁
    Goal: turn a₃₁ = 1 into 0 using the pivot row R₁. (R₃ ← R₃ - (1)·R₁)
    new R₃ = [1, 0, 1/3, 0, 0, 1] - (1)·[1, 0, 2, 2, 0, 0] = [0, 0, -5/3, -2, 0, 1]
    10220001001000−53−201
  6. PivotPivot selection (column 2)
    pivot = a₂₂ = 1
    Scan column 2 from row 2 downward: the first nonzero entry is a₂₂ = 1 (row 2). It already sits in the pivot position (2, 2).
    10220001001000−53−201
  7. NoteNothing to eliminate
    All entries below the pivot in column 2 are already 0.
    10220001001000−53−201
  8. PivotPivot selection (column 3)
    pivot = a₃₃ = -5/3
    Scan column 3 from row 3 downward: the first nonzero entry is a₃₃ = -5/3 (row 3). It already sits in the pivot position (3, 3).
    10220001001000−53−201
  9. Row multiplyRow multiplication
    R₃ ← (-3/5)·R₃
    Divide row 3 by the pivot -5/3 (multiply by 1/(-5/3) = -3/5) so the pivot becomes 1.
    new R₃ = [0, 0, -5/3, -2, 0, 1] · (-3/5) = [0, 0, 1, 6/5, 0, -3/5]
    102200010010001650−35
  10. ResultRow echelon form (REF) reached
    Each pivot is 1, each pivot lies to the right of the pivot above it, and everything below a pivot is 0.
    Number of pivots = 3.
    102200010010001650−35
  11. Row additionEliminate above the pivot (column 3)
    R₁ ← R₁ - 2·R₃
    Goal: turn a₁₃ = 2 into 0 using the pivot row R₃. (R₁ ← R₁ - (2)·R₃)
    new R₁ = [1, 0, 2, 2, 0, 0] - (2)·[0, 0, 1, 6/5, 0, -3/5] = [1, 0, 0, -2/5, 0, 6/5]
    100−25065010010001650−35
  12. NoteColumn 2: already clear above the pivot
    All entries above the pivot at (2, 2) are already 0.
    100−25065010010001650−35
  13. ResultReduced row echelon form (RREF) reached
    Every pivot is 1 and is the only nonzero entry in its column. The RREF of a matrix is unique.
    100−25065010010001650−35
  14. ResultRead the inverse from the right half
    A⁻¹ =−25065010650−35
  15. CheckVerify A · A⁻¹ = I and A⁻¹ · A = I
    det(A) = −5/6 ≠ 0 (computed separately by elimination).
    A·A⁻¹ =100010001A⁻¹·A =100010001

4×4

  • Matrix A: [[1, 0, 2, 0], [0, 1, 0, 3], [1, 1, 1, 1], [2, 0, 1, 1]]
det(A)
−7
Inverse A⁻¹
[−3/7, −2/7, 2/7, 4/7] [−3/7, −2/7, 9/7, −3/7] [5/7, 1/7, −1/7, −2/7] [1/7, 3/7, −3/7, 1/7]
shown as a matrix in the solution

Step-by-step solution

Formula used
[A | I] → [I | A⁻¹] by row operations
A⁻¹ exists ⇔ det(A) ≠ 0
A·A⁻¹ = A⁻¹·A = I
  1. NoteMethod
    Write the augmented matrix [A | I] and apply row operations until the left half becomes the identity matrix I. The same operations turn the right half into A⁻¹.
    If the left half cannot be reduced to I, the matrix is singular and has no inverse.
    A =1020010311112011
  2. StartStart with [A | I]
    A is 4×8. Work column by column from left to right. The current pivot row is called r (starting at row 1).
    Allowed row operations (they never change the rank): swap two rows, multiply a row by a nonzero number, add a multiple of one row to another.
    10201000010301001111001020110001
  3. PivotPivot selection (column 1)
    pivot = a₁₁ = 1
    Scan column 1 from row 1 downward: the first nonzero entry is a₁₁ = 1 (row 1). It already sits in the pivot position (1, 1).
    10201000010301001111001020110001
  4. Row additionElimination below the pivot (column 1)
    R₃ ← R₃ - R₁
    Goal: turn a₃₁ = 1 into 0 using the pivot row R₁. (R₃ ← R₃ - (1)·R₁)
    new R₃ = [1, 1, 1, 1, 0, 0, 1, 0] - (1)·[1, 0, 2, 0, 1, 0, 0, 0] = [0, 1, -1, 1, -1, 0, 1, 0]
    102010000103010001−11−101020110001
  5. Row additionElimination below the pivot (column 1)
    R₄ ← R₄ - 2·R₁
    Goal: turn a₄₁ = 2 into 0 using the pivot row R₁. (R₄ ← R₄ - (2)·R₁)
    new R₄ = [2, 0, 1, 1, 0, 0, 0, 1] - (2)·[1, 0, 2, 0, 1, 0, 0, 0] = [0, 0, -3, 1, -2, 0, 0, 1]
    102010000103010001−11−101000−31−2001
  6. PivotPivot selection (column 2)
    pivot = a₂₂ = 1
    Scan column 2 from row 2 downward: the first nonzero entry is a₂₂ = 1 (row 2). It already sits in the pivot position (2, 2).
    102010000103010001−11−101000−31−2001
  7. Row additionElimination below the pivot (column 2)
    R₃ ← R₃ - R₂
    Goal: turn a₃₂ = 1 into 0 using the pivot row R₂. (R₃ ← R₃ - (1)·R₂)
    new R₃ = [0, 1, -1, 1, -1, 0, 1, 0] - (1)·[0, 1, 0, 3, 0, 1, 0, 0] = [0, 0, -1, -2, -1, -1, 1, 0]
    102010000103010000−1−2−1−11000−31−2001
  8. PivotPivot selection (column 3)
    pivot = a₃₃ = -1
    Scan column 3 from row 3 downward: the first nonzero entry is a₃₃ = -1 (row 3). It already sits in the pivot position (3, 3).
    102010000103010000−1−2−1−11000−31−2001
  9. Row multiplyRow multiplication
    R₃ ← (-1)·R₃
    Divide row 3 by the pivot -1 (multiply by 1/(-1) = -1) so the pivot becomes 1.
    new R₃ = [0, 0, -1, -2, -1, -1, 1, 0] · (-1) = [0, 0, 1, 2, 1, 1, -1, 0]
    1020100001030100001211−1000−31−2001
  10. Row additionElimination below the pivot (column 3)
    R₄ ← R₄ + 3·R₃
    Goal: turn a₄₃ = -3 into 0 using the pivot row R₃. (R₄ ← R₄ - (-3)·R₃)
    new R₄ = [0, 0, -3, 1, -2, 0, 0, 1] - (-3)·[0, 0, 1, 2, 1, 1, -1, 0] = [0, 0, 0, 7, 1, 3, -3, 1]
    1020100001030100001211−10000713−31
  11. PivotPivot selection (column 4)
    pivot = a₄₄ = 7
    Scan column 4 from row 4 downward: the first nonzero entry is a₄₄ = 7 (row 4). It already sits in the pivot position (4, 4).
    1020100001030100001211−10000713−31
  12. Row multiplyRow multiplication
    R₄ ← (1/7)·R₄
    Divide row 4 by the pivot 7 (multiply by 1/7 = 1/7) so the pivot becomes 1.
    new R₄ = [0, 0, 0, 7, 1, 3, -3, 1] · (1/7) = [0, 0, 0, 1, 1/7, 3/7, -3/7, 1/7]
    1020100001030100001211−1000011737−3717
  13. ResultRow echelon form (REF) reached
    Each pivot is 1, each pivot lies to the right of the pivot above it, and everything below a pivot is 0.
    Number of pivots = 4.
    1020100001030100001211−1000011737−3717
  14. Row additionEliminate above the pivot (column 4)
    R₂ ← R₂ - 3·R₄
    Goal: turn a₂₄ = 3 into 0 using the pivot row R₄. (R₂ ← R₂ - (3)·R₄)
    new R₂ = [0, 1, 0, 3, 0, 1, 0, 0] - (3)·[0, 0, 0, 1, 1/7, 3/7, -3/7, 1/7] = [0, 1, 0, 0, -3/7, -2/7, 9/7, -3/7]
    102010000100−37−2797−37001211−1000011737−3717
  15. Row additionEliminate above the pivot (column 4)
    R₃ ← R₃ - 2·R₄
    Goal: turn a₃₄ = 2 into 0 using the pivot row R₄. (R₃ ← R₃ - (2)·R₄)
    new R₃ = [0, 0, 1, 2, 1, 1, -1, 0] - (2)·[0, 0, 0, 1, 1/7, 3/7, -3/7, 1/7] = [0, 0, 1, 0, 5/7, 1/7, -1/7, -2/7]
    102010000100−37−2797−3700105717−17−2700011737−3717
  16. Row additionEliminate above the pivot (column 3)
    R₁ ← R₁ - 2·R₃
    Goal: turn a₁₃ = 2 into 0 using the pivot row R₃. (R₁ ← R₁ - (2)·R₃)
    new R₁ = [1, 0, 2, 0, 1, 0, 0, 0] - (2)·[0, 0, 1, 0, 5/7, 1/7, -1/7, -2/7] = [1, 0, 0, 0, -3/7, -2/7, 2/7, 4/7]
    1000−37−2727470100−37−2797−3700105717−17−2700011737−3717
  17. NoteColumn 2: already clear above the pivot
    All entries above the pivot at (2, 2) are already 0.
    1000−37−2727470100−37−2797−3700105717−17−2700011737−3717
  18. ResultReduced row echelon form (RREF) reached
    Every pivot is 1 and is the only nonzero entry in its column. The RREF of a matrix is unique.
    1000−37−2727470100−37−2797−3700105717−17−2700011737−3717
  19. ResultRead the inverse from the right half
    A⁻¹ =−37−272747−37−2797−375717−17−271737−3717
  20. CheckVerify A · A⁻¹ = I and A⁻¹ · A = I
    det(A) = −7 ≠ 0 (computed separately by elimination).
    A·A⁻¹ =1000010000100001A⁻¹·A =1000010000100001

Frequently asked questions

How do I know if a matrix has an inverse?

Its determinant must be non-zero. Equivalently, Gauss–Jordan elimination on [A | I] must reach [I | A⁻¹]. This tool shows both checks.

Is the inverse of a product the product of the inverses?

Yes, but in reverse order: (AB)⁻¹ = B⁻¹A⁻¹.

Can a non-square matrix have an inverse?

Not in the ordinary sense. Rectangular matrices can have one-sided inverses or a pseudo-inverse, which this calculator does not compute.

What is the inverse of a 2×2 matrix?

For rows (a, b) and (c, d), the inverse is 1/(ad − bc) times the matrix with rows (d, −b) and (−c, a), provided ad − bc is not 0.

Related calculators