Linear Algebra

Determinant Calculator

This matrix determinant calculator finds det A for any square matrix from 2 × 2 to 6 × 6 as an exact fraction, by row reduction or cofactor expansion, with every step shown.

Try
Matrix A (square)

Choose the size, then type whole numbers, decimals or fractions such as 2/3. You can paste a block copied from a spreadsheet.

Method

Cofactor expansion is shown for matrices up to 4 × 4; larger ones use row reduction.

Result

Determinant det(A): −25

Determinant det(A)

det⁡A=−25\det A = -25

Invertible?
Yes, because det A ≠ 0
Scale factor for volume, |det A|
2525
Orientation
Reversed (det A < 0)
Rank
3 of 3
det(A⁻¹) = 1/det A
−125-\frac{1}{25}
Size
3 × 3

The determinant is −25. A is invertible, and as a linear transformation it multiplies volume by 25 and reverses orientation (like a mirror image).

Step-by-step working (5 steps)
  1. Start with the matrix

    Use row operations to make the matrix upper triangular. Adding a multiple of one row to another does not change the determinant; each row swap changes its sign.

    det⁡A=|123241312|\det A = \begin{vmatrix} 1 & 2 & 3 \\ 2 & 4 & 1 \\ 3 & 1 & 2 \end{vmatrix}
  2. R2 → R2 − 2R1

    Subtract 2 times row 1 from row 2 to make the entry in column 1 zero (this does not change the determinant).

    det⁡A=|12300−5312|\det A = \begin{vmatrix} 1 & 2 & 3 \\ 0 & 0 & -5 \\ 3 & 1 & 2 \end{vmatrix}
  3. R3 → R3 − 3R1

    Subtract 3 times row 1 from row 3 to make the entry in column 1 zero (this does not change the determinant).

    det⁡A=|12300−50−5−7|\det A = \begin{vmatrix} 1 & 2 & 3 \\ 0 & 0 & -5 \\ 0 & -5 & -7 \end{vmatrix}
  4. R2 ↔ R3

    Swap rows 2 and 3 to get a nonzero pivot in column 2. A row swap changes the sign of the determinant.

    det⁡A=−|1230−5−700−5|\det A = -\begin{vmatrix} 1 & 2 & 3 \\ 0 & -5 & -7 \\ 0 & 0 & -5 \end{vmatrix}
  5. Multiply the diagonal entries

    The matrix is upper triangular, so its determinant is the product of the diagonal entries, with the sign flipped because of the odd number of row swaps.

    det⁡A=−[1⋅(−5)⋅(−5)]=−25\det A = -\left[1 \cdot \left(-5\right) \cdot \left(-5\right)\right] = -25

For a 2 × 2 matrix det⁡A=ad−bc\det A = ad - bc; larger matrices are reduced to triangular form, whose determinant is the product of the diagonal.

By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. Pick the size of the square matrix (1 × 1 to 6 × 6) with the size menu.
  2. Type the entries row by row. Decimals such as 0.5 and fractions such as −2/3 are converted to exact fractions. You can paste a block copied from a spreadsheet.
  3. Choose a method. Row reduction works for every size. Cofactor expansion is shown for matrices up to 4 × 4 and expands along the row or column with the most zeros.
  4. Read the determinant, then the notes underneath: whether A is invertible, how it scales area or volume, whether it reverses orientation, and its rank.

Formulas

2 × 2 determinant

det⁡[abcd]=ad−bc\det \begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc

Plain-text formula: det [a, b; c, d] = ad − bc

The product of the main diagonal minus the product of the other diagonal.

3 × 3 determinant (rule of Sarrus)

det⁡[abcdefghi]=aei+bfg+cdh−ceg−bdi−afh\det \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix} = aei + bfg + cdh - ceg - bdi - afh

Plain-text formula: det [a, b, c; d, e, f; g, h, i] = aei + bfg + cdh − ceg − bdi − afh

Add the three products running down to the right and subtract the three running up to the right. This shortcut works only for 3 × 3 matrices; it gives the same answer as cofactor expansion along the first row, a(ei−fh)−b(di−fg)+c(dh−eg)a(ei - fh) - b(di - fg) + c(dh - eg).

Cofactor (Laplace) expansion along row i

det⁡A=∑j=1n(−1)i+jaijMij\det A = \sum_{j=1}^{n} (-1)^{i+j}\, a_{ij}\, M_{ij}

Plain-text formula: det A = ∑_{j = 1}^n (−1)^(i + j) a_(ij) M_(ij)

aija_{ij}
entry in row i, column j
MijM_{ij}
minor: determinant of A with row i and column j removed
(−1)i+jMij(-1)^{i+j} M_{ij}
the cofactor of aija_{ij}

Each entry of the chosen row is multiplied by its cofactor, the signed determinant of the matrix left after deleting that entry’s row and column. The signs follow a checkerboard that starts with + in the top-left corner. The same formula works down a column, so expand along the row or column with the most zeros.

Row reduction

det⁡A=(−1)su11u22⋯unn\det A = (-1)^{s} \, u_{11} u_{22} \cdots u_{nn}

