🔄 Inverse Matrix Calculator – Compute A⁻¹ with Step-by-Step Working
The Inverse Matrix Calculator finds the inverse of any square matrix — from 2×2 up to 6×6 — using Gauss-Jordan elimination. Enter your matrix values, click Calculate, and get the full inverse alongside the determinant, row-operation steps, and an identity-check verification. Whether you are a student working through linear algebra homework or an engineer solving systems of equations, this tool gives you both the answer and the working in one place.
What is the Inverse of a Matrix?
For a square matrix A, its inverse A⁻¹ is the unique matrix such that:
A × A⁻¹ = A⁻¹ × A = Iwhere I is the identity matrix (1s on the diagonal, 0s elsewhere). The inverse exists if and only if the determinant of A is non-zero. A matrix with a zero determinant is called singular and has no inverse.
How Gauss-Jordan Elimination Works
The algorithm augments the input matrix with the identity matrix to create [A | I]. It then applies three types of elementary row operations until the left half becomes I:
Row Swap
R₂ ↔ R₃Reorders rows to place the best pivot on the diagonal (partial pivoting for numerical stability).
Row Scale
R₁ → (1/a) · R₁Divides a row by its pivot element to make the diagonal entry equal to 1.
Row Addition
R₂ → R₂ − k·R₁Eliminates a column entry in another row by subtracting a scaled version of the pivot row.
When the left side of the augmented matrix reaches the identity matrix, the right side holds A⁻¹. This is both the most general and most transparent method, making it ideal for educational use.
Singularity Detection
Before inversion begins, the tool computes the determinant of A using LU decomposition. If the determinant is zero (or within a small numerical tolerance of zero), the matrix is declared singular. The calculator explains that no inverse exists, saving you from meaningless output caused by division-by-zero in the elimination steps.
Identity Verification (A × A⁻¹)
After computing the inverse, the tool multiplies the original matrix A by A⁻¹ and displays the product. Every diagonal element should round to 1 and every off-diagonal element should round to 0. This confirmation step catches any residual floating-point drift and gives you confidence in the result.
Step-by-Step Row Operations
Enable Show Steps to view the full augmented-matrix log from the initial [A | I] all the way to [I | A⁻¹]. Each row operation is labelled with the standard notation (e.g. R₂ → R₂ − 0.5·R₁) so you can follow along or use the working in your assignments.
Practical Uses of Matrix Inversion
Solving linear systems: If Ax = b, then x = A⁻¹b — the inverse gives the unique solution directly.
Computer graphics: Inverse transformation matrices undo rotations, scaling, and projections in 3-D rendering pipelines.
Cryptography: Certain encryption schemes use invertible matrices to encode and decode messages.
Statistics and machine learning: The ordinary least-squares formula involves (XᵀX)⁻¹, requiring a matrix inverse for regression coefficients.
Control theory: State-space models in engineering require invertible system matrices for controllability and observability analysis.
Tips for Best Results
- Use the Paste Matrix feature to import comma-separated or newline-separated data directly, avoiding manual cell-by-cell entry.
- Fractions work as input — enter
1/3or-5/8and the parser handles them automatically. - Increase decimal precision when working with matrices whose entries have many significant digits, to reduce visible rounding artefacts.
- Enable Fraction output for textbook-style results when all matrix entries are rational numbers.
- If you see an ill-conditioning warning, consider whether your matrix is truly invertible or whether your data contains measurement errors that make it appear near-singular.
Supported Matrix Sizes
The calculator supports square matrices from 2×2 to 6×6. For 2×2 matrices, the result can also be verified with the classic formula: A⁻¹ = (1/det) × [[d, -b], [-c, a]]. For larger matrices, Gauss-Jordan elimination is the standard reliable method.