Math & Statistics

Matrix Inverse Calculator

Enter a square matrix to get its inverse as exact fractions, or as decimals if you prefer. The matrix inverse calculator shows Gauss-Jordan elimination on [A | I] one row operation at a time, gives the determinant, and multiplies A by its inverse to prove the answer.

Free, runs in your browserUpdated October 2026
Matrix size
Matrix A
Whole numbers, decimals and fractions such as 3/4 are accepted.
Show the inverse as
Examples
Inverse A⁻¹
–
Determinant–
Check A × A⁻¹–

Step-by-step Gauss-Jordan elimination

    Matrix Inverse Calculator diagram: a 3 × 3 matrix with determinant −1 has an all-integer inverse
    How the Matrix Inverse Calculator works: Exact inverse by Gauss-Jordan on [A | I], with a check

    How to Use the Matrix Inverse Calculator

    How to use the Matrix Inverse Calculator: size switch, matrix grid, format switch and inverse
    Numbered steps on the Matrix Inverse Calculator. Follow them in order.
    1. Choose the matrix size, 2 × 2 to 4 × 4.
    2. Type the entries. Fractions and decimals are accepted.
    3. Show the inverse as exact fractions or decimals.
    4. Read the inverse, then follow each Gauss-Jordan step below.

    Choose a size, 2 × 2, 3 × 3 or 4 × 4, and type the entries of your matrix. Whole numbers, decimals and fractions are accepted, and the inverse is calculated with exact fractions so there is no rounding at all. Use the format switch to see the same inverse as decimals rounded to six places.

    The result panel shows the inverse, the determinant and a check that A multiplied by its inverse gives the identity matrix. Below the tool, Gauss-Jordan elimination is written out one pivot at a time on the augmented matrix [A | I], so you can follow or copy each row operation. If the matrix is singular, the calculator says so and shows where the elimination breaks down.

    Gauss-Jordan Method

    Place the identity matrix next to A to form [A | I]. Then use row operations to turn the left half into the identity. The same operations turn the right half into the inverse.

    [A | I] → row operations → [I | A⁻¹]
    2 × 2: A = [a b; c d], A⁻¹ = (1 ÷ (ad − bc)) × [d −b; −c a]
    A⁻¹ = adj(A) ÷ det(A), and A × A⁻¹ = I

    Only three operations are allowed: swap two rows, multiply a row by a nonzero number, and add a multiple of one row to another. Each one is reversible, which is why the right half ends up as the inverse. For a 2 × 2 matrix the shortcut formula is faster, and the steps show it as well.

    Worked Examples

    A 2 × 2 matrix

    For A = [4 7; 2 6], the determinant is 4 × 6 − 7 × 2 = 10. Swap a and d, change the signs of b and c, and divide by 10: A⁻¹ = [6/10 −7/10; −2/10 4/10] = [3/5 −7/10; −1/5 2/5].

    A 3 × 3 matrix

    For A with rows (2, 1, 1), (1, 3, 2) and (1, 0, 0), expanding along the third row gives det(A) = 1 × (1 × 2 − 1 × 3) = −1. Gauss-Jordan elimination on [A | I] gives an inverse with rows (0, 0, 1), (−2, 1, 3) and (3, −1, −5). Multiplying A by this matrix returns the identity, which confirms the answer. Because the determinant is −1, every entry of the inverse is a whole number.

    When Does a Matrix Have No Inverse?

    A square matrix is invertible exactly when its determinant is not zero. If det(A) = 0, the matrix is singular: its rows are linearly dependent, elimination produces a row of zeros on the left, and no inverse exists. The matrix with rows (1, 2, 3), (4, 5, 6) and (7, 8, 9) is a classic example, because the middle row is the average of the other two.

    MatrixDeterminantInverse
    [4 7; 2 6]10[3/5 −7/10; −1/5 2/5]
    Rows (2, 1, 1), (1, 3, 2), (1, 0, 0)−1Rows (0, 0, 1), (−2, 1, 3), (3, −1, −5)
    Rows (1, 2, 3), (4, 5, 6), (7, 8, 9)0None (singular)

    What the Inverse Is Used For

    If Ax = b and A is invertible, then x = A⁻¹b. The inverse also undoes linear transformations in graphics, appears in least squares regression as (XᵀX)⁻¹, and is used for decoding in simple matrix ciphers. For solving a single system, elimination is usually quicker than finding the full inverse.

    Useful Properties

    The inverse of a product reverses the order: (AB)⁻¹ = B⁻¹A⁻¹. The inverse of the transpose is the transpose of the inverse, and det(A⁻¹) = 1 ÷ det(A).

    Tips and Limits

    • Only square matrices can have an inverse. Rectangular matrices have pseudo-inverses instead, which this tool does not compute.
    • Matrix multiplication is not commutative, but for an inverse both A × A⁻¹ and A⁻¹ × A equal I.
    • Decimals you type are read exactly, so 0.1 means 1/10.
    • Sizes up to 4 × 4 are supported.

    Frequently asked questions

    How do you find the inverse of a matrix?

    Write the augmented matrix [A | I] and use row operations to turn the left half into the identity. The right half is then the inverse. For a 2 by 2 matrix, the shortcut formula is quicker.

    What is the formula for a 2x2 inverse?

    For A = [a b; c d], the inverse is 1 divided by (ad minus bc) times [d minus b; minus c a]. It exists only when ad minus bc, the determinant, is not zero.

    When does a matrix not have an inverse?

    When its determinant is zero. Such a matrix is called singular. Its rows or columns are linearly dependent, so elimination produces a row of zeros and the identity cannot be reached.

    How can I check that an inverse is correct?

    Multiply the original matrix by the inverse. If the product is the identity matrix, with 1s on the diagonal and 0s elsewhere, the inverse is correct. The calculator does this check automatically.

    Can a non-square matrix have an inverse?

    No. Only square matrices can have a two-sided inverse. Rectangular matrices can have a one-sided inverse or a Moore-Penrose pseudo-inverse, which is a different calculation.

    Why use fractions instead of decimals?

    Fractions keep the inverse exact. Decimals such as 0.333333 are rounded, so multiplying back gives only an approximate identity. Exact fractions let you check the answer perfectly.