Matrix Inverse Calculator

Compute the inverse of a square matrix (2×2, 3×3, 4×4 and larger), get the determinant, and check if your matrix is singular or ill-conditioned.

Tip: leave cells empty for zeros. You can use negative numbers and decimals.

Determinant & invertibility

Determinant det(A):
Status:
Waiting for input

Inverse matrix A−1

The inverse matrix will appear here when you click Calculate inverse.

What is the inverse of a matrix?

In linear algebra, an invertible matrix (or non-singular matrix) is a square matrix A for which there exists another matrix A−1 such that A A−1 = A−1 A = I, where I is the identity matrix. A matrix is invertible if and only if its determinant is non-zero.

Key facts

  • Only square matrices (n×n) can be invertible.
  • A matrix has an inverse if and only if det(A) ≠ 0.
  • If A is invertible, then the inverse is unique.
  • The inverse of the inverse is the original matrix: (A−1)−1 = A.

Formula for the inverse of a 2×2 matrix

For a 2×2 matrix

A = \(\begin{bmatrix} a & b \\ c & d \end{bmatrix}\)

the determinant is det(A) = ad − bc. If det(A) ≠ 0, the inverse is

A−1 = \(\dfrac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}\).

The calculator uses this general principle but applies it numerically to larger matrices using Gauss–Jordan elimination.

How the calculator computes the inverse

For n×n matrices (including 3×3, 4×4, 5×5 and 6×6), the tool uses an augmented matrix approach:

  1. Form the augmented matrix \([A \mid I]\) where I is the n×n identity matrix.
  2. Apply Gauss–Jordan elimination with partial pivoting to reduce the left side to the identity matrix.
  3. If this succeeds, the right side of the augmented matrix becomes A−1.
  4. If at some step a pivot is (numerically) zero, the matrix is singular and has no inverse.

During the elimination, the algorithm also tracks the product of the pivot elements (with sign changes for row swaps) to compute det(A). If the determinant is extremely small in magnitude, the calculator warns that the matrix is nearly singular and the numeric inverse may be unreliable.

Determinant and invertibility

The determinant det(A) is a scalar that encodes several properties of the matrix and the corresponding linear transformation:

  • det(A) ≠ 0 → the matrix is invertible, and the linear map is bijective.
  • det(A) = 0 → the matrix is singular, and no inverse exists.
  • |det(A)| measures how volumes are scaled by the transformation represented by A.

In practical numeric work, if |det(A)| is extremely small, even though it is not exactly zero, the matrix is ill-conditioned: small perturbations in the data can cause large changes in the result.

Worked example

Consider the 3×3 matrix

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

Using Gauss–Jordan elimination, we obtain:

  • det(A) = 1 (so A is invertible).
  • The inverse matrix A−1 is

A−1 = \(\begin{bmatrix} -24 & 18 & 5 \\ 20 & -15 & -4 \\ -5 & 4 & 1 \end{bmatrix}\).

If you click Load example in the calculator with size 3×3, these values will be filled in so you can verify the computation.

FAQ – Matrix inverse calculator

Can I enter fractions or scientific notation?

You can enter decimals and standard scientific notation (for example 1e-3). Fractions like 1/3 are not parsed directly, so use a decimal approximation (e.g. 0.3333).

Why does the calculator say the matrix is singular?

A matrix is singular when its rows (or columns) are linearly dependent. In this case the determinant is zero, and there is no multiplicative inverse. Any method based on row reduction will fail to find a valid pivot in at least one step, which is exactly what the calculator detects.

How large a matrix can I invert?

This tool is designed for small to medium matrices, up to 6×6, which is typical for teaching, homework and many engineering calculations. For larger matrices or high-precision work, a dedicated numerical linear algebra library is recommended.

Is the result exact?

The calculator uses floating-point arithmetic, so the result is numerical and rounded to the number of decimal places you requested. For matrices with simple integer entries and moderate size, this is usually sufficient for practical purposes.