Skip to main content
Skip to main content
DigiCalcs
Back to Guides
6 min read6 Steps

How to Calculate Matrix Inverse: Step-by-Step Guide

Learn to manually calculate the inverse of 2x2 and 3x3 matrices. Step-by-step formulas, worked examples, common pitfalls, and when to use computational tools for accuracy.

Skip the math — use the calculator

Step-by-Step Instructions

1

Understand Prerequisites and Identify Matrix Type

Ensure you are familiar with matrix multiplication and determinant calculation. Determine if the matrix is 2x2 or 3x3, as the methods for finding the inverse differ significantly. For matrices larger than 3x3, manual calculation is generally impractical.

2

Calculate the Determinant (det(A))

For a 2x2 matrix `[a b; c d]`, the determinant is `ad - bc`. For a 3x3 matrix, use Sarrus' rule or cofactor expansion (e.g., along the first row: `a₁₁(M₁₁) - a₁₂(M₁₂) + a₁₃(M₁₃)`). If `det(A) = 0`, the matrix is singular, and its inverse does not exist; terminate the calculation.

3

Construct the Adjoint Matrix (adj(A)) or Apply 2x2 Formula

For a **2x2 matrix**, simply swap the diagonal elements ('a' and 'd') and negate the off-diagonal elements ('b' and 'c'). This directly gives you the adjoint matrix. For a **3x3 matrix**, calculate the cofactor `Cᵢⱼ` for each element `aᵢⱼ` by finding `(-1)^(i+j)` times the determinant of its minor `Mᵢⱼ`. Form the cofactor matrix, then transpose it to obtain the adjoint matrix `adj(A) = Cᵀ`.

4

Divide by the Determinant

Multiply the matrix obtained in Step 3 (either the adjusted 2x2 matrix or the adjoint matrix for 3x3) by the scalar `1 / det(A)`. This final scalar multiplication yields the inverse matrix A⁻¹.

5

Verify the Inverse (Optional but Recommended)

To confirm your calculation, multiply the original matrix A by its calculated inverse A⁻¹ (or A⁻¹ by A). The result should be the identity matrix (I) of the same dimension. If A * A⁻¹ = I, your inverse calculation is correct.

6

Recognize Limitations and Utilize Tools

Be vigilant for common pitfalls such as sign errors in cofactors or determinant miscalculations. For matrices larger than 3x3, or to ensure accuracy and save time, leverage computational tools like NumPy (Python), MATLAB, or online matrix calculators. These tools are also excellent for verifying your manual work.

How to Calculate Matrix Inverse: Step-by-Step Guide

Calculating the inverse of a matrix is a fundamental operation in linear algebra with wide applications, including solving systems of linear equations, linear transformations, and cryptography. A matrix inverse, denoted as A⁻¹, is a matrix that, when multiplied by the original matrix A, yields the identity matrix (I). That is, A * A⁻¹ = A⁻¹ * A = I.

It is crucial to understand that not all matrices have an inverse. A square matrix A has an inverse if and only if its determinant, det(A), is non-zero. Such a matrix is called invertible or non-singular. If det(A) = 0, the matrix is singular, and its inverse does not exist.

Prerequisites

Before proceeding, ensure you have a solid understanding of the following concepts:

  • Matrix Multiplication: How to multiply two matrices.
  • Determinant Calculation: Specifically for 2x2 and 3x3 matrices.
  • Identity Matrix: A square matrix with ones on the main diagonal and zeros elsewhere.

1. Calculating the Inverse of a 2x2 Matrix

The inverse of a 2x2 matrix is the most straightforward to calculate manually.

Let a 2x2 matrix A be represented as:

A = [ a  b ]
    [ c  d ]

The formula for its inverse, A⁻¹, is:

A⁻¹ = (1 / det(A)) * [  d  -b ]
                     [ -c   a ]

Where the determinant det(A) = ad - bc.

Worked Example: 2x2 Matrix

Let's find the inverse of matrix A:

A = [ 4  7 ]
    [ 2  6 ]
  1. Calculate the Determinant: det(A) = (4 * 6) - (7 * 2) = 24 - 14 = 10

    Since det(A) = 10 (non-zero), the inverse exists.

  2. Apply the Inverse Formula: Swap a and d (4 and 6), and negate b and c (7 and 2).

    adj(A) = [  6  -7 ]
             [ -2   4 ]
    

    Now, multiply by 1 / det(A):

    A⁻¹ = (1 / 10) * [  6  -7 ] = [ 6/10  -7/10 ] = [ 0.6  -0.7 ]
                     [ -2   4 ]   [ -2/10   4/10 ]   [ -0.2   0.4 ]
    

2. Calculating the Inverse of a 3x3 Matrix (Adjoint Method)

Calculating the inverse of a 3x3 matrix manually is significantly more involved than for a 2x2 matrix. The most common method involves using the determinant and the adjoint matrix.

The general formula for the inverse of a matrix A using the adjoint method is:

A⁻¹ = (1 / det(A)) * adj(A)

Where adj(A) is the adjoint of matrix A, which is the transpose of its cofactor matrix (Cᵀ).

Let matrix A be:

A = [ a₁₁  a₁₂  a₁₃ ]
    [ a₂₁  a₂₂  a₂₃ ]
    [ a₃₁  a₃₂  a₃₃ ]

Step 2.1: Calculate the Determinant of a 3x3 Matrix

Use Sarrus' Rule or cofactor expansion along any row or column. For instance, expanding along the first row:

