Advertisement
Loading...

Matrix Inverse Calculator

Random FillClear

Enter a Matrix

Fill in the matrix cells above and click Calculate Inverse — or use Random Fill to try an example.

Advertisement
Loading...

How to Use This Calculator

1

Select Matrix Size

Choose the size of your matrix using the size buttons: 2×2, 3×3, 4×4, or 5×5. The input grid will update immediately to show the correct number of cells. Use the Random Fill button if you want a ready-made example to explore.

2

Enter Matrix Elements

Click into the first cell and type your numbers. Use Tab to move to the next cell across the row, or press Enter to move down a column. All values should be numbers — decimals and negatives are supported. Leave cells blank or as 0 for zero entries.

3

Choose Method and Format

Select Gauss-Jordan Elimination to see augmented-matrix row operations, or Adjugate to see the cofactor and adjugate intermediate matrices. Switch between Decimal and Fraction output to display exact rational values like −1/3 instead of −0.3333.

4

Read the Results

The determinant appears at the top. The inverse matrix A⁻¹ is displayed as a grid below. Check the Verification section to confirm A × A⁻¹ = I (diagonal cells highlighted in green should all be 1). Expand the Step-by-Step panel to review every row operation performed during Gauss-Jordan elimination.

Frequently Asked Questions

What does it mean for a matrix to be singular?

A singular matrix is one that has no inverse — its determinant equals zero. This happens when one or more rows (or equivalently, columns) of the matrix are linearly dependent on the others. For example, if the second row is exactly twice the first row, the rows don't span the full dimension of space, and the matrix cannot be inverted. Geometrically, a singular matrix collapses the input space into a lower-dimensional subspace (a line, plane, or point), making the transformation impossible to undo. In practice, this means the corresponding system of equations has either no solution or infinitely many solutions rather than a unique one.

What is the difference between Gauss-Jordan and the Adjugate method?

Gauss-Jordan Elimination forms an augmented matrix [A | I] and systematically applies row operations — scaling rows, swapping rows, and adding multiples of one row to another — until the left side becomes the identity matrix. The right side is then A⁻¹. It is the most numerically stable method for larger matrices. The Adjugate Method is a formula-based approach: compute the matrix of cofactors, transpose it to get the adjugate, then divide by the determinant. It is elegant for 2×2 and 3×3 matrices and provides explicit intermediate matrices (cofactor and adjugate), which is useful for understanding the algebraic structure of the inverse.

How do I read the step-by-step solution?

The step-by-step panel (available for Gauss-Jordan method) shows each row operation applied to the augmented matrix [A | I]. Operations are written in standard notation: 'R2 → R2 ÷ 3.0000' means row 2 is divided by 3 to make the pivot equal to 1; 'R1 → R1 − 0.5000 × R2' means subtract 0.5 times row 2 from row 1 to eliminate the entry in column 2 of row 1. Following these steps in order on the augmented matrix will reproduce the inverse. Working through the steps by hand is an excellent way to build understanding of the elimination process.

Why should I use fraction mode?

When the original matrix has integer entries, the inverse often has entries that are exact rational numbers — fractions with small numerators and denominators. Fraction mode displays these exact values (e.g., −1/3, 2/5) rather than repeating decimals (−0.333333, 0.4000). This is more informative for hand-verification and matches the notation used in textbooks. Fraction mode searches for denominators up to 1000; if no simple fraction is found, it falls back to a 4-decimal display. Decimal mode is better when you need values in a specific numeric format for further computation.

What is the verification grid showing?

The verification section computes the matrix product A × A⁻¹ and displays the result. By definition, this product must equal the identity matrix — a matrix with 1s on the main diagonal and 0s everywhere else. Diagonal cells are highlighted so you can quickly confirm that each equals 1 (within floating-point precision). If any diagonal cell significantly differs from 1 or any off-diagonal cell is significantly non-zero, it indicates a calculation error or an ill-conditioned matrix where floating-point rounding has accumulated. This is a standard sanity check used when inverting matrices numerically.

Can I use this for matrices larger than 5×5?

This calculator supports 2×2 through 5×5 matrices. For larger matrices (6×6 and above), the computation becomes more expensive and numerical precision concerns increase significantly. In practice, matrices larger than 5×5 are best handled with dedicated numerical libraries such as NumPy (Python), MATLAB, or Wolfram Mathematica, which use optimized LU decomposition rather than Gauss-Jordan for improved numerical stability. For everyday academic and engineering problems up to 5×5, this calculator provides accurate results. Note that 4×4 and 5×5 matrices with small integer entries will generally produce reliable results.