Category

Inverse Matrix Calculator — Find A⁻¹ Step by Step with Gauss-Jordan Elimination

Find the inverse of any 2×2, 3×3, or 4×4 matrix by Gauss-Jordan elimination. Watch the augmented matrix [A|I] turn into [I|A⁻¹] one row operation at a time, check whether your matrix is singular or nonsingular, and get the determinant free from the pivots. Includes the exact fraction inverse, the 2×2 shortcut formula, a verified A·A⁻¹ = I check, and all the matrix inverse properties tested on your own matrix. Solve A·x = b with support for metric, US customary, and 20 world currencies including the US dollar and the Russian ruble.

0 calculations

Calculation Parameters

Enter the entries row by row. Decimals and negative numbers are allowed.

b₁
b₂
b₃
b₄

The constants on the right of your equations. The chosen unit system applies to these values.

Enter Parameters

Fill in the form on the left and click "Calculate"

Inverse Matrix Calculator

Welcome to the inverse matrix calculator, where you'll have the chance to learn all about inverting matrices. This operation is similar to searching for the fraction of a given number, except now we're multiplying matrices and want to obtain the identity matrix as a result.

But don't worry. Before we give, say, the inverse of a 4×4 matrix, we'll look at some basic definitions, including a singular and nonsingular matrix. Then we'll move on to the general inverse matrix formula with a neat simplification for the inverse of a 2×2 matrix and some useful matrix inverse properties. Last but not least, we give an example with thorough calculations of how to find the inverse of a 3×3 matrix.

What is a matrix?

In primary school, they teach you the natural numbers, 1, 2, or 143, and they make perfect sense — you have 1 toy car, 2 comic books, and terribly long 143 days until Christmas. Then they tell you that there are also fractions (or rational numbers, as they call them), such as 1/2, or decimals, like 1.25, which still seems reasonable. After all, you gave 1/2 of your chocolate bar to your brother, and it cost $1.25. Next, you meet the negative numbers like −2 or −30, and they're a bit harder to grasp. But, once you think about it, one guy from your class got −2 points on a test for cheating, and there was a −$30 discount on jeans on Black Friday.

Lastly, the school introduces real numbers and some weird worm-like symbols that they keep calling square roots. What's even worse, while √4 is a simple 2, √3 is something like 1.73205... and the digits go on forever. They convince you that such numbers describe, for example, the diagonal of a rectangle. And then there's π, which somehow appeared out of nowhere when you talked about circles. Fair enough, maybe those numbers are real in some sense. But that's just about as far as it can go, right?

Wrong. Mathematicians are busy figuring out various interesting and, believe it or not, useful extensions of real numbers. The most important one is complex numbers, which are the starting point for any modern physicist. Fortunately, that's not the direction we're taking here. There is another.

A matrix is an array of elements (usually numbers) that has a set number of rows and columns. An example of a matrix would be:

⎡  3  −1 ⎤
⎢  0   2 ⎥
⎣  1  −1 ⎦

Moreover, we say that a matrix has cells, or boxes, in which we write the elements of our array. For example, matrix A above has the value 2 in the cell that is in the second row and the second column. The starting point here is 1-cell matrices, which are basically the same thing as real numbers.

As you can see, matrices are a tool used to write a few numbers concisely and operate with the whole lot as a single object. As such, they are extremely useful when dealing with:

  • Systems of equations, especially when using Cramer's rule;
  • Vectors and vector spaces;
  • 3-dimensional geometry (e.g., the dot product and the cross product);
  • Eigenvalues and eigenvectors; and
  • Graph theory and discrete mathematics.

Calculations with matrices are a great deal trickier than with numbers. For instance, if we want to add them, we first have to make sure that we can. But, since we're here on the inverse matrix calculator, we leave addition for later. First, however, let's familiarize ourselves with a few definitions.

Singular and nonsingular matrix, the identity matrix

Whether you want to find the inverse of a 2×2 matrix or the inverse of a 4×4 matrix, you have to understand one thing first: it doesn't always exist. Think of a fraction, say a/b. Such a thing is perfectly fine as long as b is non-zero. If it is, the expression doesn't make sense, and a similar thing happens for matrices.

A singular matrix is one that doesn't have an inverse. A nonsingular matrix is (surprise, surprise) one that does. Therefore, whenever you face an exercise with an inverse matrix, you should begin by checking if it's nonsingular. Otherwise, there's no point sweating over calculations. It just cannot be done.

You can still get pretty close to a singular matrix's inverse by instead calculating its Moore-Penrose pseudoinverse. If you don't know what the pseudoinverse is, wait no more and jump to the pseudoinverse calculator!

By definition, the inverse of a matrix A is a matrix A−1 for which:

A · A−1 = A−1 · A = I

Where I denotes the identity matrix, i.e., a square matrix that has 1s on the main diagonal and 0s elsewhere. For example, the 3×3 identity matrix is:

⎡ 1  0  0 ⎤
⎢ 0  1  0 ⎥
⎣ 0  0  1 ⎦