det(A) = a₁₁(a₂₂a₃₃ - a₂₃a₃₂) - a₁₂(a₂₁a₃₃ - a₂₃a₃₁) + a₁₃(a₂₁a₃₂ - a₂₂a₃₁)

If det(A) = 0, the inverse does not exist.

Step 2.2: Calculate the Adjoint Matrix (adj(A))

  1. Find the Cofactor Matrix (C): Each element Cᵢⱼ of the cofactor matrix is (-1)^(i+j) multiplied by the determinant of the minor Mᵢⱼ. The minor Mᵢⱼ is the determinant of the 2x2 submatrix obtained by deleting row i and column j from the original matrix A.

    For a 3x3 matrix, you will calculate nine 2x2 determinants:

    C₁₁ = +det [ a₂₂ a₂₃ ]   C₁₂ = -det [ a₂₁ a₂₃ ]   C₁₃ = +det [ a₂₁ a₂₂ ]
               [ a₃₂ a₃₃ ]             [ a₃₁ a₃₃ ]             [ a₃₁ a₃₂ ]
    
    C₂₁ = -det [ a₁₂ a₁₃ ]   C₂₂ = +det [ a₁₁ a₁₃ ]   C₂₃ = -det [ a₁₁ a₁₂ ]
               [ a₃₂ a₃₃ ]             [ a₃₁ a₃₃ ]             [ a₃₁ a₃₂ ]
    
    C₃₁ = +det [ a₁₂ a₁₃ ]   C₃₂ = -det [ a₁₁ a₁₃ ]   C₃₃ = +det [ a₁₁ a₁₂ ]
               [ a₂₂ a₂₃ ]             [ a₂₁ a₂₃ ]             [ a₂₁ a₂₂ ]
    

    The cofactor matrix C will be:

    C = [ C₁₁  C₁₂  C₁₃ ]
        [ C₂₁  C₂₂  C₂₃ ]
        [ C₃₁  C₃₂  C₃₃ ]
    
  2. Transpose the Cofactor Matrix: The adjoint matrix adj(A) is the transpose of the cofactor matrix Cᵀ.

    adj(A) = Cᵀ = [ C₁₁  C₂₁  C₃₁ ]
                 [ C₁₂  C₂₂  C₃₂ ]
                 [ C₁₃  C₂₃  C₃₃ ]
    

Worked Example: 3x3 Matrix

Let's find the inverse of matrix A:

A = [ 1  2  3 ]
    [ 0  1  4 ]
    [ 5  6  0 ]
  1. Calculate the Determinant: (Using cofactor expansion along the first row) det(A) = 1 * (1*0 - 4*6) - 2 * (0*0 - 4*5) + 3 * (0*6 - 1*5) det(A) = 1 * (-24) - 2 * (-20) + 3 * (-5) det(A) = -24 + 40 - 15 = 1

    Since det(A) = 1 (non-zero), the inverse exists.

  2. Calculate the Cofactor Matrix:

    C₁₁ = +(1*0 - 4*6) = -24 C₁₂ = -(0*0 - 4*5) = -(-20) = 20 C₁₃ = +(0*6 - 1*5) = -5

    C₂₁ = -(2*0 - 3*6) = -(-18) = 18 C₂₂ = +(1*0 - 3*5) = -15 C₂₃ = -(1*6 - 2*5) = -(6 - 10) = -(-4) = 4

    C₃₁ = +(2*4 - 3*1) = 8 - 3 = 5 C₃₂ = -(1*4 - 3*0) = -4 C₃₃ = +(1*1 - 2*0) = 1

    The Cofactor Matrix C is:

    C = [ -24  20  -5 ]
        [  18 -15   4 ]
        [   5  -4   1 ]
    
  3. Transpose the Cofactor Matrix to get the Adjoint Matrix:

    adj(A) = Cᵀ = [ -24  18   5 ]
                 [  20 -15  -4 ]
                 [  -5   4   1 ]
    
  4. Multiply by (1 / det(A)):

    Since det(A) = 1, 1 / det(A) = 1. Therefore, A⁻¹ = 1 * adj(A).

    A⁻¹ = [ -24  18   5 ]
          [  20 -15  -4 ]
          [  -5   4   1 ]
    

Common Pitfalls

  • Determinant Calculation Errors: A common source of error, especially for 3x3 matrices. Double-check your arithmetic.
  • Sign Errors in Cofactors: Forgetting the (-1)^(i+j) factor or miscalculating it is a frequent mistake. Remember the checkerboard pattern of signs: [ + - +; - + -; + - + ].
  • Incorrect Transposition: Forgetting to transpose the cofactor matrix to obtain the adjoint matrix is a very common error.
  • Singular Matrices: Attempting to find an inverse for a matrix with a determinant of zero. Always check the determinant first.

When to Use Computational Tools

While understanding the manual process is crucial for foundational knowledge, calculating matrix inverses by hand for matrices larger than 3x3 (e.g., 4x4, 5x5) becomes exceedingly tedious and prone to error. For such cases, or for matrices with floating-point or complex entries, it is highly recommended to use computational tools. Software like MATLAB, Python with NumPy, Wolfram Alpha, or dedicated online matrix calculators can perform these operations quickly and accurately. These tools are also invaluable for verifying your manual calculations.


Ready to Calculate?

Skip the manual work and get instant results.

Open Calculator

Settings

PrivacyTermsAbout© 2026 DigiCalcs