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

Determinant Calculator (2×2, 3×3, 4×4)

Choose the matrix size (2×2 to 4×4) and enter the entries in the grid. A determinant is defined only for a square matrix (rows = columns).

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 determinant and the steps will appear here.

What you can do on this page

  • Find the determinant \(\det(A)\) of a 2×2, 3×3 or 4×4 square matrix on the spot
  • Steps follow the textbook methods: "\(ad - bc\)" for 2×2, the rule of Sarrus for 3×3 and cofactor expansion for 4×4
  • It also tells you whether the matrix is invertible: if \(\det(A) \neq 0\), an inverse exists
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets (MDETERM) and Python are all on this page
A determinant is defined only for a square matrix (rows = columns). Matrix addition, multiplication, transpose and more are on the sister page "Matrix Calculator".

What is this calculation used for?

Checking whether a system of equations has one solution (Cramer's rule)

For a system of linear equations with as many equations as unknowns, if the determinant of the square matrix of coefficients is not 0, the system has exactly one solution. If the determinant is 0, there is either no solution or infinitely many.
With Cramer's rule, you can even write the solution itself using only ratios of determinants. This is part of the theory behind engineering work that solves huge numbers of equations, such as structural analysis and circuit analysis.

Showing how many times a shape's area or volume grows (scale factor of a linear transformation)

When you transform a flat shape with a 2×2 matrix (rotate it, stretch or shrink it, or shear it), its area is multiplied by exactly \(|\det(A)|\). For a solid and a 3×3 matrix, the volume is multiplied by \(|\det(A)|\).
This role of the determinant as a scale factor also appears in college calculus as the correction factor for a change of variables in an integral (the Jacobian), and it is used all over science and engineering.

Detecting "flipped" shapes in 3D graphics and games

3D graphics software and game engines use matrices to transform models. If the determinant of a transformation matrix is negative, the transformation flips the model like a mirror image, and the front and back of each face (the direction of its normal) are swapped.
So graphics software checks the sign of the determinant to detect flipping and corrects it so that the drawing does not break.

Finding area from coordinates (surveying and maps)

If you know the coordinates of a triangle's vertices, its area is half the absolute value of a determinant built from those coordinates. Extended to polygons, this is called the shoelace formula, a standard way to calculate land area in surveying and in mapping (GIS) software.
The secret behind "enter the coordinates and get the area" is exactly the determinant.

The doorway to eigenvalues (vibration analysis and data analysis)

Vibration analysis, which studies how a building or machine tends to shake, and principal component analysis, which pulls the main trends out of large data sets, both use values of a matrix called eigenvalues.
Eigenvalues are found from the equation "find \(\lambda\) such that \(\det(A - \lambda I) = 0\)" (the characteristic equation). The determinant is also a doorway to this more advanced tool.

Formula

2×2 determinant (ad − bc)
Standard notation (the usual math form)
\(\begin{vmatrix} a & b \\ c & d \end{vmatrix}\) \(=\) \(ad\) \(-\) \(bc\)
In words (symbols replaced with words)
③ \(\det(A)\): 2×2 determinant \(=\) ① \(ad\): top left × bottom right \(-\) ② \(bc\): top right × bottom left
The formula in words
① From the \(ad\): product of top left × bottom right ,
② subtract the \(bc\): product of top right × bottom left , and you get the
③ \(\det(A)\): 2×2 determinant
Quick example
The determinant of the matrix \(\begin{pmatrix} 4 & 7 \\ 2 & 6 \end{pmatrix}\) is
\(\det(A)\): determinant \(=\) top left × bottom right (\(4 \times 6\)) \(-\) top right × bottom left (\(7 \times 2\))
\(\begin{vmatrix} 4 & 7 \\ 2 & 6 \end{vmatrix} = 4 \times 6 - 7 \times 2 = 24 - 14 = 10\)
Key idea
The diagonal from top left to bottom right gets "+", and the diagonal from top right to bottom left gets "−". You just multiply along the two diagonals and subtract, so this criss-cross pattern is easy to remember. The determinant is written \(|A|\) as well as \(\det(A)\) (the bars look like absolute value, but here they have a different job). A matrix with \(\det(A) = 0\) is called "not invertible" (singular), and it has no inverse.
3×3 determinant (rule of Sarrus)
Standard notation (the usual math form)
\(\det(A)\) \(=\) \(aei + bfg + cdh\) \(-\) \((ceg + afh + bdi)\)
In words (symbols replaced with words)
③ \(\det(A)\): 3×3 determinant \(=\) ① sum of the products on the 3 down-right diagonals \(-\) ② sum of the products on the 3 up-right diagonals
The formula in words
① With the entries named \(A = \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix}\), take the sum of the products on the 3 down-right diagonals (\(aei + bfg + cdh\)) ,
② subtract the sum of the products on the 3 up-right diagonals (\(ceg + afh + bdi\)) , and you get the
③ \(\det(A)\): 3×3 determinant
Quick example
The determinant of \(\begin{pmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \\ 1 & 1 & 1 \end{pmatrix}\) is
\(1 \times 3 \times 1 + 0 \times 1 \times 1 + 2 \times (-1) \times 1 = 3 + 0 - 2 = 1\)
\(2 \times 3 \times 1 + 1 \times 1 \times 1 + 0 \times (-1) \times 1 = 6 + 1 + 0 = 7\)
\(\begin{vmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \\ 1 & 1 & 1 \end{vmatrix} = 1 - 7 = -6\)
Key idea
The rule of Sarrus is easier to use if you copy columns 1 and 2 again to the right of the matrix. There are 3 diagonals from top left to bottom right (\(aei\), \(bfg\), \(cdh\), all "+") and 3 diagonals from top right to bottom left (\(ceg\), \(afh\), \(bdi\), all "−"), 6 criss-cross products in all. However, the rule of Sarrus works only up to 3×3 (the 2×2 formula \(ad-bc\) uses the same criss-cross idea). It does not work for 4×4 or larger, so use the cofactor expansion below instead.
Cofactor expansion (the general method, also for 4×4 and larger)
Standard notation (the usual math form)
\(\det(A)\) \(=\) \(\sum_{j=1}^{n}\) \((-1)^{1+j}\) \(a_{1j}\) \(M_{1j}\)
In words (symbols replaced with words)
⑤ \(\det(A)\): \(n\)×\(n\) determinant \(=\) ④ add up for \(j = 1\) to \(n\) ③ \((-1)^{1+j}\): sign (alternating + − + − …) ① \(a_{1j}\): entry in row 1, column \(j\) ② \(M_{1j}\): minor without row 1 and column \(j\)
The formula in words
① Multiply the \(a_{1j}\): entry in row 1, column \(j\)
② by the \(M_{1j}\): minor, the determinant left after removing row 1 and column \(j\) ,
③ attach the \((-1)^{1+j}\): sign (alternating + − + − …) ,
④ and add them up for \(j = 1\) to \(n\) to get the
⑤ \(\det(A)\): \(n\)×\(n\) determinant
Quick example
Expanding the 3×3 example above along row 1 gives (the same answer as the rule of Sarrus)
\(\begin{vmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \\ 1 & 1 & 1 \end{vmatrix} = 1 \times \begin{vmatrix} 3 & 1 \\ 1 & 1 \end{vmatrix} - 0 \times \begin{vmatrix} -1 & 1 \\ 1 & 1 \end{vmatrix} + 2 \times \begin{vmatrix} -1 & 3 \\ 1 & 1 \end{vmatrix}\)
\(= 1 \times 2 - 0 \times (-2) + 2 \times (-4) = 2 - 0 - 8 = -6\)
Key idea
Cofactor expansion (also called Laplace expansion) breaks a large determinant into a combination of determinants one size smaller (minors). A 4×4 becomes four 3×3 determinants, and each 3×3 can be found with the rule of Sarrus (or by expanding again). This calculator shows the steps for 4×4 matrices this way. You do not have to expand along row 1; any row or any column gives the same answer. Choosing a row or column with many 0s makes those terms vanish and the work easier. The signs \((-1)^{i+j}\) alternate + and − like a checkerboard, starting with "+" at the top left.
A determinant is "a single number determined by a square matrix". Use \(ad - bc\) for 2×2, the rule of Sarrus for 3×3 and cofactor expansion for 4×4 and larger. Whether \(\det(A) \neq 0\) tells you if an inverse exists (that is, if the system of equations has exactly one solution).

Symbols and terms

Symbols

\(A\) A The name given to a matrix. By custom, matrices are named with capital letters.
\(\det(A),\ |A|\) determinant of A The determinant of matrix \(A\). The vertical-bar form \(|A|\) is also common (it is the same sign as absolute value for numbers, but around a matrix it stands for the determinant).
\(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.
\(M_{ij}\) M sub i j A minor: the determinant of the one-size-smaller matrix left after removing row \(i\) and column \(j\) from matrix \(A\).
\((-1)^{i+j}\) negative 1 to the power i plus j The sign used in cofactor expansion. It is \(+1\) when \(i+j\) is even and \(-1\) when it is odd, so + and − alternate like a checkerboard, starting with "+" at the top left.
\(\sum\) sigma The sign for "add them all up". \(\sum_{j=1}^{n}\) tells you to add up the terms for every \(j\) from 1 to \(n\).

Terms

determinant A single number determined by a square matrix. It packs key facts about the matrix (whether it has an inverse, how many times a transformation scales area or volume, and so on) into one number.
square matrix A matrix with the same number of rows and columns (shaped like a square). Determinants and inverses exist only for square matrices.
rule of Sarrus A way to find a 3×3 determinant by adding and subtracting the products along 6 diagonals. It is also called the diagonal method. It is named after the French mathematician Pierre Sarrus and works only for 3×3 matrices.
cofactor expansion A method that splits a determinant into a sum of "entry × minor × sign", turning it into determinants one size smaller. It is also called Laplace expansion, and it works for 4×4 and larger determinants.
minor The determinant of the smaller matrix left after removing one row and one column. It is a building block of cofactor expansion.
cofactor A minor \(M_{ij}\) multiplied by the sign \((-1)^{i+j}\). "Cofactor expansion" gets its name from expanding into a sum of these cofactors.
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.
inverse matrix The matrix that gives the identity matrix (1s on the diagonal and 0s elsewhere) when multiplied. It is the matrix version of a reciprocal and is written \(A^{-1}\). It exists only when the determinant is not 0.
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 and subtract with negative numbers without sign mistakes
Variables and subscripts (Grade 6 to high school)
  • Being able to read the small characters at the lower right, as in \(a_{12}\) (subscripts), as labels for a position, not as values
Powers and signs (Grades 6–7)
  • Knowing that \((-1)^{n}\) alternates: \(+1\) when \(n\) is even and \(-1\) when \(n\) is odd
Matrix basics (linear algebra)
  • Knowing the words row (horizontal line), column (vertical line), entry and square matrix (explained on the sister page "Matrix Calculator")

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 a 2×2 determinant
Row 1 of matrix A 4 7
Row 2 of matrix A 2 6
Determinant det(A) =MDETERM(B1:C2)
Table to find a 3×3 determinant
Row 1 of matrix A 1 0 2
Row 2 of matrix A -1 3 1
Row 3 of matrix A 1 1 1
Determinant det(A) =MDETERM(B1:D3)
Table to find a 4×4 determinant
Row 1 of matrix A 1 2 0 1
Row 2 of matrix A 0 1 3 2
Row 3 of matrix A 2 0 1 1
Row 4 of matrix A 1 1 0 2
Determinant det(A) =MDETERM(B1:E4)
The MDETERM function alone finds the determinant. Just give it the range of the square matrix (B1:C2 in the first table), and the answer goes into a single cell.
The first table gives 10, the second gives -6 and the third gives 18.
When MDETERM returns 0, the matrix has no inverse (the MINVERSE function, which finds the inverse, returns an error).

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 a 2×2 determinant
Row 1 of matrix A 4 7
Row 2 of matrix A 2 6
Determinant det(A) =MDETERM(B1:C2)
Table to find a 3×3 determinant
Row 1 of matrix A 1 0 2
Row 2 of matrix A -1 3 1
Row 3 of matrix A 1 1 1
Determinant det(A) =MDETERM(B1:D3)
The same MDETERM function as in Excel works as is. Copy the whole table and paste it into cell A1.
The first table gives 10 and the second gives -6.

How to calculate it in Python

A = [[1, 0, 2], [-1, 3, 1], [1, 1, 1]]

def determinant(matrix):    # cofactor expansion (computed recursively along row 1)
    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

print("det(A) =", determinant(A))
Runs with the standard library only. Replace A at the top with your own matrix (any square matrix, even 4×4 or larger) and run it. This example gives det(A) = -6. For serious numerical work, the standard choice is NumPy, a library made for matrices (numpy.linalg.det(A)).

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

2×2 determinant (ad − bc)
|A| = ad − bc
\det(A) = \begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>det</mi><mo>&#x2061;</mo><mrow><mo>(</mo><mi>A</mi><mo>)</mo></mrow>
    <mo>=</mo>
    <mi>a</mi><mi>d</mi>
    <mo>-</mo>
    <mi>b</mi><mi>c</mi>
  </mrow>
</math>
det(A) = |(a, b), (c, d)| = ad - bc
Det[{{a, b}, {c, d}}]
LinearAlgebra:-Determinant(Matrix([[a, b], [c, d]]));
d = det(A);
det(A) = ad − bc
3×3 determinant (rule of Sarrus)
|A| = aei + bfg + cdh − ceg − afh − bdi
\det(A) = aei + bfg + cdh - ceg - afh - bdi
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>det</mi><mo>&#x2061;</mo><mrow><mo>(</mo><mi>A</mi><mo>)</mo></mrow>
    <mo>=</mo>
    <mi>a</mi><mi>e</mi><mi>i</mi>
    <mo>+</mo>
    <mi>b</mi><mi>f</mi><mi>g</mi>
    <mo>+</mo>
    <mi>c</mi><mi>d</mi><mi>h</mi>
    <mo>-</mo>
    <mi>c</mi><mi>e</mi><mi>g</mi>
    <mo>-</mo>
    <mi>a</mi><mi>f</mi><mi>h</mi>
    <mo>-</mo>
    <mi>b</mi><mi>d</mi><mi>i</mi>
  </mrow>
</math>
det(A) = aei + bfg + cdh - ceg - afh - bdi
Det[{{a, b, c}, {d, e, f}, {g, h, i}}]
LinearAlgebra:-Determinant(Matrix([[a, b, c], [d, e, f], [g, h, i]]));
d = det(A);
det(A) = aei + bfg + cdh − ceg − afh − bdi
Cofactor expansion (the general method, also for 4×4 and larger)
det(A) = Σ (−1)¹⁺ʲ a₁ⱼ M₁ⱼ  (j = 1 to n)
\det(A) = \sum_{j=1}^{n} (-1)^{1+j} a_{1j} M_{1j}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>det</mi><mo>&#x2061;</mo><mrow><mo>(</mo><mi>A</mi><mo>)</mo></mrow>
    <mo>=</mo>
    <munderover>
      <mo>&#x2211;</mo>
      <mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow>
      <mi>n</mi>
    </munderover>
    <msup>
      <mrow><mo>(</mo><mo>-</mo><mn>1</mn><mo>)</mo></mrow>
      <mrow><mn>1</mn><mo>+</mo><mi>j</mi></mrow>
    </msup>
    <msub><mi>a</mi><mrow><mn>1</mn><mi>j</mi></mrow></msub>
    <msub><mi>M</mi><mrow><mn>1</mn><mi>j</mi></mrow></msub>
  </mrow>
</math>
det(A) = sum_(j=1)^(n) (-1)^(1+j) a_(1j) M_(1j)
Det[A]
LinearAlgebra:-Determinant(A);
d = det(A);
det(A) = ∑_(j=1)^n (−1)^(1+j) a_1j M_1j

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 determinant (det) of each of the following two square matrices.
1. A = [[1, 0, 2], [-1, 3, 1], [1, 1, 1]]
2. B = [[1, 2], [2, 4]]

For each one, show the value of the determinant and whether the matrix is invertible (whether the determinant is nonzero, that is, whether an inverse exists).

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.