A determinant condenses an entire square matrix down to a single number, and that number answers one of the most useful questions in linear algebra: does this matrix have an inverse? This calculator walks through the cofactor-expansion method used to compute a determinant by hand for a 2×2, 3×3, or 4×4 matrix, showing every signed term along the way.

How cofactor expansion works

Cofactor (Laplace) expansion computes a determinant by picking a row — this calculator always uses row 1 — and, for each entry in that row, multiplying it by the determinant of its minor (the matrix left after deleting that entry's row and column), with alternating signs starting at +. For a 2×2 matrix the process collapses to the single formula ad − bc. For 3×3, each of the three entries in row 1 is multiplied by the determinant of its 2×2 minor. For 4×4, each of the four entries is multiplied by the determinant of its 3×3 minor, which the calculator computes directly. Summing the signed terms gives the final determinant.

What a zero determinant means

A determinant of exactly 0 means the matrix is singular: its rows (or columns) are linearly dependent — one row can be written as a combination of the others, so the matrix squashes space into a lower dimension instead of stretching it into a full n-dimensional shape. Singular matrices have no inverse, and if the matrix represents a system of linear equations, that system either has no solution at all or has infinitely many. Any nonzero determinant, by contrast, means the matrix is invertible — a unique inverse A⁻¹ exists such that A · A⁻¹ gives the identity matrix.

Reading the sign pattern

The alternating + and − signs in cofactor expansion follow a checkerboard pattern: the sign of the cofactor for row i, column j is (−1) raised to the power (i + j). Since this calculator always expands along row 1 (i = 1), the signs simply alternate +, −, +, − across the columns. That pattern is why the middle term of a 3×3 expansion is always subtracted while the first and third are added — it isn't arbitrary, it falls directly out of the (−1)^(i+j) rule.