🔢 Matrix Determinant Calculator (2×2 to 5×5)

Determinants for 2×2, 3×3, 4×4 and 5×5 matrices with the cofactor expansion shown — exact for integer inputs, so a singular matrix reads 0 rather than 1e-16.

Free No Signup Required Browser-Based
Matrix Determinant |A|
det(A) = 1
✓ Non-Singular (Matrix is Invertible)
|A| = 1·M1(-24) − 2·M2(-20) + 3·M3(-5)

What Matrix Determinant Calculator (2×2 to 5×5) Does

The determinant compresses an entire square matrix into one number, and that number answers a surprisingly useful question: does this transformation preserve information? If the determinant is anything other than zero, the matrix can be inverted and the transformation undone. If it is zero, the matrix has collapsed space and the operation cannot be reversed.

Geometrically it is a scaling factor. A 2×2 matrix with determinant 3 triples areas; a 3×3 with determinant 3 triples volumes. A negative determinant means the transformation also flips orientation, turning a left-handed arrangement into a right-handed one. And a determinant of zero means the output has been flattened into a lower dimension — a plane squashed onto a line, a volume onto a plane — which is exactly why nothing can be recovered from it.

Computing it is mechanical. For 2×2 it is ad − bc. For anything larger, expand along a row: multiply each entry by the determinant of the smaller matrix left when you delete its row and column, and alternate the signs. A 5×5 breaks into five 4×4s, each into four 3×3s, and so on down.

One implementation detail matters more than it sounds. This calculator uses that exact cofactor expansion rather than the numerical elimination methods a larger system would use, so integer matrices produce integer determinants. A singular matrix reads 0 rather than 1.1 × 10⁻¹⁶, which is the difference between a clear answer and a confusing one when the whole question is whether the determinant is zero.

How to Use Matrix Determinant Calculator (2×2 to 5×5)

  1. Select matrix size (2×2 or 3×3)
  2. Enter numerical values into each matrix grid cell
  3. Review computed determinant value, algebraic expansion formula, and invertibility status

Formula Used by Matrix Determinant Calculator (2×2 to 5×5)

2×2 — the base case

|A| = ad − bc

a, b
Top row of the matrix
c, d
Bottom row

Worked example

[[1, 2], [3, 4]]

  1. (1 × 4) = 4
  2. (2 × 3) = 6
  3. 4 − 6

Result: −2 — negative, so the transformation flips orientation as well as scaling area by 2

Cofactor expansion — any size

|A| = Σ (−1)ʲ · a₁ⱼ · |Mⱼ|, expanding along the first row

a₁ⱼ
The j-th entry of the first row
Mⱼ
The minor — the matrix left after deleting row 1 and column j
(−1)ʲ
The alternating sign pattern: +, −, +, −, …

Worked example

[[1, 2, 3], [0, 1, 4], [5, 6, 0]]

  1. +1 × |[[1,4],[6,0]]| = 1 × (0 − 24) = −24
  2. −2 × |[[0,4],[5,0]]| = −2 × (0 − 20) = +40
  3. +3 × |[[0,1],[5,6]]| = 3 × (0 − 5) = −15
  4. −24 + 40 − 15

Result: 1 — non-zero, so this matrix is invertible

Triangular matrices — the shortcut

|A| = product of the diagonal entries, when everything above or below the diagonal is zero

Triangular
All entries on one side of the main diagonal are zero

Worked example

[[2,1,1,1], [0,3,1,1], [0,0,4,1], [0,0,0,5]]

  1. Every cofactor term below the diagonal contributes zero
  2. 2 × 3 × 4 × 5

Result: 120 — which is why elimination methods reduce to triangular form first

What the determinant tells you

The sign and magnitude both carry meaning, and zero is a qualitatively different answer rather than just a small one.

DeterminantGeometricallyAlgebraically
PositiveScales by that factor, orientation preservedInvertible; the system has one unique solution
NegativeScales by the magnitude, orientation reversedInvertible; rows have been effectively swapped an odd number of times
Exactly 1Volume preserved exactlyA rotation or shear; the inverse has determinant 1 too
ZeroCollapses space to a lower dimensionSingular — no inverse, rows linearly dependent, system has no unique solution

Verified examples across sizes

Computed by exact cofactor expansion. Note that the 4×4 of consecutive integers is singular — its rows form an arithmetic progression, so they are linearly dependent.

MatrixSizeDeterminantInvertible?
[[1,2],[3,4]]2×2−2Yes
[[1,2,3],[0,1,4],[5,6,0]]3×31Yes
[[1,2,3],[1,2,3],[4,5,6]]3×30No — duplicate rows
[[1..4],[5..8],[9..12],[13..16]]4×40No — rows in arithmetic progression
[[2,1,1,1],[0,3,1,1],[0,0,4,1],[0,0,0,5]]4×4120Yes — triangular, 2·3·4·5
diag(1,2,3,4,5)5×5120Yes — diagonal product

Properties worth knowing

These let you reason about a determinant without recomputing it, and are what make elimination methods work.

OperationEffect on the determinant
Swap two rowsSign flips
Multiply a row by kDeterminant multiplies by k
Add a multiple of one row to anotherUnchanged — this is why elimination is safe
Transpose the matrixUnchanged
Two identical rows, or a row of zerosDeterminant is zero
Multiply two matrices|AB| = |A| × |B|
Invert a matrix|A⁻¹| = 1 ÷ |A|

How to Read Your Result

Zero is a different kind of answer