Plain-text formula: det A = (−1)^s u_11u_22⋯u_(nn)

Gaussian elimination turns A into an upper triangular matrix U using row replacements (which leave the determinant unchanged) and s row swaps (each flips the sign). The determinant of a triangular matrix is the product of its diagonal.

Useful properties

det(AB)=det⁡A⋅det⁡B,det(AT)=det⁡A,det(kA)=kndet⁡A,det(A−1)=1det⁡A\det(AB) = \det A \cdot \det B, \quad \det(A^{T}) = \det A, \quad \det(kA) = k^{n} \det A, \quad \det(A^{-1}) = \frac{1}{\det A}

Plain-text formula: det(AB) = det A · det B, det(A^T) = det A, det(kA) = k^n det A, det(A^(−1)) = 1/(det A)

These hold for any n × n matrices A and B and any number k; the last one needs A to be invertible.

Reading the result

A determinant of 0 means the matrix is singular: its rows (and columns) are linearly dependent, it has no inverse, and a system Ax→=b→A\vec{x} = \vec{b} has either no solution or infinitely many. Any nonzero determinant, however small, means A is invertible.

Geometrically, the absolute value |det A| is the factor by which the transformation x→↦Ax→\vec{x} \mapsto A\vec{x} scales areas (2 × 2), volumes (3 × 3) or n-dimensional volumes. A negative sign means orientation is reversed, as with a reflection.

The rank shown with the result says how many rows are independent. A rank below n always goes with a determinant of 0.

How to find the determinant of a matrix

First check the matrix is square: only n × n matrices have a determinant. Then pick the method that suits the size. For a 2 × 2 matrix use ad−bcad - bc. For a 3 × 3 matrix use the rule of Sarrus or expand along a row. For 4 × 4 and larger, either expand along the row or column with the most zeros or row reduce to triangular form and multiply the diagonal.

Whichever method you use, the answer is the same. The choice only changes how much arithmetic you do, as the table shows.

Methods for finding a determinant, by matrix size
MethodWorks forAmount of workBest when
ad − bc2 × 2 only2 multiplicationsAlways, for 2 × 2
Rule of Sarrus3 × 3 only12 multiplicationsA quick 3 × 3 check by hand
Cofactor expansionAny sizeGrows like n! (720 terms for a full 6 × 6)Small matrices, or a row or column with many zeros
Row reductionAny sizeAbout n³/3 multiplications4 × 4 and larger, and what software uses
Product of the diagonalTriangular or diagonal matricesn − 1 multiplicationsAll entries above or below the diagonal are 0

Determinant of a 3 × 3 matrix by the rule of Sarrus

Take the default matrix A=[123241312]A = \begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 1 \\ 3 & 1 & 2 \end{bmatrix}, so a = 1, b = 2, c = 3, d = 2, e = 4, f = 1, g = 3, h = 1 and i = 2.

The products running down to the right are aei=8aei = 8, bfg=6bfg = 6 and cdh=6cdh = 6, which add to 20. The products running up to the right are ceg=36ceg = 36, bdi=8bdi = 8 and afh=1afh = 1, which add to 45. So det⁡A=20−45=−25\det A = 20 - 45 = -25, the same value the row reduction in the worked example below gives.

Sarrus does not extend to 4 × 4: copying the first columns of a 4 × 4 matrix gives only 8 of the 24 terms. Use cofactor expansion or row reduction instead.

Determinant of a 4 × 4 matrix by cofactor expansion

Expand along the row or column with the most zeros. In A=[302−1120−2406−35020]A = \begin{bmatrix} 3 & 0 & 2 & -1 \\ 1 & 2 & 0 & -2 \\ 4 & 0 & 6 & -3 \\ 5 & 0 & 2 & 0 \end{bmatrix} column 2 has three zeros, so only the entry a22=2a_{22} = 2 contributes. Its sign is (−1)2+2=+(-1)^{2+2} = +.

Deleting row 2 and column 2 leaves [32−146−3520]\begin{bmatrix} 3 & 2 & -1 \\ 4 & 6 & -3 \\ 5 & 2 & 0 \end{bmatrix}, whose determinant is 3(0+6)−2(0+15)+(−1)(8−30)=18−30+22=103(0 + 6) - 2(0 + 15) + (-1)(8 - 30) = 18 - 30 + 22 = 10.

So det⁡A=2⋅10=20\det A = 2 \cdot 10 = 20. Load the “4 × 4 by cofactors” example above to see every step.

How row operations change the determinant

Row reduction is the fastest way to a determinant, but each kind of row operation affects the value differently. Keep track of them and correct at the end.

To see the elimination that produces an inverse instead, use the inverse matrix calculator; for the rank and pivots, use the RREF calculator.

Effect of each elementary row operation on det A
Row operationExampleEffect on the determinant
Swap two rowsR1 ↔ R2Changes the sign
Multiply one row by kR2 → 3R2Multiplies it by k
Add a multiple of one row to anotherR3 → R3 − 2R1No change
Multiply the whole n × n matrix by kA → 2AMultiplies it by kⁿ

Common mistakes

Dropping the sign of a row swap. Every swap multiplies the determinant by −1, so an odd number of swaps flips the final sign.

