Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Inverse Matrix Calculator (2×2, 3×3, 4×4)

Choose the matrix size (2×2 to 4×4) and enter the entries in the grid. An inverse is defined only for a square matrix (rows = columns) and exists only when the determinant is not 0 (if it is 0, the calculator says so).

Enter the entries as numbers (decimals and negatives are fine).
Result
Choose the matrix size on the left, enter the entries and press "Calculate". The inverse matrix and the steps will appear here.

What you can do on this page

  • Find the inverse \(A^{-1}\) of a 2×2, 3×3 or 4×4 square matrix on the spot
  • It also shows the determinant \(\det(A)\) and tells you whether the inverse exists (whether the matrix is invertible)
  • Steps use the formula "\(A^{-1} = \dfrac{1}{ad-bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}\)" for 2×2 and the adjugate matrix method for 3×3 and 4×4
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets (MINVERSE) and Python are all on this page
Only square matrices (rows = columns) whose determinant is not 0 have an inverse. Matrix addition, multiplication and transpose are on the sister page "Matrix Calculator", and detailed determinant steps are on "Determinant Calculator".

What is this calculation used for?

Solving a system of linear equations in one step

A system of linear equations with as many equations as unknowns can be written as \(A\boldsymbol{x} = \boldsymbol{b}\) using the matrix of coefficients \(A\). Multiply both sides on the left by \(A^{-1}\) and you get \(\boldsymbol{x} = A^{-1}\boldsymbol{b}\). So once you have the inverse, a single multiplication gives the solution.
This is especially powerful when you solve the system again and again with only the right side \(\boldsymbol{b}\) changed (as in structural analysis or circuit analysis). If the inverse does not exist (the determinant is 0), that is a sign that the system does not have exactly one solution.

Undoing coordinate transformations in graphics and robotics

In 3D graphics, games and robot control, transformations such as rotating, scaling and moving are calculated by matrix multiplication. Going back from the coordinates after a transformation to the coordinates before it is done with the inverse matrix.
For example, switching between coordinates seen from the camera and coordinates of the whole world (the view matrix), or working out where a point clicked on the screen lies in 3D space, uses inverse matrices almost every frame.

Decoding a cipher that uses a matrix as its key (Hill cipher)

Turn letters into numbers and multiply by a matrix, and a message becomes a coded message (the Hill cipher). The receiver gets the original message back by multiplying by the inverse of the key matrix.
The pair "what a matrix does, its inverse undoes" is exactly the pair of encoding and decoding, which makes this the most direct example of the idea of an inverse. (In practice, the numbers are handled as remainders after dividing by 26, so the key must be a matrix that has an inverse in that number system.)

Calculating ripple effects in the economy (input-output analysis)

Ripple effects between industries, such as "if car production grows, how much more steel and electricity must be produced", are calculated by putting the trade between industries into a matrix \(A\) and multiplying by \((I - A)^{-1}\) (the Leontief inverse).
It is a standard method when governments announce the economic impact of public works or events such as festivals, and a leading example of inverse matrices supporting public decisions.

Finding the best-fit line for data (regression, a basis of AI)

Regression analysis (least squares), which draws "the line that fits best" through data such as advertising spending and sales, writes its solution with an inverse matrix: \(\hat{\boldsymbol{\beta}} = (X^{\mathsf{T}}X)^{-1}X^{\mathsf{T}}\boldsymbol{y}\) (the solution of the normal equations).
This formula appears in every statistics and machine learning textbook, and the inverse matrix sits at the starting point of how AI learns trends from data.

Formula

