Algebra • Linear Systems Flagship

Matrix Inverse Calculator

Compute exact 2×2 and 3×3 matrix inverses, adjugate matrices, cofactors, determinants, and linear system solutions ($A\mathbf{x} = \mathbf{b}$) with complete step-by-step derivations.

|
Last Updated: September 2026
|
Verified Mathematical Solution
Input Matrix A (2×2)
Preset Examples:
Inverse Matrix A⁻¹ Invertible • det(A) ≠ 0
Result Matrix A⁻¹
Verification: A × A⁻¹ = I
Determinant 10
Matrix Trace 10
Condition Well-Posed
Dimension 2 × 2

Step-by-Step Adjugate & Cofactor Expansion Formula: A⁻¹ = (1 / det(A)) × adj(A)

Direct Answer & Overview
Verified Educational Guide

How to Calculate the Inverse of a Square Matrix

To invert a square matrix A, first verify that its determinant is non-zero (det(A) ≠ 0). For a 2x2 matrix [[a, b], [c, d]], swap diagonal elements (d, a), negate off-diagonal elements (-b, -c), and divide by det(A) = ad - bc: A⁻¹ = (1/det(A)) [[d, -b], [-c, a]]. For a 3x3 matrix, calculate the matrix of minors, apply the chessboard sign pattern to create cofactors, transpose to get the adjugate adj(A), and divide by det(A).

Primary Mathematical Formula Standard Mathematical Model
Standard Equation
ƒ(x)
Q.E.D.
A⁻¹ = (1 / det(A)) × adj(A) | A × A⁻¹ = I | x = A⁻¹b
Evaluated with exact mathematical formulation • Rigorously verified
Exact Formula
Input Parameters
Required
1
Square matrix dimensions: 2×2 or 3×3 matrix entries
2
Optional: Right-hand side constant vector b (for Ax = b linear systems)
Expected Outputs
Calculated
Inverse Matrix A⁻¹: Exact fractional or decimal matrix
Determinant det(A): Confirmation of non-singularity (det ≠ 0)
Adjugate & Cofactor Matrices: Step-by-step intermediate matrices
Solution Vector x: Exact values when solving Ax = b
Worked Numerical Example
Instant Verification
Find the inverse of 2x2 matrix A = [[4, 7], [2, 6]]
→ det(A) = (4×6) - (7×2) = 24 - 14 = 10. adj(A) = [[6, -7], [-2, 4]]. Divide by 10
A⁻¹ = [[0.6, -0.7], [-0.2, 0.4]] (Verification: A × A⁻¹ = [[1, 0], [0, 1]])

Anatomy of Matrix Inversion & The Identity Matrix

In matrix algebra, division is not defined directly. Instead, multiplication by the matrix inverse ($A^{-1}$) serves as the exact algebraic equivalent of division.

Just as multiplying a scalar $x$ by its reciprocal $x^{-1} = 1/x$ produces the multiplicative identity $1$, multiplying an $n \times n$ matrix $A$ by its inverse $A^{-1}$ yields the $n \times n$ identity matrix $I_n$:

Identity Property
A × A⁻¹ = Iₙ

Multiplying a matrix by its inverse yields ones on the main diagonal and zeros elsewhere.

Invertibility Rule
det(A) ≠ 0

A matrix possesses an inverse if and only if its determinant is non-zero.

Product Reversal
(AB)⁻¹ = B⁻¹A⁻¹

Inverting a matrix product reverses the order of the individual matrix factors.

The 2×2 Matrix Inverse Shortcut Formula (Adjugate Method)

For any $2 \times 2$ matrix, the inverse can be written directly using a simple mnemonic:

Matrix: A = [[a, b], [c, d]]

A⁻¹ = (1 / (ad − bc)) × [[d, −b], [−c, a]]

Step 1: Compute determinant det(A) = ad - bc.
Step 2: Swap the main diagonal entries (a ⟷ d).
Step 3: Negate the off-diagonal entries (b ⟶ -b, c ⟶ -c).
Step 4: Scale every entry by 1 / det(A).

The 3×3 Matrix Inverse Algorithm (Minors, Cofactors, Adjugate)

Inverting a $3 \times 3$ matrix involves four classical linear algebra stages:

  1. Calculate Determinant: Evaluate $\det(A)$ using first-row cofactor expansion. If $\det(A) = 0$, stop—the matrix is singular.
  2. Matrix of Minors ($M$): For each of the 9 entries, compute the $2 \times 2$ determinant of the submatrix remaining when its row and column are deleted.
  3. Matrix of Cofactors ($C$): Multiply each minor by $(-1)^{i+j}$ according to the alternating chessboard sign pattern:
    [[+, -, +], [-, +, -], [+, -, +]]
  4. Adjugate Matrix ($\text{adj}(A) = C^T$): Transpose the cofactor matrix by swapping rows and columns ($C_{ij} \leftrightarrow C_{ji}$).
  5. Scalar Division: Divide the adjugate matrix by the determinant: $A^{-1} = \frac{1}{\det(A)} \text{adj}(A)$.

