Inverse Matrix Calculator with Gauss–Jordan Steps

Find A−1 for a 2×2 through 6×6 matrix. See every pivot, row swap, normalization, and elimination operation—all without sending matrix entries anywhere.

Enter a Square Matrix

A pivot is treated as zero when its scaled size is at or below this threshold. Strict is suitable for most entered data.

Enter integers, decimals, or scientific notation. Display precision does not round intermediate calculations.

Put rows on separate lines and separate entries with spaces, commas, or tabs. A valid 2×2 through 6×6 paste changes the size automatically.

Inverse Matrix A−1

Enter a valid matrix to calculate its inverse.
Determinant
Row operations
max |A·A⁻¹ − I|
∞-norm condition estimate
The verification values appear after a successful inversion.

Advertisement

Gauss–Jordan Row-Operation Steps

Each stage creates one pivot column. The vertical divider separates the evolving left matrix from the evolving right matrix.

Calculate a valid matrix to see the augmented matrix [A | I] after every operation.

How Matrix Inversion by Gauss–Jordan Elimination Works

Start with an augmented matrix

[ A | I ]

Attach an identity matrix of the same size to the right of the original square matrix.

Apply row operations

Rᵢ ↔ Rⱼ   Rᵢ ← cRᵢ   Rᵢ ← Rᵢ + cRⱼ

Row swaps, nonzero row scaling, and adding a multiple of one row to another preserve the represented system.

Finish with the inverse

[ A | I ] → [ I | A⁻¹ ]

If the left side becomes the identity, the transformed right side is the unique inverse.

Numerical method: The calculator uses scaled partial pivoting and JavaScript double-precision arithmetic. It accepts zero or finite nonzero entries from 10⁻⁴⁰ through 10⁴⁰ in magnitude. The selected relative pivot tolerance determines when a numerical pivot is treated as zero; it does not change the displayed decimal places.

How to Use the Inverse Matrix Calculator

  1. Choose the square matrix size, then type every entry or paste a complete matrix.
  2. Keep the strict pivot tolerance for typical work. Choose a different threshold only when you understand the numerical precision of the data.
  3. Select Calculate inverse. If an inverse exists numerically, it appears with determinant, operation count, residual, and condition estimate.
  4. Open each pivot stage to follow the augmented matrix, then copy the summary or download all row-operation steps.

Worked 3×3 Inverse Example

The default matrix has determinant −1 and an integer inverse, making the row-operation result easy to check:

Original matrix A

[[2, 1, 1], [1, 3, 2], [1, 0, 0]]

Calculated inverse A⁻¹

[[0, 0, 1], [−2, 1, 3], [3, −1, −5]]

Multiplying these matrices in either order gives the 3×3 identity matrix. The calculator reports the floating-point residual so decimal examples can be checked in the same way.

Invertibility, Singular Matrices, and Numerical Limits

A matrix is invertible when the transformation it represents is one-to-one. Equivalent tests include a nonzero determinant, full rank, linearly independent rows and columns, and the ability to reduce A to I using row operations. If a pivot column has no usable pivot, the matrix is singular at the selected tolerance and the Gauss–Jordan process cannot produce a unique inverse.

A large condition estimate means small changes or rounding in A can cause much larger changes in A−1. For sensitive matrices, compare the residual, retain only digits justified by the inputs, and use the matrix condition number calculator for additional diagnostics.

Inverse Matrix Calculator FAQs

When does a matrix have an inverse?

Only a square, nonsingular matrix has a two-sided inverse. Its determinant is nonzero and its rows and columns are linearly independent.

How does Gauss–Jordan elimination find A⁻¹?

It applies the same elementary row operations to both halves of [A | I]. When the left half becomes I, the right half is A⁻¹.

Why are rows sometimes swapped?

Scaled partial pivoting compares candidate pivots with the size of their rows. A swap avoids a zero pivot and generally improves numerical stability.

What if the calculator says the matrix is singular?

No pivot larger than the selected scaled tolerance was available. The matrix may be exactly singular or too close to singular for that threshold. Review the inputs before lowering the tolerance.

What is the verification residual?

It is the largest absolute entry of A·A⁻¹ − I. Values near zero are expected, but the appropriate scale depends on matrix size, conditioning, and input precision.

Why do decimal answers sometimes have tiny errors?

Most decimal fractions cannot be represented exactly in binary floating point. Elimination and an ill-conditioned matrix can amplify those small errors.

Are my matrix entries private?

Yes. The page parses and calculates locally, and creates copied text and downloads in your browser. The calculator code does not transmit or save entered values.

Calculation Notes

Last reviewed: August 5, 2026 by the Starlight Tools editorial team.

The algorithm chooses the largest pivot relative to each candidate row’s original scale, records every row operation, and verifies the result with A·A⁻¹. A successful numerical result is not a claim of exact symbolic invertibility; use exact arithmetic software when exact rational results are required.

Explore more tools