DigitHelm

Matrix Inverse Calculator

Calculate the inverse of a 2×2 or 3×3 matrix with step-by-step elimination.

Enter matrix A (2×2):

What Is the Matrix Inverse Calculator?

The Matrix Inverse Calculator computes the inverse of 2×2 and 3×3 matrices with full step-by-step working, showing the determinant, cofactor matrix, adjugate, and final inverse matrix displayed in visual bracket notation. The inverse is indispensable for solving linear systems, transforming coordinate systems, and computing least-squares solutions.

  • Visual matrix input: enter values directly into bracket-styled grids for both the input and result matrices.
  • 2×2 inverse: direct formula, swap diagonal, negate off-diagonal, divide by det.
  • 3×3 inverse: step-by-step, determinant, all 9 cofactors, adjugate (transpose), then multiply by 1/det.
  • Singular matrix detection: clearly reports when det ≈ 0 and no inverse exists, with explanation.
  • Verification note: result includes det(A) so users can verify A × A⁻¹ = I manually.
  • Handles fractions: all entries accept decimal inputs; results are shown as decimals for clean display.

Formula

A⁻¹ = (1 / det(A)) × adj(A)
2×2: A⁻¹ = (1/(ad−bc)) × [[d, −b], [−c, a]]  |  3×3: via cofactor matrix
StepDescriptionFor 2×2
1. DeterminantCompute det(A)det = ad − bc
2. CheckIf det = 0, no inverse existsSingular → stop
3. Cofactor matrixCᵢⱼ = (−1)^(i+j) × minor MᵢⱼC = [[d, −c], [−b, a]]
4. Adjugateadj(A) = transpose of cofactor matrixadj = [[d, −b], [−c, a]]
5. InverseA⁻¹ = (1/det) × adj(A)A⁻¹ = (1/det)[[d,−b],[−c,a]]

How to Use

  1. 1Choose matrix size: click 2×2 or 3×3.
  2. 2Enter all matrix entries into the visual grid (accepts integers, decimals, and negative numbers).
  3. 3Press Calculate (or Enter) to compute the inverse.
  4. 4Check the singular detection: if det ≈ 0, the matrix has no inverse and the reason is shown.
  5. 5Read the result matrix A⁻¹ displayed in bracket notation, all entries shown to 8 significant figures.
  6. 6Review the step-by-step working to see determinant, cofactors, adjugate, and the final multiplication.
  7. 7Verify: A × A⁻¹ should equal the identity matrix (all off-diagonals = 0, all diagonals = 1).

Example Calculation

Example 1, 2×2 inverse

A = [[4, 7], [2, 6]] Step 1, det(A) = 4×6 − 7×2 = 24 − 14 = 10 Step 2, Adjugate: swap diagonal, negate off-diagonal adj(A) = [[6, −7], [−2, 4]] Step 3, A⁻¹ = (1/10) × adj(A) A⁻¹ = [[0.6, −0.7], [−0.2, 0.4]] Verify: A × A⁻¹ = [[4,7],[2,6]] × [[0.6,−0.7],[−0.2,0.4]] = [[4×0.6+7×(−0.2), 4×(−0.7)+7×0.4], [2×0.6+6×(−0.2), 2×(−0.7)+6×0.4]] = [[2.4−1.4, −2.8+2.8], [1.2−1.2, −1.4+2.4]] = [[1, 0], [0, 1]] ✓

Example 2, 3×3 inverse

A = [[1, 2, 3], [0, 4, 5], [1, 0, 6]] det(A) = 1(4×6−5×0) − 2(0×6−5×1) + 3(0×0−4×1) = 1(24) − 2(−5) + 3(−4) = 24 + 10 − 12 = 22 Cofactor matrix: C = [[24, 5, −4], [−12, 3, 2], [−2, −5, 4]] Adjugate (transpose of C): adj = [[24, −12, −2], [5, 3, −5], [−4, 2, 4]] A⁻¹ = (1/22) × adj = [[1.0909, −0.5455, −0.0909], [0.2273, 0.1364, −0.2273], [−0.1818, 0.0909, 0.1818]]