Definition of the inverse (the matrix that gives the identity matrix)
Standard notation (the usual math form)
\(A\) \(A^{-1}\) \(=\) \(I\)
In words (symbols replaced with words)
① \(A\): original matrix ② \(A^{-1}\): inverse matrix \(=\) ③ \(I\): identity matrix
The formula in words
① Multiply the \(A\): original matrix by its
② \(A^{-1}\): inverse matrix , and you get the
③ \(I\): identity matrix (1s on the diagonal from top left to bottom right, 0s everywhere else)
Quick example
The inverse of \(A = \begin{pmatrix} 4 & 7 \\ 2 & 6 \end{pmatrix}\) is \(A^{-1} = \begin{pmatrix} 0.6 & -0.7 \\ -0.2 & 0.4 \end{pmatrix}\) (the next formula shows how to find it). Multiplying them to check:
\(A\): original matrix \(A^{-1}\): inverse matrix \(=\) \(I\): identity matrix
\(\begin{pmatrix} 4 \times 0.6 + 7 \times (-0.2) & 4 \times (-0.7) + 7 \times 0.4 \\ 2 \times 0.6 + 6 \times (-0.2) & 2 \times (-0.7) + 6 \times 0.4 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\)
Key idea
The inverse matrix is "the matrix version of a reciprocal". Just as \(a \times \dfrac{1}{a} = 1\) for numbers (multiply 3 by \(\dfrac{1}{3}\) and you are back to 1), matrices have \(A A^{-1} = I\). The identity matrix \(I\) is "the matrix that changes nothing when you multiply by it", playing the role of the number 1. The order of multiplication does not matter here: \(A A^{-1} = A^{-1} A = I\). And just as the number 0 has no reciprocal, some matrices have no inverse. Whether a matrix has one can be decided by whether its determinant \(\det(A)\) is 0. (Some books, such as Japanese textbooks, write the identity matrix as \(E\) instead of \(I\).)
Formula for the inverse of a 2×2 matrix
Standard notation (the usual math form)
\(A^{-1}\) \(=\) \(\dfrac{1}{ad - bc}\) \(\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}\)
In words (symbols replaced with words)
③ \(A^{-1}\): inverse matrix \(=\) ② \(\dfrac{1}{ad - bc}\): 1 over the determinant ① matrix with the entries rearranged
The formula in words
① With \(A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}\), take the matrix with the entries rearranged (swap \(a\) and \(d\), and change the signs of \(b\) and \(c\)) , multiply each entry by
② \(\dfrac{1}{ad - bc}\): 1 over the determinant , and you get the
③ \(A^{-1}\): inverse matrix
Quick example
The inverse of \(A = \begin{pmatrix} 4 & 7 \\ 2 & 6 \end{pmatrix}\) is
\(ad - bc = 4 \times 6 - 7 \times 2 = 24 - 14 = 10\)
\(A^{-1} = \dfrac{1}{10} \begin{pmatrix} 6 & -7 \\ -2 & 4 \end{pmatrix} = \begin{pmatrix} 0.6 & -0.7 \\ -0.2 & 0.4 \end{pmatrix}\)
Key idea
Remember it as three steps: "swap the top left and bottom right (\(a\) and \(d\)), change the signs of the top right and bottom left (\(b\) and \(c\)), and divide by the determinant \(ad - bc\)". When \(ad - bc = 0\), this would mean dividing by 0, so the formula cannot be used. In other words, a matrix whose determinant is 0 has no inverse (this calculator reports that the inverse does not exist).
Using the adjugate matrix (the general formula, also for 3×3 and larger)
Standard notation (the usual math form)
\(A^{-1}\) \(=\) \(\dfrac{1}{\det(A)}\) \(\operatorname{adj}(A)\)
In words (symbols replaced with words)
③ \(A^{-1}\): inverse matrix \(=\) ② \(\dfrac{1}{\det(A)}\): 1 over the determinant ① \(\operatorname{adj}(A)\): adjugate matrix
The formula in words
① Take the \(\operatorname{adj}(A)\): adjugate matrix (the cofactors of all entries, arranged and then with rows and columns swapped) , multiply each entry by
② \(\dfrac{1}{\det(A)}\): 1 over the determinant , and you get the
③ \(A^{-1}\): inverse matrix
Quick example
For \(A = \begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 5 & 6 & 0 \end{pmatrix}\), cofactor expansion gives the determinant, and then the inverse:
\(\det(A) = 1 \times (1 \times 0 - 4 \times 6) - 2 \times (0 \times 0 - 4 \times 5) + 3 \times (0 \times 6 - 1 \times 5)\)
\(= -24 + 40 - 15 = 1\)
\(A^{-1} = \dfrac{1}{1} \operatorname{adj}(A) = \begin{pmatrix} -24 & 18 & 5 \\ 20 & -15 & -4 \\ -5 & 4 & 1 \end{pmatrix}\)
Key idea
The adjugate matrix \(\operatorname{adj}(A)\) is made like this: for every position, compute "the minor left after removing row \(i\) and column \(j\), with the sign \((-1)^{i+j}\)" (the cofactor), arrange them, and finally swap rows and columns (transpose). It is also called the classical adjoint. The "rearranged matrix" in the 2×2 formula is in fact exactly this adjugate matrix. By hand, another standard way is Gauss-Jordan elimination, where you place the identity matrix next to the matrix and transform the rows. Both methods give the same answer; this calculator shows the intermediate values of the adjugate method.
The inverse \(A^{-1}\) is "the partner that gives the identity matrix \(I\) when multiplied", the matrix version of a reciprocal. It exists only for square matrices with \(\det(A) \neq 0\). For 2×2, use the "swap, change signs, divide by the determinant" formula; for 3×3 and larger, use the adjugate matrix (or Gauss-Jordan elimination). Inverses are widely used to solve systems of linear equations.