The identity matrix is the matrix equivalent of the number 1: multiplying any matrix by I leaves it unchanged, exactly as multiplying any number by 1 does. That is why "inverting" a matrix means finding the partner that multiplies with it to give I — just as 1/4 is the number that multiplies with 4 to give 1.

Note that only square matrices can have an inverse. A non-square matrix has no inverse in this sense, although it may still have a pseudoinverse.

How to find the inverse of a matrix: inverse matrix formula

There are two standard routes to A−1, and this calculator walks you through the one that scales best.

1. The Gauss-Jordan method (what this calculator shows)

Write your matrix A next to the identity matrix, forming the augmented matrix [ A | I ]. Then apply elementary row operations — swapping two rows, multiplying a row by a non-zero number, and adding a multiple of one row to another — until the left half becomes the identity. When it does, the right half has become the inverse:

[ A | I ]  →  [ I | A−1 ]

Why does this trick work? Every elementary row operation is the same as multiplying on the left by an elementary matrix E. Reducing A down to I means we found a chain Ek ··· E1 · A = I, which is precisely saying that Ek ··· E1 = A−1. Running those same operations on I just accumulates that product. So the right half isn't a coincidence — it is the inverse, being built one operation at a time.

If at some point a column has nothing but zeros where you need a pivot, the reduction stops: the matrix is singular and no inverse exists.

2. The adjugate (cofactor) formula

The general inverse matrix formula goes through the adjugate matrix:

A−1 = adj(A) / det(A) = cof(A)T / det(A)

This makes the singular case obvious: if det(A) = 0, we would be dividing by zero, so the inverse cannot exist. In other words, A is nonsingular exactly when det(A) ≠ 0. The formula is elegant, but the amount of work explodes as the matrix grows, which is why Gauss-Jordan is preferred for anything bigger than 3×3.

The 2×2 shortcut

For a 2×2 matrix the adjugate formula collapses into something you can memorize in seconds — swap the diagonal, flip the sign of the off-diagonal, divide by the determinant:

A  = ⎡ a  b ⎤        A−1 =   1   · ⎡  d  −b ⎤
     ⎣ c  d ⎦               ad−bc   ⎣ −c   a ⎦

Matrix inverse properties

Once you have A−1, a handful of properties come along for free. This calculator verifies each of them numerically on your own matrix rather than just listing them:

  • A · A−1 = A−1 · A = I — the defining property. Note this is one of the rare cases where matrix multiplication does commute.
  • (A−1)−1 = A — inverting twice brings you home.
  • det(A−1) = 1 / det(A) — which again shows why det(A) = 0 is fatal.
  • (AT)−1 = (A−1)T — transposing and inverting can be done in either order.
  • (kA)−1 = (1/k) · A−1 for any non-zero scalar k.
  • (AB)−1 = B−1 · A−1 — mind the order! It reverses, like taking off your shoes and socks.

A neat bonus of the Gauss-Jordan route: the determinant comes out for free. It is simply the product of the pivots you divided by along the way, with the sign flipped once for every row swap. You never need a separate determinant calculation.

Another one worth knowing: if every entry of A is a whole number and det(A) = ±1, then A−1 is made entirely of whole numbers too. Such matrices are called unimodular, and the calculator flags them for you.

Example: using the inverse matrix calculator

Say we want the inverse of the 3×3 matrix:

⎡ 1  2  3 ⎤
⎢ 0  1  4 ⎥
⎣ 5  6  0 ⎦
  1. Choose 3 × 3 in the matrix size field.
  2. Type the nine entries into the grid, row by row.
  3. Hit Calculate.

The calculator first reports that det(A) = 1, so the matrix is nonsingular and an inverse exists. Because the determinant is exactly 1, this matrix is unimodular — and sure enough, the answer contains no fractions at all:

A−1 = ⎡ −24   18    5 ⎤
      ⎢  20  −15  −4 ⎥
      ⎣  −5    4    1 ⎦

Below that you'll find the whole augmented reduction, one row operation at a time, so you can follow (or check) the homework by hand. The calculator also multiplies A by its inverse and shows you the resulting identity matrix, so you can see the answer verify itself.

Try changing the bottom-right entry from 0 to something that makes the rows dependent — for instance, the classic matrix with rows 1 2 3, 4 5 6, 7 8 9 has det = 0. The calculator will refuse to invert it and tell you it's singular, because the third row is just twice the second minus the first.

Units, currencies, and solving A·x = b

An inverse matrix is rarely the final goal — usually you want it to solve a system of equations. Tick Solve A·x = b, enter the right-hand side vector, and the calculator returns x = A−1 · b.

That's where the units come in. If your system describes lengths, pick the metric or US customary system. If it describes money — a classic use is mixing costs, prices, or production quantities — pick currency and choose from 20 world currencies, including the US dollar and the Russian ruble. The vector b and the solution x are then labelled in the units you chose.

Note that the entries of A−1 itself carry reciprocal units, which is why the calculator attaches the unit label to b and x rather than to the inverse matrix.

Calculation History

Loading...