Cofactor (Laplace) expansion is the general-purpose method for computing a matrix determinant by hand: pick any row or column, multiply each entry by its signed minor determinant, and add up the results. This calculator lets you pick that row or column yourself for a 3×3 or 4×4 matrix, then shows every minor, every cofactor, and the fully substituted equation — the same worked steps a linear algebra course would expect you to write out.

How cofactor expansion works

Choose a row (or column) to expand along. For each entry in that row, delete its row and column from the matrix to get a smaller "minor" matrix, then take that minor's determinant. Multiply the entry by its minor's determinant and by an alternating sign (+, −, +, − in a checkerboard pattern based on position), then add all of those signed products together. The result is the determinant of the whole matrix — and it comes out identical no matter which row or column you pick.

For a 4×4 matrix, each minor is itself a 3×3 matrix, so the calculator computes that smaller determinant directly before combining it into the top-level sum. The Expansion Steps tab shows the formula, the substituted numbers, and the running total that adds up to the final answer.

Inputs and what they mean

Choose a matrix size (3×3 or 4×4), fill in the grid with any real numbers, then pick a row or column from the Expand Along selector. There's no unit conversion involved — the calculator works on the numbers exactly as entered. Use the preset buttons to load the identity matrix, a worked example, or a blank grid to start from scratch.

Why the row or column choice matters (and doesn't)

Mathematically, every row and column gives the exact same determinant — that's a core property of cofactor expansion. Practically, though, some choices are much faster to compute by hand: a row or column with more zero entries means more of the cofactor terms vanish automatically, since anything multiplied by zero contributes nothing to the sum. Try switching the Expand Along selector between a zero-heavy row and a row full of nonzero numbers to see the arithmetic shrink.

Limits and edge cases

This calculator supports 3×3 and 4×4 matrices only. For a determinant computed with one fixed method plus a singular/invertible check, see the Matrix Determinant Calculator; for the inverse via the adjugate (cofactor matrix) method, see the Matrix Inverse Calculator; for larger matrices or Gauss-Jordan row reduction, use the general Matrix Calculator.