Matrix Inverse Calculator

Determinant—
Inverse matrix—

How Matrix Inverse Calculator is calculated: A⁻¹ = (1/det) × [[d, −b], [−c, a]] where det = a×d − b×c; no inverse when det = 0

What is a matrix inverse?

The inverse of a matrix is the matrix that undoes it. If a matrix A turns a vector v into a new vector w, then the inverse of A turns w back into v. Multiply a matrix by its inverse, in either order, and you get the identity matrix — the matrix that changes nothing. That undoing property is what makes the inverse useful: it lets you solve equations, reverse transformations and recover original data from processed data.

Not every matrix has an inverse. A matrix has an inverse only when its determinant is not zero. When the determinant is zero, the matrix squashes space flat, information is lost, and there is no way back — no matrix can undo that. This calculator shows the determinant first, so you know immediately whether an inverse exists, and then shows the inverse itself when it does.

This calculator handles 2×2 matrices, the size most students meet first. Type in the four entries and the inverse appears instantly, shown with two decimal places. If the determinant is zero, the inverse row shows a dash instead of a number — that is the calculator telling you the inverse does not exist, not an error in the tool.

The 2×2 inverse formula

For a matrix [[a, b], [c, d]], the inverse is (1/det) × [[d, −b], [−c, a]], where det = a×d − b×c. In plain terms: swap the two diagonal entries, flip the signs of the two off-diagonal entries, and divide everything by the determinant. That is the whole formula, and it is one of the shortest in matrix algebra — which is why the 2×2 case is taught before any other size.

Take the default matrix on this page, [[4, 7], [2, 6]]. The determinant is 4×6 − 7×2 = 24 − 14 = 10. Swap the diagonal: 6 and 4. Flip the signs of the off-diagonal entries: −7 and −2. Divide each by 10: 0.60, −0.70, −0.20 and 0.40. The inverse is [[0.60, −0.70], [−0.20, 0.40]].

Check it by multiplying the original by its inverse. The top-left entry of the product is 4×0.60 + 7×(−0.20) = 2.40 − 1.40 = 1. The top-right is 4×(−0.70) + 7×0.40 = −2.80 + 2.80 = 0. The bottom-left is 2×0.60 + 6×(−0.20) = 1.20 − 1.20 = 0. The bottom-right is 2×(−0.70) + 6×0.40 = −1.40 + 2.40 = 1. The product is [[1, 0], [0, 1]] — the identity matrix, exactly as it should be. A scientific calculator can check each multiplication, but this page does the whole inversion in one step.

Why the determinant decides everything

The determinant sits in the denominator of the inverse formula, so when it is zero the formula divides by zero — which is why no inverse exists. A determinant of zero means the matrix collapses a whole plane onto a line: two different input vectors land on the same output, so no single inverse can send that output back to both of them. The information about which input you started from is gone.

The size of the determinant also tells you how the inverse behaves. When the determinant is small — say 0.01 — dividing by it multiplies every entry by 100, so the inverse has huge entries and tiny errors in the original matrix blow up into large errors in the answer. Matrices like that are called ill-conditioned, and they are a warning sign in engineering and data work: the solution exists, but it is fragile.

When the determinant is 1 or −1, the inverse is as well-behaved as it gets: the entries are just the swapped and sign-flipped originals, with no division at all. Rotation matrices have determinant 1, which is one reason rotations are so easy to undo — the inverse of a rotation is just the rotation in the opposite direction. For [[2, 5], [1, 3]], the determinant is 1, so the inverse is simply [[3, −5], [−1, 2]].

A worked example: inverting [[4, 7], [2, 6]]

Work through the default matrix from start to finish. The matrix is [[4, 7], [2, 6]]. First the determinant: 4×6 − 7×2 = 24 − 14 = 10. The determinant is not zero, so the inverse exists. That is the first thing to check, every time — if it had been zero, the work would stop here.

Next, swap the diagonal entries: the 4 and the 6 change places, giving [[6, 7], [2, 4]]. Then flip the signs of the off-diagonal entries: the 7 becomes −7 and the 2 becomes −2, giving [[6, −7], [−2, 4]]. Finally, divide every entry by the determinant, 10: [[0.60, −0.70], [−0.20, 0.40]]. That is the inverse, and it matches what the calculator shows.

Now try a matrix with no inverse: [[1, 2], [2, 4]]. The determinant is 1×4 − 2×2 = 4 − 4 = 0. The second row is exactly twice the first row, so the rows carry the same information. There is no inverse, and the calculator shows a dash for the inverse row. If you meet a matrix like this inside a real problem, the problem itself needs a second look — a duplicated equation, or a measurement that adds nothing new.

Where matrix inverses do real work

Solving simultaneous equations is the classic use. Two equations in two unknowns can be written as one matrix equation, A×x = b, and the solution is x = A⁻¹×b — the inverse times the right-hand side. A pair of equations for two unknown currents in a circuit, or two unknown prices in a market model, is solved exactly this way. The average calculator cannot solve a system; a matrix inverse can.

