Determinant calculator with the expansion written out
This determinant calculator finds det(A) for any square matrix from 2×2 up to 8×8 and, more usefully for students, shows how. Choose cofactor (Laplace) expansion to see the matrix expanded along the row or column with the most zeros, each minor written out and evaluated, and the signed terms added up. Choose row reduction to see Gaussian elimination instead: pivots, row operations and the product of the diagonal, with sign flips for every row swap.
All arithmetic is exact. Entries can be fractions like 3/4 or decimals like 0.25, and the result is reported as an exact fraction (with a decimal approximation) or in decimals if you prefer. The answer is cross-checked with the other method automatically, and for 3×3 matrices the rule of Sarrus is shown as a third confirmation.
Nothing is uploaded; the calculation happens in your browser as you type.
How to use the Determinant Calculator
- Choose the matrix size (2 × 2 to 8 × 8). The grid resizes and keeps the entries you have already typed.
- Type the entries, or open “Paste the matrix from text” and paste rows on separate lines, then press “Use this text”.
- Pick the method whose steps you want to see: cofactor expansion or row reduction. The determinant is the same either way.
- Read det in the result panel. Below it you get the invertibility verdict, the cross-check, and related values such as det(2A) and det(A⁻¹).
- Use “Copy LaTeX” to paste the matrix and its determinant into a document, or “Copy steps” to keep the working as plain text.
Determinant Calculator features
Two methods, both with steps
Laplace expansion for small matrices (minors shown as matrices, nested expansion for 4×4) and Gaussian elimination for any size, with every row operation listed.
Smart expansion line
The cofactor method expands along the row or column with the most zeros, which is exactly what you should do by hand to save work.
Exact fractions
Entries are stored as rational numbers with arbitrary-precision integers, so a determinant of 1/60 is reported as 1/60 and a singular matrix gives exactly 0.
Built-in verification
The answer from one method is checked against the other; for 3×3 matrices the rule of Sarrus is displayed too.
LaTeX output
The matrix and its value copy as a vmatrix environment ready for LaTeX, Overleaf or Markdown with MathJax.
Up to 8×8
Large enough for coursework, small enough to keep the steps readable.
How cofactor expansion works
For an n×n matrix A, pick any row i. Then det(A) = Σj (−1)i+j · aij · Mij, where the minor Mij is the determinant of the (n−1)×(n−1) matrix left after deleting row i and column j, and (−1)i+j gives the checkerboard sign pattern (+ − + − …). The same formula works down any column. Expanding along a line that contains zeros skips those terms entirely, which is why the calculator looks for the line with the most zeros.
The recursion stops at 2×2, where det [[a, b], [c, d]] = ad − bc. For a 3×3 matrix this produces three 2×2 minors; for a 4×4, four 3×3 minors each needing three 2×2 minors, and so on — the number of operations grows like n!, which is why row reduction is used in practice for anything larger than about 4×4.
Worked example: a 3×3 determinant
Take A = [[2, −3, 1], [2, 0, −1], [1, 4, 5]]. Expanding along the first row: 2 · det [[0, −1], [4, 5]] − (−3) · det [[2, −1], [1, 5]] + 1 · det [[2, 0], [1, 4]]. The minors are 0·5 − (−1)·4 = 4, 2·5 − (−1)·1 = 11, and 2·4 − 0·1 = 8. So det(A) = 2·4 + 3·11 + 1·8 = 8 + 33 + 8 = 49.
By row reduction: subtract row 1 from row 2 and half of row 1 from row 3 to get an upper-triangular matrix with diagonal 2, 3 and 49/6; the product 2 · 3 · 49/6 = 49 agrees. The rule of Sarrus (copy the first two columns to the right, add the three down-right diagonals, subtract the three up-right diagonals) gives 0 + 3 + 8 − 0 − (−8) − (−30) = 49 as well.
Properties of determinants worth remembering
For the inverse, rank or eigenvalues of the same matrix, use the matrix calculator. If the determinant comes from Cramer’s rule for a system of equations, the equation solver shows the full solution.
- det(Aᵀ) = det(A), so expanding along a row or a column gives the same answer.
- Swapping two rows changes the sign; multiplying a row by k multiplies the determinant by k; adding a multiple of one row to another leaves it unchanged. These three rules are what make row reduction work.
- det(kA) = kⁿ · det(A) for an n×n matrix — doubling every entry of a 3×3 matrix multiplies the determinant by 8, not 2.
- det(AB) = det(A) · det(B) and det(A⁻¹) = 1/det(A). A matrix is invertible exactly when its determinant is non-zero.
- The determinant of a triangular matrix is the product of its diagonal entries, and |det(A)| is the area or volume scale factor of the linear map A.
Determinant Calculator FAQ
How do I find the determinant of a 3×3 matrix?
Expand along any row or column: multiply each entry by its signed 2×2 minor and add the results, or use the rule of Sarrus. Select 3 × 3 above, enter the matrix and the determinant calculator writes out every minor for you.
Which method should I pick, cofactor or row reduction?
For 2×2 to 4×4 matrices cofactor expansion matches what most textbooks teach and shows every minor. For 5×5 and larger, row reduction is far shorter; the cofactor view still shows the top-level expansion with the minor values computed by elimination.
What does a determinant of 0 mean?
The matrix is singular: it has no inverse, its rows (and columns) are linearly dependent, and a system Ax = b built from it has either no solution or infinitely many.
Can I enter fractions and decimals?
Yes — entries such as 1/3, −2/5, 0.25 or 1e3 are accepted. Computation is exact, so a determinant of 1/60 is shown as 1/60; switch to decimals to see 0.016667.
Why does the calculator expand along a column instead of row 1?
It chooses the row or column with the most zeros because every zero removes one minor from the work. The determinant is identical whichever line you expand along.
Is there a size limit?
The determinant calculator handles up to 8×8 here; beyond that the steps become too long to be useful.