Forgetting the checkerboard signs. In cofactor expansion the entry in row i, column j takes the sign (−1)i+j(-1)^{i+j}, so the middle entry of the first row of a 3 × 3 matrix is subtracted.

Using Sarrus on a 4 × 4 matrix. The diagonal shortcut is only valid for 3 × 3 matrices.

Scaling the whole matrix by k. det(kA)=kndet⁡A\det(kA) = k^n \det A, not kdet⁡Ak \det A.

Treating a tiny determinant as zero. A matrix is singular only when the determinant is exactly 0. This calculator works in exact fractions, so there is no rounding to blur the two.

Worked example

Determinant of a 3 × 3 matrix by row reduction

Find det A for A = [[1, 2, 3], [2, 4, 1], [3, 1, 2]].

  1. R2 → R2 − 2R1 gives row 2 = (0, 0, −5), and R3 → R3 − 3R1 gives row 3 = (0, −5, −7). Row replacements do not change the determinant.
  2. The pivot position in column 2 now holds 0, so swap R2 ↔ R3. The swap changes the sign of the determinant.
  3. The matrix is upper triangular with diagonal entries 1, −5 and −5, whose product is 25.
  4. One row swap was used, so det⁡A=−(1)(−5)(−5)=−25\det A = -(1)(-5)(-5) = -25.
  5. Check by cofactor expansion along row 1: 1(8−1)−2(4−3)+3(2−12)=7−2−30=−251(8 - 1) - 2(4 - 3) + 3(2 - 12) = 7 - 2 - 30 = -25.

Answer: det⁡A=−25\det A = -25. A is invertible, it scales volumes by 25, and the negative sign means it reverses orientation.

Frequently asked questions

How do I find the determinant of a 3x3 matrix?

Use the rule of Sarrus, aei + bfg + cdh − ceg − bdi − afh, or expand along the first row: a(ei − fh) − b(di − fg) + c(dh − eg). For [[1, 2, 3], [2, 4, 1], [3, 1, 2]] both give 20 − 45 = −25.

How do you find the determinant of a 4x4 matrix?

Expand along the row or column with the most zeros, which turns it into a sum of 3 × 3 determinants, or row reduce it to triangular form and multiply the diagonal, changing the sign once for every row swap. The rule of Sarrus does not work for 4 × 4 matrices.

What does a determinant of zero mean?

The matrix is singular. Its rows are linearly dependent, it has no inverse, and it squashes space into a lower dimension. For example, [[1, 2, 3], [4, 5, 6], [7, 8, 9]] has determinant 0 because row 3 = 2 × row 2 − row 1.

What is the determinant of a 2 × 2 matrix?

For [[a, b], [c, d]] it is ad − bc. For [[5, 2], [3, 4]] that is 5 · 4 − 2 · 3 = 14.

Can a non-square matrix have a determinant?

No. The determinant is defined only for square matrices, so a 3 × 2 matrix has none. It measures how an n-dimensional volume changes under a map from n-dimensional space to itself.

How do I calculate a determinant on a Casio or TI calculator?

On a Casio fx-991EX, open Matrix mode, define MatA, then choose Determinant from the OPTN menu and enter det(MatA). On a TI-84, store the matrix in [A] from the MATRIX menu (2nd, x⁻¹), then choose MATH, 1: det( and enter det([A]). Neither shows the working; this calculator does.

Can this calculator find a determinant with variables?

No. Entries must be numbers, fractions or decimals. For a symbolic matrix, expand by cofactors by hand using the formulas on this page; the 2 × 2 rule and the rule of Sarrus give the polynomial directly.

Does det(A + B) equal det A + det B?

Usually not. The determinant is multiplicative, det(AB) = det A · det B, but it is not additive. For example, det(I + I) = det(2I) = 2ⁿ for an n × n identity, not 2.

Matrix Calculator

Multiply, add and subtract matrices up to 6 × 6, plus determinant, inverse, transpose and powers, exactly.

Linear Algebra

Inverse Matrix Calculator

Exact inverses of 2x2 to 6x6 matrices by Gauss–Jordan elimination, with every row operation and a check.

Linear Algebra

RREF Calculator

Reduced row echelon form or REF with each row operation, rank, nullity and linear system solutions.

Linear Algebra

Cross Product Calculator

a × b with i, j, k determinant steps, magnitude, unit normal, angle and area, plus triple products.

Linear Algebra

Step-by-Step Math Solver

Free worked solutions for equations, systems, inequalities, factoring, derivatives, integrals, limits and matrices.

Tools

Learn more: For matrix input in the full calculator, read matrices and vectors. Determinants also solve small systems by Cramer’s rule: see how to solve two equations.

Sources and further reading

  1. Introduction to Linear Algebra, 6th edition, Chapter 5: Determinants, Wellesley-Cambridge Press (Gilbert Strang, 2023)
  2. 18.06 Linear Algebra, Lectures 18 to 20: Determinants (opens in a new tab), MIT OpenCourseWare
  3. Solving Systems with Cramer’s Rule (Section 7.8, College Algebra 2e) (opens in a new tab), OpenStax, Rice University

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?