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

Matrix Inverse Calculator

Find the inverse of a square matrix up to 10 × 10, with an exact determinant, a clear singular-or-invertible verdict and a warning sign for near-singular input.

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 matrix A⁻¹ with AA⁻¹ = A⁻¹A = I, rows separated by semicolons and entries to ten decimal places; to solve Ax = b, elimination is faster and more accurate than multiplying by it.
Invertibility
Invertible — det(A) = -2
det(A)
-2
Size (n × n)
2
Largest entry of A⁻¹
2

Background.

A matrix that doubles every x-coordinate and quadruples every y-coordinate is undone by one that halves x and quarters y: the inverse of [2 0; 0 4] is [0.5 0; 0 0.25]. That is the whole idea of an inverse. A⁻¹ reverses whatever A does, so that A⁻¹A and AA⁻¹ both give the identity matrix I. Diagonal matrices make it look like taking reciprocals, and almost nothing else does. The inverse of [1 2; 3 4] is [−2 1; 1.5 −0.5], and each of those four numbers depends on all four entries of the original.

An inverse exists only when the determinant is not zero. A zero determinant means the matrix flattens space, a plane onto a line or a solid onto a plane, and once two different points have landed in the same place no matrix can tell them apart again. [1 2; 2 4] is the simplest case: its second row is twice its first, its determinant is 1 × 4 − 2 × 2 = 0, and it has no inverse, for the same reason zero has no reciprocal.

The calculator inverts any square matrix up to 10 × 10. It works out the determinant exactly, so a singular verdict means the determinant is zero, not merely small, and it reports the largest entry of the inverse as an early warning. When that number is enormous, the matrix is close to singular and tiny changes in the input swing the answer.

If your real aim is to solve a system Ax = b, you probably want a different tool. The LAPACK Users' Guide, which documents the library behind the linear-algebra routines of MATLAB, NumPy and R, says: "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." Elimination solves the system with less work and less rounding. The inverse earns its place when you need the matrix itself: checking a hand calculation, reversing a change of coordinates, or following a derivation that calls for A⁻¹.

What is matrix inverse calculator?

The inverse of a square matrix A is the matrix A⁻¹ for which AA⁻¹ = A⁻¹A = I, where I has ones on the diagonal and zeros everywhere else. Only square matrices can have one, because for a rectangular m × n matrix the two products would be identity matrices of different sizes. A square matrix with an inverse is called invertible or non-singular; one without is singular, and the dividing line is exactly det(A) ≠ 0. When an inverse exists it is unique: if BA = I and AC = I, then B = B(AC) = (BA)C = C.