Symbols and terms

Symbols

\(A\) A The name given to a matrix. By custom, matrices are named with capital letters.
\(A^{-1}\) A inverse The inverse of matrix \(A\). The \(-1\) at the upper right is written like "to the power −1", the same idea as the reciprocal of a number, \(a^{-1} = \dfrac{1}{a}\) (but a matrix is never written as a fraction \(\dfrac{1}{A}\)).
\(I\) I (identity matrix) The identity matrix: a square matrix with 1s on the diagonal from top left to bottom right and 0s everywhere else. Multiplying any matrix by it changes nothing, so it plays the role of the number 1. It is sometimes written \(I_n\) to show its size, and some books (such as Japanese textbooks) write \(E\).
\(\det(A),\ |A|\) determinant of A The determinant of matrix \(A\). If it is not 0, the inverse exists; if it is 0, it does not. The vertical-bar form \(|A|\) is also common.
\(\operatorname{adj}(A)\) adjugate of A The adjugate matrix of \(A\): the cofactors of all entries, arranged and then transposed. It is written adj, from the first three letters of "adjugate" (an older name is "adjoint", or classical adjoint).
\(a_{ij}\) a sub i j The entry of matrix \(A\) in row \(i\), column \(j\) (the number in the \(i\)th row from the top and the \(j\)th column from the left). The small letters at the lower right (the subscripts) give its position.

Terms

inverse matrix The matrix that gives the identity matrix when multiplied. It is the matrix version of a reciprocal and is written \(A^{-1}\). It exists only for square matrices whose determinant is not 0, and it is used to solve systems of linear equations and to undo transformations.
identity matrix A square matrix with 1s on the diagonal (top left to bottom right) and 0s everywhere else. Multiplying any matrix by it changes nothing, so it corresponds to the number 1.
square matrix A matrix with the same number of rows and columns (shaped like a square). Inverses and determinants exist only for square matrices.
determinant A single number determined by a square matrix. It tells you that an inverse exists when \(\det(A) \neq 0\). How to find it is explained in detail on the sister page "Determinant Calculator".
invertible matrix A square matrix whose determinant is not 0. It is also called nonsingular, and it has an inverse. A matrix with determinant 0 is called singular and has no inverse.
cofactor The determinant of the smaller matrix left after removing row \(i\) and column \(j\) (the minor), multiplied by the sign \((-1)^{i+j}\). Cofactors are the building blocks of the adjugate matrix.
adjugate matrix The matrix of the cofactors of all positions, with rows and columns swapped (transposed). It is written \(\operatorname{adj}(A)\), and dividing it by the determinant gives the inverse. It is also called the classical adjoint, but be careful: in more advanced books, "adjoint" often means a different matrix (the conjugate transpose), so "adjugate" is the safer name.
Gauss-Jordan elimination A method where you place matrix \(A\) and the identity matrix \(I\) side by side and repeat row operations until the left half becomes \(I\); the right half is then \(A^{-1}\). For large matrices, this is the main method.
linear algebra The branch of mathematics that deals with matrices and vectors. It is often a required first- or second-year college course and is the foundation of computer graphics, statistics, AI and more.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.