In computer graphics, the inverse undoes a transformation. If a matrix rotates and scales an object on screen, its inverse rotates and scales it back. Games and design tools invert matrices constantly, for example to convert a mouse click on screen back into a position in the game world. Without the inverse, the round trip would be impossible.

In statistics and machine learning, inverses appear in regression. The least-squares solution for fitting a line to data is built from the inverse of a matrix made from the data itself. When that matrix is singular — determinant zero — the regression has no unique solution, which usually means two of the input variables are saying the same thing. The standard deviation calculator measures spread for one variable; the inverse is what lets you untangle several variables at once.

Matrix inverse vs transpose — do not mix them up

The transpose and the inverse are the two matrices people confuse most often, and they are different things. The transpose swaps rows and columns: the transpose of [[4, 7], [2, 6]] is [[4, 2], [7, 6]]. It always exists, for any matrix, and it involves no division. The inverse swaps the diagonal, flips the off-diagonal signs, and divides by the determinant: [[0.60, −0.70], [−0.20, 0.40]]. It exists only when the determinant is not zero.

They agree in exactly one common case: rotation matrices. The inverse of a rotation is its transpose, which is why graphics code often uses the transpose instead of computing a full inverse — it is cheaper and just as correct for rotations. For a general matrix, though, the transpose is not the inverse, and using one in place of the other gives a wrong answer that can look plausible.

The adjoint is a third related matrix, and it is the step between the two: the inverse equals the adjoint divided by the determinant. For a 2×2 matrix the adjoint is just the swapped-and-sign-flipped matrix [[d, −b], [−c, a]], so the inverse is the adjoint over the determinant. If you are working through a textbook that uses the adjoint, you are doing the same calculation this calculator does, in two named steps instead of one.

Common matrix inverse mistakes

The first mistake is forgetting to divide by the determinant. Swapping the diagonal and flipping the signs gives the adjoint, not the inverse — for [[4, 7], [2, 6]] the adjoint is [[6, −7], [−2, 4]], and the inverse is that matrix divided by 10. Skipping the division is the single most common error, and it makes every entry ten times too big.

The second mistake is flipping the wrong signs. Only the off-diagonal entries change sign; the diagonal entries just swap places. Flipping the diagonal signs as well gives [[−0.60, −0.70], [−0.20, −0.40]], which is wrong. Remember the pattern: swap the diagonal, flip the off-diagonal, divide everything.

The third mistake is computing the determinant wrong and dividing by the wrong number. The determinant is a×d − b×c, with a minus. Adding the products gives 38 for the default matrix instead of 10, and every entry of the inverse comes out wrong. Check the determinant first, against the calculator, before you divide anything by it.

The fourth mistake is trying to invert a singular matrix. If the determinant is zero, stop — there is no inverse to find, and any method that claims to produce one has made an arithmetic error somewhere. The calculator shows a dash for the inverse in this case, which is the correct answer, not a failure.

How to use this matrix inverse calculator

Type your four numbers into the boxes: a top-left, b top-right, c bottom-left, d bottom-right. The determinant and the inverse update live as you type. The inverse is shown as a matrix with two decimal places, ready to copy into your working.

Read the determinant first. If it is zero, the inverse row shows a dash — the matrix has no inverse, and you should check whether the matrix itself is right before going further. If it is not zero, the inverse is the matrix shown, and you can verify it yourself by multiplying the original by the inverse: the product should be the identity matrix [[1, 0], [0, 1]].

Everything runs in your browser. No account, no sign-up, no data sent anywhere — your numbers never leave your device. Use it to check homework, to solve two-equation systems, or to undo a transformation while you work. If you need a quick check on a percentage while you work, a percentage calculator is the right tool for that part of the job.

Frequently Asked Questions

The determinant of [[4, 7], [2, 6]] is 4×6 − 7×2 = 24 − 14 = 10. Swap the diagonal and flip the off-diagonal signs to get [[6, −7], [−2, 4]], then divide by 10: the inverse is [[0.60, −0.70], [−0.20, 0.40]].

A matrix has an inverse only when its determinant is not zero. A zero determinant means the matrix squashes space flat and loses information, so no matrix can undo it. The calculator shows a dash for the inverse in that case.

No. The transpose swaps rows and columns and always exists. The inverse swaps the diagonal, flips the off-diagonal signs and divides by the determinant, and exists only when the determinant is not zero. For [[4, 7], [2, 6]] the transpose is [[4, 2], [7, 6]] and the inverse is [[0.60, −0.70], [−0.20, 0.40]].

Multiply the matrix by its inverse: the product must be the identity matrix [[1, 0], [0, 1]]. For [[4, 7], [2, 6]] times [[0.60, −0.70], [−0.20, 0.40]], the top-left entry is 4×0.60 + 7×(−0.20) = 1, the top-right is 0, the bottom-left is 0 and the bottom-right is 1.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.