Checking your work

To verify a 3×3 inverse, multiply A × A⁻¹ and check that you get the identity matrix I₃ = [[1,0,0],[0,1,0],[0,0,1]]. Any deviation from exact 0s and 1s is due to floating-point rounding, in exact arithmetic, the result is always exactly the identity.

Understanding Matrix Inverse

What the Matrix Inverse Means

The inverse of matrix A, written A⁻¹, is the unique matrix such that A × A⁻¹ = A⁻¹ × A = I (the identity matrix). It is the matrix analogue of dividing by a number: if A represents a transformation, A⁻¹ represents the exact reverse, undoing the transformation.

Not all matrices have an inverse. A matrix is invertible (non-singular) if and only if its determinant is non-zero. The determinant being zero signals that the transformation collapses space into a lower dimension, and collapsed space cannot be "un-collapsed." You cannot recover the original 3D vectors from their 2D projections.

The Adjugate Method for 3×3 Matrices

The classical method for small matrices follows four steps:

  • Step 1, Determinant: compute det(A). If det = 0, stop, no inverse.
  • Step 2, Cofactor matrix: for each position (i,j), compute the 2×2 minor by deleting row i and column j, then multiply by the checkerboard sign (−1)^(i+j).
  • Step 3, Adjugate: transpose the cofactor matrix (swap rows and columns).
  • Step 4, Scale: multiply every element of the adjugate by 1/det(A).

Solving Linear Systems with the Inverse

If you have a system Ax = b (where A is a known matrix and b is a known vector), the unique solution is x = A⁻¹b, provided A is invertible. This is the foundation of many numerical methods.

  • For 2×2 and 3×3 systems: compute A⁻¹, then multiply by b.
  • For large systems (100×100+): Gaussian elimination or LU decomposition is more efficient than explicit inversion.
  • In the least-squares problem (overdetermined systems): the normal equations give x = (AᵀA)⁻¹Aᵀb.

Applications of Matrix Inversion

  • Computer graphics: view-to-world and world-to-view transformations require inverting the model-view matrix to transform light rays back from screen space.
  • Control theory: state-space systems use matrix inversion to compute feedback gains and stability conditions.
  • Network analysis: electrical circuit admittance matrices are inverted to find node voltages from current injections.
  • Statistics: covariance matrix inversion is central to multivariate regression, Mahalanobis distance, and Gaussian process regression.
  • Cryptography: Hill cipher encryption and decryption use matrix multiplication and inversion over modular arithmetic.

Frequently Asked Questions

What does the inverse of a matrix mean?

The inverse A⁻¹ is the matrix that "undoes" the transformation represented by A. Multiplying A by A⁻¹ (in either order) gives the identity matrix I, the matrix equivalent of multiplying a number by its reciprocal to get 1.

  • A × A⁻¹ = I (applying A then A⁻¹ returns to original)
  • A⁻¹ × A = I (applying A⁻¹ then A also returns to original)
  • If A rotates vectors 45°, A⁻¹ rotates them back −45°
  • If A scales vectors by 3, A⁻¹ scales them by 1/3

The inverse exists only when the transformation is one-to-one, when no two different input vectors map to the same output. Transformations that "crush" dimensions (like projections) lose information and cannot be reversed.

When does a matrix have no inverse?

A matrix has no inverse (it is singular) when its determinant equals zero. This happens when:

  • Two or more rows are identical
  • One row is a scalar multiple of another
  • One row (or column) is a linear combination of the others
  • The matrix has a row or column of all zeros
  • The transformation squashes 3D space into a 2D plane, 1D line, or single point

In practice, numerical matrices are rarely exactly singular, but they can be ill-conditioned, where det is very small but non-zero. Inverting an ill-conditioned matrix amplifies numerical errors enormously, making the result unreliable. The condition number (ratio of largest to smallest singular value) measures this sensitivity.

What is the adjugate (adjoint) matrix?

