Audited 29 Jul 2026·Last updated 31 Jul 2026·6 citations·Tier 1·0 uses

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

One row per line, entries separated by spaces or commas. Square only, max 10 × 10.
A⁻¹
[-2 1; 1.5 -0.5]
The unique matrix with AA⁻¹ = A⁻¹A = I, semicolons between rows. Not the entry-wise reciprocal. If you came here to solve Ax = b, the LAPACK Users' Guide advises against it: "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" — use elimination instead.
Invertibility
Invertible — det(A) = -2
det(A)
-2
Size (n × n)
2
Largest entry of A⁻¹
2

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.

A⁻¹ = adj(A) / det(A)

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.

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.

matrix A1 2 3 4

Frequently asked questions.

How do you find the inverse of a 2×2 matrix?
Use the closed form. For A = [a b; c d], compute the determinant ad − bc. If it is zero there is no inverse. Otherwise, swap the two diagonal entries, negate the two off-diagonal entries, and divide everything by the determinant: A⁻¹ = 1/(ad − bc) × [d −b; −c a]. For [1 2; 3 4] the determinant is 4 − 6 = −2, the rearranged matrix is [4 −2; −3 1], and dividing by −2 gives [−2 1; 1.5 −0.5].
When does a matrix have no inverse?
Exactly when its determinant is zero — such a matrix is called singular. Encyclopedia of Mathematics puts it as "invertibility of a matrix is equivalent to its being non-singular". In practice a zero determinant means the rows are linearly dependent: one row is a multiple of another, or a sum of others, or is all zeros. Geometrically the matrix collapses space onto a lower dimension, and no matrix can undo that collapse because the information about where points came from has been destroyed. It is the matrix equivalent of asking for the reciprocal of zero.
Is the inverse the same as taking one over each entry?
No, and this is the most common misconception about matrix inverses. The inverse of [1 2; 3 4] 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 why inverting is far more work than reciprocating and why changing one entry of A changes every entry of A⁻¹. Entry-wise operations on matrices — addition, subtraction, scaling — are on the separate matrix calculator; the inverse is not one of them.
Can a non-square matrix have an inverse?
Not a true one. The definition requires AA⁻¹ = A⁻¹A = I, and for an m × n matrix with m ≠ n the two products would be identity matrices of different sizes, so no single matrix can satisfy both. Rectangular matrices can have one-sided inverses, and every matrix has a Moore–Penrose pseudoinverse, which is what least-squares fitting uses — but neither is the inverse in the sense of this page, and neither is computed here. The calculator checks squareness first and tells you the shape it found.
Why does the guidance say not to use the inverse to solve Ax = b?
Because elimination does the same job faster and more accurately. The LAPACK Users' Guide, documenting the reference library behind MATLAB, NumPy and R, states: "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." Forming A⁻¹ costs roughly three times as much work as solving the system directly, and it introduces rounding in every one of the n² entries which then contaminates the product A⁻¹b. Use the inverse when you want the matrix itself — for a derivation, a change of basis, or a covariance calculation — not as a step towards a solution vector.
What does a very large "largest entry of A⁻¹" mean?
That your matrix is close to singular. The inverse divides by the determinant, so as the determinant approaches zero the entries of the inverse blow up. In the boundary case tested on this page, a determinant of 0.0000000001 produces entries of about ten billion. The practical meaning is that errors are magnified: a change of one part in ten billion in your input moves the answer by order one. The arithmetic is still exactly right for the numbers you typed, but the result may say very little about the matrix you meant to type.
How is the determinant computed here, and why does it matter?
Exactly, by Bareiss fraction-free elimination on an integer matrix. Every entry is first read to ten decimal places and multiplied by a power of ten so the matrix consists of whole numbers; Bareiss's algorithm then computes the determinant with divisions that are guaranteed to come out exact. That means testing for singularity needs no tolerance — zero really means zero. The usual alternative, Gauss-Jordan elimination, divides at each pivot and forces you to choose a cut-off below which a pivot counts as zero, and different cut-offs give different verdicts on the same matrix.
What is the adjugate, and how does it give the inverse?
The adjugate of A, written adj(A), is the transpose of the cofactor matrix, where the cofactor in position (i, j) is (−1)^(i+j) times the determinant of what remains after deleting row i and column j. The key identity is A · adj(A) = det(A) · I, so dividing the adjugate by the determinant produces exactly the matrix that multiplies A to give I — which is the definition of A⁻¹. For a 2 × 2 the adjugate of [a b; c d] is [d −b; −c a], which is where the familiar shortcut formula comes from.
What is the inverse of a product, and of a transpose?
The inverse of a product reverses the order: (AB)⁻¹ = B⁻¹A⁻¹, provided both factors are invertible. The reason is immediate — multiply AB by B⁻¹A⁻¹ and the inner pair BB⁻¹ collapses to the identity, leaving AA⁻¹ = I. The same reversal appears in transposition, (AB)ᵀ = BᵀAᵀ, and the two operations commute with each other: (A⁻¹)ᵀ = (Aᵀ)⁻¹. Encyclopedia of Mathematics lists that last identity among the standard properties of the transpose.
Does every invertible matrix have exactly one inverse?
Yes, and the proof is two lines. Suppose BA = I and AC = I. Then B = BI = B(AC) = (BA)C = IC = C, using only associativity of matrix multiplication. So a left inverse and a right inverse must be the same matrix, and there cannot be two different inverses. This is why we write "the" inverse and give it the notation A⁻¹ rather than treating it as one choice among many.
How can I check the answer myself?
Multiply A by the inverse and confirm you get the identity matrix. Copy the result into the matrix multiplication calculator with your original matrix and look for ones on the diagonal and zeros everywhere else. You can also check the determinant relationship: det(A⁻¹) should be exactly 1/det(A), so a determinant of −2 must give an inverse with determinant −0.5. Both checks are cheap and both catch a mistyped entry instantly.

References& sources.

  1. [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. [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. [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. [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. [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. [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
Coming soon