A determinant of 0.0001 and a determinant of exactly 0 mean qualitatively different things: the first is invertible and the second is not. That is why exactness matters here in a way it rarely does elsewhere. Numerical methods that reduce a matrix by elimination accumulate rounding error and can return 1e-16 for a genuinely singular matrix, leaving you unsure which side of the line you are on. Cofactor expansion on integer inputs has no such ambiguity.

Why the signs alternate

The plus-minus-plus pattern is not arbitrary bookkeeping. It comes from the formal definition of the determinant as a sum over permutations, where each term carries the sign of its permutation. Deleting a row and column to form a minor shifts the permutation parity by one each time you move along the row, which is exactly what the alternating sign compensates for. Forgetting it is the single most common hand-calculation error.

The row-addition property is the whole basis of elimination

Adding a multiple of one row to another leaves the determinant completely unchanged. That is a remarkable license: it means you can freely reduce a matrix toward triangular form, where the determinant is just the diagonal product, without disturbing the answer. Row swaps flip the sign and scaling a row scales the result, so those two need tracking, but the workhorse operation is free.

Why cofactor expansion does not scale

The recursion cost grows as n factorial. A 5×5 needs about 120 elementary operations, which is nothing. A 20×20 would need on the order of 2.4 × 10¹⁸, which is why no serious numerical library uses this method. LU decomposition does the same job in roughly n³ operations — about 8,000 for a 20×20. The trade-off is exactness for speed, and below 5×5 there is no reason not to take the exact answer.

Determinants and linear systems

Cramer's rule expresses the solution of a linear system directly as ratios of determinants, which is elegant and almost never used in practice because it needs n+1 determinant evaluations. What survives is the test: a non-zero determinant means the system has exactly one solution, and a zero determinant means it has none or infinitely many. Checking the determinant first tells you which case you are in before attempting to solve.

Limitations & Accuracy Notes

  • Sizes from 2×2 to 5×5 are supported. Cofactor expansion grows factorially, so larger matrices need LU decomposition or a similar numerical method rather than this approach.
  • Only square matrices have determinants. A non-square matrix has no determinant at all, though related quantities such as rank and singular values exist.
  • Entries must be numeric. Symbolic matrices with variables in them — a common request for characteristic polynomials — need a computer algebra system, which is what Symbolab and Wolfram Alpha provide.
  • Non-integer entries reintroduce floating-point error, so a determinant that should be exactly zero may display as a very small number when the inputs are decimals.
  • The determinant answers whether a matrix is invertible, not how well-conditioned it is. A matrix can have a non-zero determinant and still be numerically fragile to invert; the condition number is the measure for that.

Frequently Asked Questions

What is a determinant?
A single number computed from a square matrix that captures how the matrix transforms space. Geometrically it is the factor by which area (in 2D) or volume (in 3D) is scaled: a determinant of 3 means the transformation triples volumes, and a negative determinant means orientation is flipped as well. A determinant of zero means the transformation collapses space into a lower dimension.
What does a determinant of zero mean?
The matrix is singular — it has no inverse, its rows and columns are linearly dependent, and any linear system built on it has either no solution or infinitely many rather than exactly one. Geometrically the transformation flattens space, so volume goes to zero and the operation cannot be undone. The matrix [[1,2,3],[1,2,3],[4,5,6]] has determinant 0 because its first two rows are identical.
How do you find the determinant of a 3×3 matrix?
Expand along the first row: multiply each entry by the determinant of the 2×2 matrix left when you delete its row and column, then alternate the signs — plus, minus, plus. For [[1,2,3],[0,1,4],[5,6,0]] that gives 1(1·0 − 4·6) − 2(0·0 − 4·5) + 3(0·6 − 1·5) = −24 + 40 − 15 = 1.
Does this handle 4×4 and 5×5 matrices?
Yes. The same cofactor expansion applies at any size, recursing down through smaller minors — a 5×5 breaks into five 4×4 determinants, each of which breaks into four 3×3s. It is computed exactly rather than numerically, so integer matrices give integer answers and a singular matrix returns a clean 0 instead of a tiny floating-point residue.
Why is a triangular determinant just the diagonal product?
Because every cofactor term below the diagonal contributes zero. For an upper triangular matrix such as [[2,1,1,1],[0,3,1,1],[0,0,4,1],[0,0,0,5]] the determinant is simply 2×3×4×5 = 120. This is why elimination methods reduce a matrix to triangular form first — once there, the determinant is a single multiplication down the diagonal.
What does a determinant actually mean?
Geometrically, the factor by which the matrix scales area in two dimensions or volume in three. A determinant of 3 means the transformation triples area; a negative one means it also flips orientation.
What does a determinant of zero tell me?
That the matrix is singular and has no inverse. Geometrically the transformation collapses space into a lower dimension — a plane squashed onto a line — and that cannot be undone, which is exactly why no inverse exists.
How is a 2×2 determinant calculated?
ad − bc for the matrix [[a, b], [c, d]]. Larger matrices use cofactor expansion or row reduction, which is why determinant calculation gets expensive quickly as size grows.
Why does a system of equations have no unique solution when the determinant is zero?
Because the equations are not independent — one is a combination of the others. There is either no solution or infinitely many, and the determinant tells you to expect one of those before you attempt to solve.
Can a determinant be negative?
Yes. The sign indicates whether the transformation preserves or reverses orientation. Absolute value gives the scaling factor; the sign gives the flip.
Is my data stored?
No. The calculation runs in your browser.

References & Further Reading

By OnlineToolHubs Team • September 2026