Operations with negative numbers (Grade 7)
  • Being able to multiply, subtract and divide with negative numbers without sign mistakes
Reciprocals (Grades 6–7)
  • Knowing that a reciprocal is "the number that gives 1 when multiplied" (\(3 \times \dfrac{1}{3} = 1\)). The inverse matrix is the matrix version of this idea
  • Knowing that 0 alone has no reciprocal (this connects to the fact that some matrices have no inverse)
Matrix basics and multiplication (linear algebra)
  • Knowing the words row (horizontal line), column (vertical line), entry and square matrix (explained on the sister page "Matrix Calculator")
  • Knowing how to multiply matrices (each entry comes from a row × a column)
Determinants (linear algebra)
  • Being able to calculate the 2×2 determinant \(ad - bc\) (the sister page "Determinant Calculator" has a calculator with steps)

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the inverse of a 2×2 matrix
Row 1 of matrix A 4 7
Row 2 of matrix A 2 6
Inverse A⁻¹ =MINVERSE(B1:C2)
Table to find the inverse of a 3×3 matrix
Row 1 of matrix A 1 2 3
Row 2 of matrix A 0 1 4
Row 3 of matrix A 5 6 0
Inverse A⁻¹ =MINVERSE(B1:D3)
The MINVERSE function alone finds the inverse. Give it the range of the square matrix (B1:C2 in the first table), and the answer appears as a matrix of the same size, spreading automatically to the right and down from the cell with the formula (the spill feature; in older Excel, select a range the size of the answer first and enter the formula with Ctrl+Shift+Enter).
In the first table, row 1 is 0.6 and -0.7 and row 2 is -0.2 and 0.4. In the second table, row 1 is -24, 18, 5, row 2 is 20, -15, -4, and row 3 is -5, 4, 1.
If you give MINVERSE a matrix whose determinant is 0 (one with no inverse), it returns a #NUM! error. You can check the determinant itself with the MDETERM function.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the inverse of a 2×2 matrix
Row 1 of matrix A 4 7
Row 2 of matrix A 2 6
Inverse A⁻¹ =MINVERSE(B1:C2)
Table to find the inverse of a 3×3 matrix
Row 1 of matrix A 1 2 3
Row 2 of matrix A 0 1 4
Row 3 of matrix A 5 6 0
Inverse A⁻¹ =MINVERSE(B1:D3)
The same MINVERSE function as in Excel works as is. Copy the whole table and paste it into cell A1. The answer spreads automatically to the right and down from the cell with the formula.
In the first table, row 1 is 0.6 and -0.7 and row 2 is -0.2 and 0.4; in the second table, row 1 is -24, 18, 5, row 2 is 20, -15, -4, and row 3 is -5, 4, 1.

How to calculate it in Python

from fractions import Fraction

A = [[4, 7], [2, 6]]

def determinant(matrix):    # determinant (cofactor expansion along row 1, computed recursively)
    n = len(matrix)
    if n == 1:
        return matrix[0][0]
    total = 0
    for j in range(n):
        minor = [row[:j] + row[j + 1:] for row in matrix[1:]]   # submatrix without row 1 and column j
        total += (-1) ** j * matrix[0][j] * determinant(minor)
    return total

def inverse(matrix):        # inverse (adjugate matrix divided by the determinant)
    n = len(matrix)
    det = Fraction(determinant(matrix))
    if det == 0:
        return None         # when the determinant is 0, there is no inverse
    inverse_rows = []
    for i in range(n):
        row = []
        for j in range(n):
            # entry (i, j) = minor without row j and column i x sign / determinant (includes the transpose)
            minor = [r[:i] + r[i + 1:] for k, r in enumerate(matrix) if k != j]
            row.append((-1) ** (i + j) * determinant(minor) / det)
        inverse_rows.append(row)
    return inverse_rows

inverse_matrix = inverse(A)
if inverse_matrix is None:
    print("The inverse does not exist (det(A) = 0)")
else:
    for row in inverse_matrix:
        print([float(x) for x in row])
Runs with the standard library only. It uses fractions, which keeps numbers as exact fractions, so even division adds no error. Replace A at the top with your own matrix (any square matrix, even 4×4 or larger) and run it. This example prints [0.6, -0.7] for row 1 and [-0.2, 0.4] for row 2. For serious numerical work, the standard choice is NumPy, a library made for matrices (numpy.linalg.inv(A)).

How to write it in LaTeX and other math languages (copy and paste)

Definition of the inverse (the matrix that gives the identity matrix)
AA⁻¹ = A⁻¹A = I
A A^{-1} = A^{-1} A = I
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>A</mi>
    <msup><mi>A</mi><mrow><mo>-</mo><mn>1</mn></mrow></msup>
    <mo>=</mo>
    <msup><mi>A</mi><mrow><mo>-</mo><mn>1</mn></mrow></msup>
    <mi>A</mi>
    <mo>=</mo>
    <mi>I</mi>
  </mrow>
</math>
A A^-1 = A^-1 A = I
A . Inverse[A]
A . LinearAlgebra:-MatrixInverse(A);
I = A * inv(A);
AA^(-1) = A^(-1)A = I
Formula for the inverse of a 2×2 matrix
A⁻¹ = 1/(ad − bc) × [d, −b; −c, a]
A^{-1} = \frac{1}{ad - bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <msup><mi>A</mi><mrow><mo>-</mo><mn>1</mn></mrow></msup>
    <mo>=</mo>
    <mfrac>
      <mn>1</mn>
      <mrow><mi>a</mi><mi>d</mi><mo>-</mo><mi>b</mi><mi>c</mi></mrow>
    </mfrac>
    <mrow>
      <mo>(</mo>
      <mtable>
        <mtr><mtd><mi>d</mi></mtd><mtd><mrow><mo>-</mo><mi>b</mi></mrow></mtd></mtr>
        <mtr><mtd><mrow><mo>-</mo><mi>c</mi></mrow></mtd><mtd><mi>a</mi></mtd></mtr>
      </mtable>
      <mo>)</mo>
    </mrow>
  </mrow>
</math>
A^-1 = 1/(ad - bc) [[d, -b], [-c, a]]
Inverse[{{a, b}, {c, d}}]
LinearAlgebra:-MatrixInverse(Matrix([[a, b], [c, d]]));
B = inv(A);
A^(-1) = 1/(ad − bc) (■(d&−b@−c&a))
Using the adjugate matrix (the general formula, also for 3×3 and larger)
A⁻¹ = adj(A)/det(A)
A^{-1} = \frac{1}{\det(A)} \operatorname{adj}(A)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <msup><mi>A</mi><mrow><mo>-</mo><mn>1</mn></mrow></msup>
    <mo>=</mo>
    <mfrac>
      <mn>1</mn>
      <mrow><mi>det</mi><mo>&#x2061;</mo><mrow><mo>(</mo><mi>A</mi><mo>)</mo></mrow></mrow>
    </mfrac>
    <mi>adj</mi><mo>&#x2061;</mo><mrow><mo>(</mo><mi>A</mi><mo>)</mo></mrow>
  </mrow>
</math>
A^-1 = 1/(det(A)) "adj"(A)
Inverse[A]
LinearAlgebra:-MatrixInverse(A);
B = inv(A);
A^(-1) = adj(A)/det(A)

How to have ChatGPT  do the calculation

You are a calculation assistant for matrices. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

Find the inverse of each of the following two square matrices.
1. A = [[4, 7], [2, 6]]
2. B = [[1, 2], [2, 4]]

For each one, first show the value of the determinant and whether the inverse exists; if it exists, show the entries of the inverse. Finally, also run a check that the product of the original matrix and its inverse is the identity matrix.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.