Calculate the inverse of a matrix
Choose a square matrix size, enter its values, and click Calculate Inverse. This calculator supports matrices from 1×1 through 8×8.
What is a matrix inverse?
The inverse of a square matrix A is another matrix written A⁻¹. Multiplying A by its inverse produces the identity matrix. The identity matrix has ones on its main diagonal and zeros everywhere else.
Invertible matrix
The determinant is nonzero, the inverse exists, and the matrix can be used to solve a unique solution for every compatible system A x = b.
Singular matrix
The determinant is zero. The matrix has no inverse, and its rows or columns are linearly dependent.
Formula for the inverse of a 2×2 matrix
For a 2×2 matrix, the inverse can be calculated directly using its determinant.
[ c d ]
[ −c a ]
This formula works only when ad − bc is not zero. If the determinant is zero, the matrix has no inverse.
Worked example: find a 2×2 inverse
Consider the matrix:
[ 4 6 ]
Step 1: Calculate the determinant
Step 2: Swap the diagonal entries and negate the others
[ −4 3 ]
Step 3: Divide by the determinant
[ −4 3 ]
[ 2/7 −3/14 ]
Because the determinant is −14 rather than zero, the inverse exists. Select 2×2 above and load the example to verify the decimal values.
How Gauss-Jordan elimination works
For larger matrices, Gauss-Jordan elimination provides a systematic way to calculate the inverse. Start with the augmented matrix [A | I] and perform elementary row operations on both blocks together.
- Write the original matrix A beside the identity matrix I.
- Choose a nonzero pivot in the first column, swapping rows if needed.
- Divide the pivot row so the pivot equals one.
- Eliminate the other entries in that pivot column.
- Repeat the process for each remaining column.
- If the left block becomes I, the right block is A⁻¹. If a valid pivot cannot be found, the matrix may be singular.
Frequently asked questions
What is the inverse of a matrix?
The inverse of a square matrix A is written A⁻¹. It satisfies A × A⁻¹ = A⁻¹ × A = I, where I is the identity matrix of the same size.
Which matrices have an inverse?
A square matrix has an inverse if it is nonsingular. Equivalently, its determinant is nonzero and its rows and columns are linearly independent.
Can a non-square matrix have an inverse?
A standard two-sided matrix inverse is defined for square matrices. Some non-square matrices can have left or right inverses under particular conditions, but those are different concepts.
What happens if a matrix is singular?
A singular matrix has no inverse. This happens when its determinant is zero, or equivalently when its rows or columns are linearly dependent.
How do you find the inverse of a 2×2 matrix?
For A = [[a,b],[c,d]], calculate det(A) = ad − bc. If the determinant is nonzero, A⁻¹ = (1/(ad−bc)) × [[d,−b],[−c,a]].
How does Gauss-Jordan elimination find an inverse?
Create the augmented matrix [A | I] and use elementary row operations to turn the left side into the identity matrix. When successful, the right side becomes A⁻¹.
Why can decimal results contain rounding errors?
Computers represent most decimal numbers using finite-precision floating-point arithmetic. Matrices that are nearly singular can amplify these errors, so results should be interpreted with appropriate precision.
Explore more matrix calculators
Use these related tools to solve more linear algebra problems.