The adjugate (also called the classical adjoint) of A is the transpose of the cofactor matrix of A. Each element of the cofactor matrix is computed by:

  • Deleting the row and column of that position to get a smaller matrix (the minor)
  • Computing the determinant of that smaller matrix
  • Multiplying by the sign (−1)^(row+col), the checkerboard pattern of +/− signs

The adjugate has a remarkable property: A × adj(A) = det(A) × I. Dividing both sides by det(A) gives A × (adj(A)/det(A)) = I, which proves that A⁻¹ = adj(A) / det(A).

For a 2×2 matrix [[a,b],[c,d]], the adjugate is simply [[d,−b],[−c,a]], no need to compute full cofactors.

How do I use the matrix inverse to solve a linear system?

Given a system of equations Ax = b where A is the coefficient matrix, x is the unknown vector, and b is the right-hand side:

  • Compute A⁻¹ using this calculator
  • Multiply: x = A⁻¹ × b
  • Each row of the result gives one unknown variable

Example: solve 4x + 7y = 1, 2x + 6y = 0. Matrix form: A = [[4,7],[2,6]], b = [1, 0]. A⁻¹ = [[0.6, −0.7],[−0.2, 0.4]]. x = A⁻¹b = [[0.6×1 + (−0.7)×0], [(−0.2)×1 + 0.4×0]] = [0.6, −0.2]. So x = 0.6, y = −0.2.

For systems larger than 3×3, computing the inverse explicitly is inefficient. Use Gaussian elimination directly, it solves Ax = b in O(n³) operations without needing A⁻¹ explicitly.

Is A × A⁻¹ always exactly the identity matrix?

In exact arithmetic (using fractions or symbolic values), yes, A × A⁻¹ = I exactly. In floating-point computation (as used by this calculator), there will be tiny rounding errors. For example, an entry that should be 0 might display as 1.23e−15, or 1 might display as 0.9999999. This is normal and expected.

  • Errors of magnitude 1e−10 or smaller are floating-point noise, not computational errors
  • Larger errors (e.g., 0.01 or more) indicate an ill-conditioned matrix where small errors amplify
  • For matrices with integer entries and small determinant, the inverse entries are often exact fractions, convert decimals to fractions to verify exactly

The condition number of A quantifies how much A⁻¹ amplifies errors: a condition number of 1000 means input errors may be amplified by up to 1000× in the solution.

What is the difference between the inverse and the transpose?

The transpose of A (written Aᵀ) is formed by swapping rows and columns: the (i,j) entry of Aᵀ equals the (j,i) entry of A. The transpose always exists for any matrix (even non-square ones) and has the same entries, just rearranged.

The inverse A⁻¹ is a completely different matrix computed via determinants and cofactors. It exists only for square matrices with non-zero determinant, and its entries are generally different from both A and Aᵀ.

  • For rotation matrices: Aᵀ = A⁻¹, the transpose is the inverse (orthogonal matrices)
  • For general matrices: Aᵀ ≠ A⁻¹
  • det(Aᵀ) = det(A) always; det(A⁻¹) = 1/det(A)

When Aᵀ = A⁻¹, A is called an orthogonal matrix. Rotation matrices and reflection matrices are orthogonal, they preserve dot products, lengths, and angles.

Why use the cofactor method instead of row reduction for 3×3?

Both methods give the same result. The cofactor (adjugate) method has the advantage of giving an explicit closed-form formula, every entry of A⁻¹ is expressed directly in terms of A's entries. This makes it ideal for:

  • Small matrices (2×2 and 3×3) where the 9 cofactor computations are manageable
  • Symbolic computation, deriving general formulas for parametric matrices
  • Teaching, it clearly shows the relationship between A, its cofactors, and the inverse
  • Cryptography, Hill cipher inversion requires exact (modular) arithmetic, which row reduction handles less cleanly

For 4×4 and larger matrices, row reduction (Gauss-Jordan elimination) is preferred because it scales linearly in the number of steps needed, whereas the cofactor method requires computing n² determinants of (n−1)×(n−1) matrices, exponential work for large n.

Related Calculators