Several rules follow from the definition. Inverting twice returns the original, (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⁻¹, since the last operation applied has to be the first one undone. Inverse and transpose can be taken in either order, (A⁻¹)ᵀ = (Aᵀ)⁻¹, so a symmetric matrix has a symmetric inverse. And when every entry of A is an integer and det(A) is 1 or −1, every entry of A⁻¹ is an integer too.

Geometrically, an invertible matrix is a linear map that is one-to-one and onto: each output comes from exactly one input, so the map can be run backwards. A singular matrix sends at least one non-zero direction to zero, and that lost direction cannot be brought back.

How to use this calculator.

  1. Type the matrix with one row per line, separating entries with spaces or commas; a semicolon also starts a new row, so 1,2;3,4 works on a single line. The matrix must be square and no larger than 10 × 10.
  2. Enter fractions as decimals: 1/2 is not read, so type 0.5. Entries are taken to ten decimal places, which means 1/3 becomes 0.3333333333, a very slightly different matrix from one with exact thirds.
  3. Read A⁻¹ with its rows separated by semicolons: [-2 1; 1.5 -0.5] has first row −2, 1 and second row 1.5, −0.5. Entries are given to ten decimal places.
  4. Check the invertibility line, which prints the determinant in full. The numeric det(A) figure is rounded, so a determinant below about 0.00000000005 can show there as 0 beside a perfectly valid inverse.
  5. Note the largest entry of A⁻¹, then confirm the result by multiplying A by A⁻¹ on the matrix multiplication calculator. You should get the identity matrix, apart from any tenth-decimal rounding in the entries.

The formula.

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

The inverse is built from the adjugate: A⁻¹ = adj(A) / det(A). Every entry of A has a cofactor, Cᵢⱼ = (−1)^(i+j) times the determinant of the smaller matrix left after deleting row i and column j. The adjugate is the transpose of the matrix of cofactors, and it satisfies A · adj(A) = det(A) · I. Dividing it by the determinant therefore gives exactly the matrix that multiplies A to make I, and the same identity shows why a zero determinant is fatal: there is nothing to divide by.

For a 2 × 2 the construction shrinks to a rule worth memorising. The inverse of [a b; c d] is 1/(ad − bc) × [d −b; −c a]: swap the diagonal entries, change the sign of the other two, and divide by the determinant. For [4 7; 2 6] the determinant is 24 − 14 = 10, so the inverse is 1/10 × [6 −7; −2 4] = [0.6 −0.7; −0.2 0.4].

The calculator takes the adjugate route rather than Gauss–Jordan elimination because of how it decides singularity. Elimination divides at every step, so judging whether a matrix is singular turns into judging whether a pivot is small enough to count as zero, and the verdict depends on where that cut-off sits. Here, entries are read to ten decimal places and multiplied by a power of ten until every one is a whole number. Determinants of that integer matrix are found by Bareiss's fraction-free elimination, in which every division comes out exact, so a zero determinant is exactly zero. The true determinant is the integer result divided by the power of ten raised to the size of the matrix. Only the final step, dividing each cofactor by the determinant, can produce a non-terminating decimal, which is why an entry such as 1/3 appears as 0.3333333333.

Two consequences matter in practice. Matrices that differ only beyond the tenth decimal place are treated as the same matrix, so [1 1; 1 1.00000000001] is reported as singular while [1 1; 1 1.0000000001] is invertible, with inverse entries of about ten billion. And the work grows steeply with size, because a separate determinant is needed for each of the n² cofactors; that is fine within the 10 × 10 limit, but it is not how large systems are handled in numerical software.

A worked example.

Example

Take A = [1 2; 3 4]. The determinant comes first, because it decides whether there is an inverse at all: 1 × 4 − 2 × 3 = 4 − 6 = −2. That is not zero, so the invertibility line reads 'Invertible — det(A) = -2', and the size is 2. The cofactors are C₁₁ = 4, C₁₂ = −3, C₂₁ = −2 and C₂₂ = 1. Transposed, they form the adjugate [4 −2; −3 1]. Dividing each entry by −2 gives 4 ÷ (−2) = −2, (−2) ÷ (−2) = 1, (−3) ÷ (−2) = 1.5 and 1 ÷ (−2) = −0.5, so A⁻¹ = [-2 1; 1.5 -0.5], and the largest entry in absolute value is 2. Multiplying back confirms it. Row 1 of A against the two columns of A⁻¹ gives 1 × (−2) + 2 × 1.5 = 1 and 1 × 1 + 2 × (−0.5) = 0; row 2 gives 3 × (−2) + 4 × 1.5 = 0 and 3 × 1 + 4 × (−0.5) = 1. That is the identity matrix. The determinant of the inverse, (−2)(−0.5) − (1)(1.5) = 1 − 1.5 = −0.5, is 1 ÷ (−2), exactly as the reciprocal rule requires.

matrix A1 2 3 4

Frequently asked questions.

What is the inverse of the 3 × 3 matrix [1 2 3; 0 1 4; 5 6 0]?
Expanding along the first row, the determinant is 1(0 − 24) − 2(0 − 20) + 3(0 − 5) = −24 + 40 − 15 = 1. Because it is 1 and every entry is an integer, the inverse has integer entries too: [-24 18 5; 20 -15 -4; -5 4 1]. Multiplying the two together gives the 3 × 3 identity matrix.
Why does [1 2 3; 4 5 6; 7 8 9] have no inverse?
Its rows are linearly dependent: the first and third rows add up to twice the second, since (1, 2, 3) + (7, 8, 9) = (8, 10, 12) = 2 × (4, 5, 6). Dependent rows force the determinant to zero, so the matrix squeezes three-dimensional space onto a plane and the calculator reports it as singular.
Why is solving Ax = b by multiplying by the inverse discouraged?
Computing A⁻¹ in full takes roughly three times the arithmetic of solving the system by elimination, and every one of its n² entries carries rounding that then feeds into the product A⁻¹b. That is why the LAPACK Users' Guide says an explicit inverse is not recommended for solving linear systems. Elimination, or the linear-equation solver, gets x more cheaply and more accurately.
What does an enormous largest entry in the inverse warn me about?
That the matrix is nearly singular. [1 1; 1 1.0000000001] has a determinant of 0.0000000001 and an inverse with entries of about 10,000,000,000. Dividing by a tiny determinant magnifies any error in the input by a similar factor, so if your entries came from measurement, the inverse may say little about the matrix you actually meant.
Can I enter exact fractions such as 1/3?
No; type decimals. Entries are read to ten decimal places, so 1/3 becomes 0.3333333333, and for sensitive matrices that matters. The 3 × 3 Hilbert matrix, with entries 1/(i + j − 1), has the exact inverse [9 −36 30; −36 192 −180; 30 −180 180], but typed with ten-decimal thirds its middle entry comes out as 192.0000016608.
Why is a matrix called singular when it differs from a singular one in the eleventh decimal place?
Entries are rounded to ten decimal places before the determinant is computed, so 1.00000000001 is read as 1. [1 1; 1 1.00000000001] therefore becomes [1 1; 1 1], whose determinant is exactly 0. The verdict describes the matrix as rounded to ten decimal places; rescale your entries if a difference that small genuinely matters.
Why does det(A) read 0 when an inverse was found?
The numeric determinant figure is rounded, while the invertibility line prints it in full. For [0.0000000001 0; 0 0.0000000001] the determinant is 10⁻²⁰, which rounds to 0 in the numeric figure, yet the inverse is a valid [10000000000 0; 0 10000000000]. Trust the invertibility line whenever the two appear to disagree.
Does a rectangular matrix have any kind of inverse?
Not a two-sided one, which is why non-square input is refused here. A tall matrix with independent columns has left inverses and a wide matrix with independent rows has right inverses, and every matrix has a Moore–Penrose pseudoinverse, the tool behind least-squares fitting. None of these satisfies both AA⁻¹ = I and A⁻¹A = I.
How can I check an inverse without a computer?
Multiply A by your answer and look for ones on the diagonal and zeros elsewhere. A quicker partial check uses determinants: det(A⁻¹) must equal 1/det(A). For [4 7; 2 6], det(A) = 10, and the inverse [0.6 −0.7; −0.2 0.4] has determinant 0.24 − 0.14 = 0.1, as it should.
Which matrices have inverses that can be written down at sight?
A diagonal matrix inverts entry by entry, with each diagonal number replaced by its reciprocal. A permutation matrix such as [0 1; 1 0] is undone by its transpose, and a rotation matrix likewise, because both are orthogonal. The inverse of an upper triangular matrix is again upper triangular, so it can be solved row by row from the bottom up.

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.

How this page was produced

Published by
Quanta Calculator
Primary sources
6 cited below
Method
A⁻¹ = adj(A) / det(A)
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon