Matrix Inverse Calculator
Free matrix inverse calculator. Invert any square matrix up to 10×10 with an exact determinant, an exact singularity test and a worked 2×2 and 3×3 example.
Matrix Inverse Calculator
Background.
The Quanta matrix inverse calculator finds A⁻¹ for any square matrix up to 10 × 10 — the unique matrix satisfying AA⁻¹ = A⁻¹A = I — and reports the determinant that decides whether an inverse exists at all, plus the largest entry of the result, which is the fastest practical warning that a matrix is nearly singular. Type the matrix one row per line, with entries separated by spaces or commas.
Two things about the way this page computes matter enough to state before the answer. First, the singularity test is exact, with no tolerance. Every entry is read to ten decimal places and then scaled to an exact integer, and every determinant is computed by Bareiss fraction-free elimination, in which each division is exact. So when this calculator says a matrix is singular it is not saying "a pivot got small"; it is saying the determinant is exactly zero. That matters because the usual approach, Gauss-Jordan elimination, divides at every pivot and forces you to invent a threshold for calling a pivot zero — and the answer then depends on the threshold you picked. Second, the only inexact operation anywhere in the computation is the final division by the determinant, which is carried at 400 significant digits and rounded once, to ten decimal places, for display.
The most important caveat belongs here rather than in an FAQ, because it changes how you should use the answer. If you came looking for the inverse in order to solve a system of equations Ax = b, you almost certainly should not. The LAPACK Users' Guide — the documentation of the reference numerical linear algebra library that underpins MATLAB, NumPy, R and essentially every scientific computing stack — says it plainly: "It is seldom necessary to compute the inverse of a matrix explicitly, and it is certainly not recommended as a means of solving linear systems." Solving by elimination is faster, uses less memory, and is more accurate than forming A⁻¹ and multiplying. The inverse is the right object when you need the matrix itself — in a derivation, in a covariance calculation, in a change of basis, when checking a hand computation, or when you have many right-hand sides and genuinely want the operator.
That said, the inverse is one of the most important objects in linear algebra, and knowing when it exists is half of a first course. A square matrix has an inverse if and only if its determinant is non-zero; Encyclopedia of Mathematics states the same fact as "invertibility of a matrix is equivalent to its being non-singular". Geometrically, a matrix with determinant zero collapses space onto a lower dimension — it squashes a plane onto a line, or a volume onto a plane — and nothing can undo that collapse, because information about where points came from has been destroyed. That is why a singular matrix has no inverse in the same way that zero has no reciprocal: the operation is not merely hard, it is impossible.
One more trap worth naming. The inverse of a matrix is not the matrix of reciprocals. For A = [1 2; 3 4], the inverse is [-2 1; 1.5 -0.5], not [1 0.5; 0.333… 0.25]. Every entry of A⁻¹ depends on every entry of A, through the determinant and the cofactors, which is exactly why inverting is expensive and why a small change in one input entry can move every entry of the answer.
The calculator also shows the largest entry of A⁻¹. When the determinant is close to zero, that number explodes — a determinant of one ten-billionth produces entries in the tens of billions — and it is telling you that any error in your input, including rounding at the tenth decimal place, is being magnified by roughly that factor. Treat a huge largest-entry figure as a warning that the answer, while arithmetically correct for the matrix you typed, may say very little about the matrix you meant.
What is matrix inverse calculator?
The inverse of a square matrix A is the matrix A⁻¹ satisfying AA⁻¹ = A⁻¹A = I, where I is the identity matrix of the same size. Encyclopedia of Mathematics defines it exactly that way: "The matrix A⁻¹ for which AA⁻¹=A⁻¹A=E, where E is the identity matrix." It plays the role for matrices that the reciprocal plays for numbers, with two important differences. Only square matrices can have one, since AA⁻¹ and A⁻¹A both have to be the same identity matrix, and even among square matrices only some do. The exact condition is that the determinant is non-zero — "invertibility of a matrix is equivalent to its being non-singular", in the same source's words. A matrix with a zero determinant is called singular, and it has no inverse at all, not an inverse that is merely hard to find. When the inverse exists it is unique: if BA = I and AC = I then B = B(AC) = (BA)C = C, so there is only ever one inverse. The standard closed form is A⁻¹ = adj(A)/det(A), where adj(A), the adjugate, is the transpose of the matrix of cofactors, and the cofactor Cᵢⱼ is (−1)^(i+j) times the determinant of the matrix left after deleting row i and column j. For a 2 × 2 this collapses to a formula worth memorising: the inverse of [a b; c d] is 1/(ad − bc) times [d −b; −c a], defined whenever ad − bc is not zero. Several useful properties follow from the definition. The inverse of an inverse is the original matrix, (A⁻¹)⁻¹ = A. The determinant of the inverse is the reciprocal of the determinant, det(A⁻¹) = 1/det(A). The inverse of a product reverses the order, (AB)⁻¹ = B⁻¹A⁻¹, in the same way transposition does. And the inverse commutes with transposition, (A⁻¹)ᵀ = (Aᵀ)⁻¹. Geometrically, an invertible matrix represents a linear map that is one-to-one and onto, so every output comes from exactly one input and the map can be run backwards; a singular matrix collapses at least one direction to zero, and no map can recover what was collapsed.
How to use this calculator.
- Type the matrix into the box, one row per line, entries separated by spaces or commas. It must be square — the same number of rows as columns — because only square matrices have inverses.
- Read A⁻¹ in the hero panel, with semicolons separating rows. [-2 1; 1.5 -0.5] means the first row is −2 1 and the second is 1.5 −0.5.
- Check the invertibility line. It states the verdict and prints the determinant that produced it, unrounded. That determinant is the entire reason an inverse exists, so it belongs beside the answer rather than buried.
- Look at the largest entry of A⁻¹. If it is enormous, your matrix is nearly singular: the answer is arithmetically right for the numbers you typed, but a small change in any input entry would move it a lot.
- Verify the answer yourself by multiplying A by A⁻¹ on the matrix multiplication calculator. You should get the identity matrix exactly. This is the single best check, and it takes ten seconds.
- If the calculator reports a singular matrix, look for a row that is a multiple of another, a row of zeros, or a row that is the sum of two others. Any of these forces the determinant to zero and there is no inverse to find.
- If your goal was to solve Ax = b, do not use the inverse. Elimination is faster and more accurate — the LAPACK Users' Guide says so explicitly, and the quote is in the intro above.
The formula.
The inverse is defined by what it does rather than by a recipe: A⁻¹ is the matrix for which AA⁻¹ and A⁻¹A both equal the identity. The classical closed form for computing it is A⁻¹ = adj(A)/det(A). The adjugate adj(A) is the transpose of the cofactor matrix, and the cofactor in position (i, j) is (−1)^(i+j) multiplied by the determinant of the smaller matrix left after crossing out row i and column j. Dividing that adjugate by the determinant gives the inverse, which is why a determinant of zero is fatal: you would be dividing by zero, and no inverse exists. For a 2 × 2 the whole construction collapses to a formula worth memorising — the inverse of [a b; c d] is 1/(ad − bc) times [d −b; −c a], swap the diagonal, negate the off-diagonal, divide by the determinant. Trace it through the worked example. A = [1 2; 3 4], so ad − bc = 1×4 − 2×3 = 4 − 6 = −2, which is not zero and so the inverse exists. Swapping the diagonal and negating the off-diagonal gives [4 −2; −3 1], and dividing every entry by −2 gives [−2 1; 1.5 −0.5]. Multiplying back to check: the top-left entry of A·A⁻¹ is 1×(−2) + 2×1.5 = −2 + 3 = 1, and the top-right is 1×1 + 2×(−0.5) = 1 − 1 = 0. The full product is the identity, as it must be. This calculator uses the adjugate route rather than Gauss-Jordan elimination, and the reason is the singularity test rather than the arithmetic. Gauss-Jordan divides at every pivot, so each division introduces a rounding, and deciding whether a matrix is singular becomes the question "is this pivot small enough to count as zero", which requires an invented tolerance and gives different answers for different tolerances. Here, entries are first read to ten decimal places and then multiplied by a power of ten so that the whole matrix consists of exact integers. Determinants of integer matrices are computed by Bareiss fraction-free elimination, an algorithm in which every division is guaranteed to come out exact, so the determinant of the scaled matrix is an exact integer and testing it against zero needs no tolerance at all. The real determinant is recovered by dividing by that power of ten raised to the size of the matrix, which is exact because it is a division by a power of ten. The only place a value can become inexact in the entire computation is the final division of each cofactor by the determinant. That is carried at 400 significant digits and rounded once, to ten decimal places, for display. One consequence of reading entries to ten decimal places is worth knowing: two matrices that differ only in the eleventh decimal place are treated as the same matrix, so a matrix that is singular after that rounding is reported as singular. That is deliberate, and it means the verdict always describes the matrix at the precision the page actually works in.
A worked example.
A is the 2 × 2 matrix [1 2; 3 4], so the size output is 2. First the determinant, because it decides whether there is anything to compute: det(A) = 1×4 − 2×3 = 4 − 6 = −2. That is not zero, so A is invertible and the invertibility output reads "Invertible — det(A) = -2", with the determinant output showing −2. Now the adjugate. The four cofactors are C₁₁ = +4, C₁₂ = −3, C₂₁ = −2 and C₂₂ = +1, and the adjugate is the transpose of that cofactor matrix, namely [4 −2; −3 1]. Dividing every entry by the determinant −2 gives 4 ÷ (−2) = −2 in the top-left, (−2) ÷ (−2) = 1 in the top-right, (−3) ÷ (−2) = 1.5 in the bottom-left, and 1 ÷ (−2) = −0.5 in the bottom-right. So the inverse output is [-2 1; 1.5 -0.5], and the maxAbsEntry output is 2, the largest absolute value among those four numbers. Check it by multiplying: the top-left entry of A·A⁻¹ is 1×(−2) + 2×1.5 = 1, the top-right is 1×1 + 2×(−0.5) = 0, the bottom-left is 3×(−2) + 4×1.5 = −6 + 6 = 0, and the bottom-right is 3×1 + 4×(−0.5) = 3 − 2 = 1. That is the identity matrix, so the answer is confirmed. For a 3 × 3, try the tridiagonal matrix [2 -1 0; -1 2 -1; 0 -1 2]: its determinant output is 4 and its inverse output is [0.75 0.5 0.25; 0.5 1 0.5; 0.25 0.5 0.75], which is one quarter of [3 2 1; 2 4 2; 1 2 3]. Change the second row of the original to [2 4] instead, giving [1 2; 2 4], and the calculator refuses: the second row is exactly twice the first, the determinant is 1×4 − 2×2 = 0, and no inverse exists.
Frequently asked questions.
How do you find the inverse of a 2×2 matrix?
When does a matrix have no inverse?
Is the inverse the same as taking one over each entry?
Can a non-square matrix have an inverse?
Why does the guidance say not to use the inverse to solve Ax = b?
What does a very large "largest entry of A⁻¹" mean?
How is the determinant computed here, and why does it matter?
What is the adjugate, and how does it give the inverse?
What is the inverse of a product, and of a transpose?
Does every invertible matrix have exactly one inverse?
How can I check the answer myself?
References& sources.
- [1]Encyclopedia of Mathematics (EMS Press / Springer), article "Inverse matrix" — "The matrix A⁻¹ for which AA⁻¹=A⁻¹A=E, where E is the identity matrix", and "Invertibility of a matrix is equivalent to its being non-singular". Retrieved 2026-07-29; open access.
- [2]LAPACK Users' Guide, 3rd edition (Anderson et al., SIAM, 1999), §2.3 "Linear Equations" — "It is seldom necessary to compute the inverse of a matrix explicitly, and it is certainly not recommended as a means of solving linear systems." Retrieved 2026-07-29; open access.
- [3]NIST Digital Library of Mathematical Functions, §1.3 "Determinants, Linear Operators, and Spectral Expansions", §1.3(i) elementary properties of determinants — the determinant identities behind the invertibility test. Retrieved 2026-07-29; open access.
- [4]Encyclopedia of Mathematics (EMS Press / Springer), article "Matrix" — the matrix product AA⁻¹ = E that defines the inverse, and the cofactor-and-determinant construction used to compute it. Retrieved 2026-07-29; open access.
- [5]MIT OpenCourseWare 18.06 Linear Algebra, Spring 2010, Prof. Gilbert Strang — lectures on inverses, Gauss-Jordan elimination and singular matrices. CC BY-NC-SA 4.0; retrieved 2026-07-29; open access.
- [6]Bareiss, E.H. (1968). "Sylvester's Identity and Multistep Integer-Preserving Gaussian Elimination." Mathematics of Computation 22(103), 565–578 — the fraction-free algorithm this calculator uses to compute every determinant exactly. The DOI resolves to ams.org, which returned HTTP 403 to an unauthenticated request, so this is a bibliographic, gated citation rather than a page read in full.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 977 calculators remain free
- No billing is enabled