Logo

MonoCalc

/

Inverse Matrix Calculator

Math

Enter matrix A (integers, decimals, or fractions like 1/2)

About This Tool

🔄 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 = I

where 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.

Singular matrix example
The matrix [[1, 2], [2, 4]] has determinant 1·4 − 2·2 = 0. Its second row is exactly twice its first row, so the rows are linearly dependent and no inverse can be found.

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/3 or -5/8 and 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.

Frequently Asked Questions

Is the Inverse Matrix Calculator free?

Yes, Inverse Matrix Calculator is totally free :)

Can I use the Inverse Matrix Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Inverse Matrix Calculator?

Yes, any data related to Inverse Matrix Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does the Inverse Matrix Calculator work?

Enter your square matrix values in the interactive grid (2×2 to 6×6), then click Calculate. The tool uses Gauss-Jordan elimination on the augmented matrix [A | I], applying row operations until the left side becomes the identity matrix. The right side of the augmented matrix then holds A⁻¹. Toggle 'Show Steps' to see every row operation.

What does it mean when the calculator says the matrix is singular?

A singular matrix has a determinant of zero, meaning its rows are linearly dependent and no inverse exists. In practical terms, the corresponding system of equations has either no solution or infinitely many solutions. The calculator detects this before attempting inversion and explains why the matrix cannot be inverted.

What is Gauss-Jordan elimination?

Gauss-Jordan elimination is an algorithm that augments a matrix A with the identity matrix I to form [A | I], then applies row operations — swapping rows, scaling rows, and adding multiples of one row to another — until the left half becomes I. At that point the right half is exactly A⁻¹. The method is both general and well-suited for displaying step-by-step working.

What is the identity verification (A × A⁻¹)?

After computing A⁻¹, the tool multiplies the original matrix A by A⁻¹ and displays the product. For a correctly computed inverse, every diagonal element should equal 1 and all off-diagonal elements should equal 0, forming the identity matrix. This confirms the inverse is accurate.

Can I enter fractions as matrix values?

Yes. Each cell accepts integers, decimals, negative numbers, and simple fractions such as 1/2 or -3/4. The parser evaluates the fraction before computing. For output, you can optionally display results in exact fraction form using the 'Fraction output' toggle.

What does the ill-conditioned matrix warning mean?

An ill-conditioned matrix is not singular but is very close to being singular. Small rounding errors in floating-point arithmetic can cause large errors in the computed inverse. The tool flags this condition when the ratio of the largest to smallest diagonal element exceeds 10⁸, so you know to interpret results with caution.