How this calculation works
Place the identity matrix beside A and apply the same elementary row operations to both blocks. If the left block becomes the identity, the right block is the inverse. If it cannot, A is singular and has no ordinary inverse.
[A | I] → [I | A⁻¹]A worked example
The inverse of [1 2; 3 4] is [−2 1; 3/2 −1/2]. Multiplying either way with the original gives the identity matrix.
Good to know
For small matrices of exact rational numbers, up to 6 rows and 6 columns. Entries are limited to ±1,000,000; integer fraction denominators to 1,000,000. Decimal input allows up to 6 places. No expressions, scientific notation, complex numbers or uncertain measurements. Large intermediate fractions are bounded to keep the tool responsive.
Reference: University of Nebraska–Lincoln: inverse matrices and row reduction (opens in a new tab) ↗
Undoing a transformation is different from taking reciprocals
An inverse reverses the action of a square matrix on a vector. Taking the reciprocal of every entry usually does not do that. For A = [2 1; 0 1], the inverse is [1/2 −1/2; 0 1]; the off-diagonal term is needed to undo the mixing between coordinates.
A zero entry in A does not prevent an inverse. By contrast, two dependent rows can prevent an inverse even when every entry is nonzero. The row-reduction test checks independence rather than the appearance of individual entries.
Check both blocks of the calculation
The working begins with [A | I]. Every swap, scale and row replacement must affect the entire augmented row. Editing only the left block can make it look like an identity while leaving the right block unrelated to the inverse.
After copying the result, use matrix multiplication to check A × A⁻¹. For the accepted exact rational entries, each diagonal should be 1 and every off-diagonal should be 0. Reversing the order gives the same identity for a genuine square inverse.
An exact inverse does not remove input uncertainty
A matrix assembled from rounded measurements can have an exact rational inverse for the numbers you typed, while the real-world system is sensitive to small changes. Keep enough meaningful precision and consult an appropriate conditioning analysis before using an inverse for a consequential model. This calculator does not estimate that sensitivity.
For example, [1 1; 1 1.000001] differs only slightly from a singular matrix, yet its exact inverse contains large entries. If the last decimal place is not meaningful in your measurements, those large inverse values should not be interpreted as precise physical quantities.
A few questions, answered
What does “does not exist” mean?
The square input is singular. Its rows or columns do not contain enough independent information to have an ordinary two-sided inverse.
Can a rectangular matrix have an inverse here?
This tool calculates ordinary inverses of square matrices only. Left inverses, right inverses and pseudoinverses are different tasks and are not computed.
Should I always invert A to solve A x = b?
No. The linear system solver can row-reduce the augmented equations directly, including inconsistent or underdetermined cases where an ordinary inverse does not exist.