Determinant Calculator
Find the determinant of any 2×2 to 6×6 matrix instantly — see the exact formula, every substituted value, and a labeled diagram that shows the whole calculation at a glance.
Matrix size
Positive, negative, or decimal values are all fine.
Try an example
Determinant Diagram
Sarrus' Rule: the first two columns repeat on the right. Blue diagonals are added, red diagonals are subtracted.
Step-by-Step Solution
Here's exactly how this answer was calculated, one step at a time.
Given: A = [2, -1, 3; 4, -2, 5; 1, 6, -3]
Step 1: Write Sarrus' Rule for a 3×3 matrix
Copy the first two columns to the right of the matrix, multiply along the three downward diagonals (added) and the three upward diagonals (subtracted).
det(A) = aei + bfg + cdh − ceg − afh − bdiStep 2: Multiply the three downward (positive) diagonals
Each downward diagonal wraps around using the two repeated columns, and every product here is added.
a·e·i = 2×-2×-3 = 12 b·f·g = -1×5×1 = -5 c·d·h = 3×4×6 = 72Step 3: Multiply the three upward (negative) diagonals
Every upward diagonal product here is subtracted from the total.
c·e·g = 3×-2×1 = -6 a·f·h = 2×5×6 = 60 b·d·i = -1×4×-3 = 12Step 4: Add the positive diagonal products
Sum of aei + bfg + cdh.
12 + -5 + 72 = 79Step 5: Add the negative diagonal products
Sum of ceg + afh + bdi.
-6 + 60 + 12 = 66Step 6: Subtract to get the determinant
The positive diagonal sum minus the negative diagonal sum is the final determinant.
79 − 66 = 13
The determinant of the matrix is:
det(A) = 13
Free Online Determinant Calculator
This determinant calculator finds the determinant of any square matrix — 2×2, 3×3, 4×4, 5×5, or 6×6 — instantly, using exactly the same formulas taught in linear algebra classes. Type in any matrix values, positive, negative, or decimal, and the calculator shows the final determinant along with a complete step-by-step solution and a labeled diagram where every value from your matrix appears directly on the diagonals or minors, so the whole calculation is visible at a glance rather than hidden inside a black box.
Whether you're a student checking algebra or engineering homework, a teacher preparing worked examples, or anyone who just needs a fast and reliable matrix determinant solver, this tool works for any equation you throw at it — real numbers, decimals, or negatives — and always shows its full working.
What Is a Determinant? (Definition and Meaning)
The determinant is a single number calculated from a square matrix that reveals key properties about that matrix: whether it can be inverted, how it scales area or volume when treated as a linear transformation, and whether a system of linear equations built from it has exactly one solution. Every square matrix has exactly one determinant, written as det(A) or |A|.
If the determinant of a matrix is zero, the matrix is called singular and has no inverse. If the determinant is non-zero, the matrix is invertible, and any linear system based on it has exactly one unique solution. Determinants are only defined for square matrices — matrices with the same number of rows and columns — because the formula pairs every row with every column exactly once.
Determinant Formula for a 2×2 Matrix
The 2×2 determinant formula is the simplest case, and it's worth memorizing because larger matrices eventually break down into 2×2 pieces during cofactor expansion.
- For a matrix with entries a, b (top row) and c, d (bottom row): det(A) = a×d − b×c
- Multiply the main diagonal (top-left to bottom-right: a and d) and subtract the product of the anti-diagonal (top-right to bottom-left: b and c)
- Example: for a=4, b=3, c=2, d=5 → det(A) = (4×5) − (3×2) = 20 − 6 = 14
Determinant Formula for a 3×3 Matrix (Sarrus' Rule)
A 3×3 determinant can be solved with a shortcut called Sarrus' Rule: copy the first two columns to the right of the matrix, multiply along the three downward diagonals and add them, then multiply along the three upward diagonals and subtract them.
- For rows (a, b, c), (d, e, f), (g, h, i): det(A) = aei + bfg + cdh − ceg − afh − bdi
- Downward (positive) diagonals: aei, bfg, cdh
- Upward (negative) diagonals: ceg, afh, bdi
- Example: a=1,b=2,c=3, d=4,e=5,f=6, g=7,h=8,i=10 → det(A) = 1(50)+2(-2)+3(-3)... = 2 + 4 − 9 = −3
Cofactor Expansion Formula for 4×4 and Larger Matrices
There's no diagonal shortcut like Sarrus' Rule for a 4×4 matrix or larger — instead, the determinant is found using cofactor (Laplace) expansion. You expand along the first row: for each entry, cross out its row and column to get a smaller minor matrix, calculate that minor's determinant, and multiply it by the entry, alternating plus and minus signs as you move across the row.
- General formula: det(A) = Σ (−1)^(1+j) × a₁ⱼ × det(minorⱼ), summed for every column j
- The recursion keeps breaking each minor into smaller minors until only 2×2 blocks remain, which are solved with the basic a×d − b×c formula
- This calculator supports up to 6×6 matrices and shows every minor's value directly on the diagram
How to Find the Determinant of a Matrix Step by Step
No matter the matrix size, finding a determinant always follows the same general sequence:
- Step 1 — Confirm the matrix is square (same number of rows and columns); non-square matrices have no determinant.
- Step 2 — For a 2×2 matrix, multiply the main diagonal and subtract the anti-diagonal product.
- Step 3 — For a 3×3 matrix, apply Sarrus' Rule or expand by cofactors along any row or column.
- Step 4 — For a 4×4 matrix or larger, expand along the first row using cofactors, reducing each minor recursively until 2×2 blocks remain.
- Step 5 — Add all the signed terms together to get the final determinant.
- Step 6 — Check the sign and value: a zero determinant means the matrix is singular (not invertible); a non-zero value means it is invertible.
How to Use This Determinant Calculator
Pick your matrix size using the 2×2 through 6×6 buttons, then type each value into the grid — decimals and negative numbers are all supported. As soon as you enter values, the calculator instantly shows the determinant, whether the matrix is singular, and its sign. The diagram below updates live: for 2×2 matrices it draws the diagonal cross with both products labeled; for 3×3 matrices it draws the full Sarrus' Rule layout with all six diagonal products; and for 4×4 matrices and larger it shows the cofactor expansion of row 1 with every minor's determinant already calculated and displayed on the diagram itself, so nothing is left as an unexplained black box.
Scroll down further for the complete written step-by-step solution, which mirrors exactly what you'd write by hand — formula first, then your real values substituted in, then the arithmetic worked through to the final answer.
Worked Examples
2×2 example: for the matrix with a=4, b=3, c=2, d=5, det(A) = (4×5) − (3×2) = 20 − 6 = 14.
3×3 example: for rows (1, 2, 3), (4, 5, 6), (7, 8, 10), det(A) = 1×(5×10 − 6×8) − 2×(4×10 − 6×7) + 3×(4×8 − 5×7) = 1×2 − 2×(−2) + 3×(−3) = 2 + 4 − 9 = −3.
Singular matrix example: for rows (1, 2, 3), (4, 5, 6), (7, 8, 9), the determinant works out to exactly 0 — this matrix has no inverse, because its third row is a linear combination of the first two.
Key Properties of Determinants
A handful of properties make determinants easier to reason about and can help you sanity-check any calculation:
- If any row or column is entirely zero, the determinant is 0.
- If two rows or two columns are identical, the determinant is 0.
- Swapping any two rows (or two columns) flips the sign of the determinant.
- Multiplying a single row by a constant k multiplies the whole determinant by k.
- For a triangular matrix (upper or lower), the determinant is simply the product of the diagonal entries.
- The determinant of any identity matrix is always 1.
- det(AB) = det(A) × det(B) for any two square matrices of the same size.
- Transposing a matrix never changes its determinant: det(Aᵀ) = det(A).
Real-World Applications of the Determinant
Determinants show up throughout mathematics, engineering, and science wherever square matrices are used:
- Linear algebra — checking whether a matrix is invertible and solving systems of equations with Cramer's Rule.
- Computer graphics — measuring how a transformation scales area or volume, and detecting mirrored (flipped) transformations.
- Engineering — structural analysis, circuit analysis using Kirchhoff's laws, and control-systems stability checks.
- Physics — computing cross products, torque, and Jacobians in coordinate transformations.
- Economics — input-output models and testing whether a system of equations has a unique equilibrium.
Frequently Asked Questions
What does it mean if the determinant is zero? A zero determinant means the matrix is singular — it has no inverse, and any linear system it represents either has no solution or infinitely many solutions.
Can a determinant be negative? Yes, and it's completely normal — a negative determinant usually means the transformation the matrix represents flips orientation, like a mirror reflection.
Is there a determinant formula for a non-square matrix? No — determinants are only defined for square matrices, since the formula requires pairing every row with every column exactly once.
What's the fastest way to find a 3×3 determinant by hand? Sarrus' Rule is fastest for 3×3 matrices specifically; for 4×4 and larger, cofactor expansion or row reduction to a triangular form is required.
Frequently Asked Questions
What is the determinant formula for a 2×2 matrix?
For a matrix with rows (a, b) and (c, d), the determinant is det(A) = a×d − b×c — multiply the main diagonal and subtract the product of the anti-diagonal.
What is Sarrus' Rule?
Sarrus' Rule is a shortcut for finding the determinant of a 3×3 matrix: copy the first two columns to the right, multiply along the three downward diagonals (add them), then multiply along the three upward diagonals (subtract them).
How do I find the determinant of a 4×4 matrix or larger?
Use cofactor (Laplace) expansion: pick a row (usually the first), and for each entry multiply it by the determinant of its minor matrix, alternating + and − signs, then add all the terms together. This calculator does this automatically for matrices up to 6×6.
What does a zero determinant mean?
A determinant of zero means the matrix is singular — it has no inverse, and the linear system it represents has either no solution or infinitely many solutions.
Does this calculator work with negative or decimal values?
Yes. Every cell accepts positive numbers, negative numbers, and decimals, and the diagram and step-by-step solution update automatically for whatever values you enter.
Can the determinant be negative?
Yes — a negative determinant is normal and usually indicates the matrix's transformation flips orientation, similar to a mirror reflection.