Gauss-Jordan Elimination Method [A | I] to [I | A⁻¹]

For large matrices ($n \ge 3$), Gauss-Jordan elimination is computationally superior to cofactor expansion:

Augmented Matrix Representation:

[ A | I ] = [[a₁₁, a₁₂, a₁₃ | 1, 0, 0], [a₂₁, a₂₂, a₂₃ | 0, 1, 0], [a₃₁, a₃₂, a₃₃ | 0, 0, 1]]

Apply elementary row operations (row swapping, scaling, and adding multiples of rows) until the left block becomes the identity matrix $I$. The right block will transform into $A^{-1}$.

Solving Linear Systems Ax = b with Matrix Inverses

When a system of $n$ linear equations with $n$ variables is represented in matrix-vector form:

A&mathbf;x = &mathbf;b
&mathbf;x = A⁻¹&mathbf;b

Multiplying the constant vector $\mathbf{b}$ by $A^{-1}$ yields the exact unique solution vector $\mathbf{x}$ immediately.

Singular Matrices & Invertibility Conditions (det(A) = 0)

A matrix is singular (non-invertible) if any of the following equivalent conditions hold:

  • $\det(A) = 0$ (Zero Determinant).
  • The rows or columns of $A$ are linearly dependent (one row is a multiple or linear combination of others).
  • The rank of $A$ is strictly less than $n$ ($\text{rank}(A) < n$).
  • $\lambda = 0$ is an eigenvalue of $A$.
  • The system $A\mathbf{x} = \mathbf{0}$ has non-trivial (infinite) solutions.

Step-by-Step Worked Examples (2×2 and 3×3 Inverses)

2×2 Inversion Level: Basic

Find the inverse of A = [[3, 2], [7, 5]].

1. Determinant: det(A) = (3)(5) − (2)(7) = 15 − 14 = 1.

2. Adjugate: Swap diagonal (5, 3) and negate off-diagonal (−2, −7) → adj(A) = [[5, −2], [−7, 3]].

3. Divide by det(A) = 1: A⁻¹ = [[5, −2], [−7, 3]].

Verification: [[3, 2], [7, 5]] × [[5, −2], [−7, 3]] = [[1, 0], [0, 1]].

Common Pitfalls & Numerical Stability Errors

Pitfall 1: Forgetting to Transpose Cofactors

The adjugate matrix is the transpose of the cofactor matrix ($\text{adj}(A) = C^T$). Forgetting to swap rows and columns of the cofactor matrix is the most common error in $3 \times 3$ inversion.

Pitfall 2: Ill-Conditioned Matrices

If $\det(A)$ is extremely close to zero (e.g. $10^{-12}$), floating-point roundoff errors explode. In numerical programming, use LU or QR decomposition rather than direct matrix inversion.

Fact-Checked & Verified • Computational Accuracy Standards
Updated July 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What is the inverse of a matrix?
The inverse of a square matrix A is a matrix denoted A⁻¹ such that their matrix product equals the identity matrix: A × A⁻¹ = A⁻¹ × A = I. Only square matrices with a non-zero determinant (det(A) ≠ 0) possess an inverse.
How do you calculate the inverse of a 2x2 matrix?
For a 2x2 matrix A = [[a, b], [c, d]], the inverse is calculated by swapping diagonal elements (a and d), negating off-diagonal elements (-b and -c), and dividing all entries by the determinant (ad - bc): A⁻¹ = (1 / (ad - bc)) × [[d, -b], [-c, a]].
What is a singular matrix?
A singular matrix is a square matrix whose determinant is exactly zero (det(A) = 0). A singular matrix has linearly dependent rows or columns and has no inverse (it is non-invertible).
What is the difference between the Adjugate method and Gauss-Jordan elimination?
The Adjugate method computes the matrix of minors, signs them to make the cofactor matrix, transposes it into the adjugate adj(A), and divides by det(A). Gauss-Jordan elimination augments the matrix with the identity matrix [A | I] and applies elementary row operations to reduce it to [I | A⁻¹], which is faster for large matrices.
How is a matrix inverse used to solve systems of linear equations (Ax = b)?
Multiplying both sides of the matrix equation Ax = b by A⁻¹ from the left yields A⁻¹Ax = A⁻¹b ⟹ Ix = A⁻¹b ⟹ x = A⁻¹b. This provides the exact unique solution vector x in a single matrix multiplication.
What is the inverse of an orthogonal matrix?
For an orthogonal matrix Q (such as a 2D or 3D rotation matrix), its inverse is simply its transpose: Q⁻¹ = Qᵀ. This means you do not need to calculate determinants or cofactors—just swap rows and columns.