Determinant Calculator with Step-by-Step Expansion

Calculate a 2×2 through 5×5 determinant by cofactor expansion. Choose the first row, inspect every signed minor, and keep all matrix values in your browser.

Enter a Square Matrix

Enter integers, decimals, or scientific notation. Display precision does not round intermediate calculations.

Put rows on separate lines and separate values with spaces, commas, or tabs. A valid pasted 2×2 through 5×5 matrix changes the size automatically.

Determinant

Enter a valid square matrix to calculate det(A).
Expansion preview

Choose a row and calculate to see its alternating signs and cofactor contributions.

Advertisement

Step-by-Step Cofactor Expansion

The selected row is used first. Inside each minor, the calculator chooses a row with the most zeros; open a contribution to follow that recursive expansion.

Calculate a valid matrix to see every minor and signed contribution.

Determinant and Cofactor Formulas

2×2 determinant

|a b; c d| = ad − bc

Multiply the main diagonal, subtract the product of the other diagonal.

Minor and cofactor

Cᵢⱼ = (−1)ⁱ⁺ʲ det(Mᵢⱼ)

Mᵢⱼ is formed by deleting row i and column j. Here the displayed indices start at 1.

Expansion along row i

det(A) = Σⱼ aᵢⱼ Cᵢⱼ

The sign pattern alternates like a checkerboard, beginning with plus at position (1,1).

Numerical convention: Calculations use JavaScript double-precision floating-point arithmetic. Each input must be finite and no greater than 10⁵⁰ in magnitude. The chosen decimal places affect display only, and tiny cancellation residue may appear for decimal matrices.

How to Use the Determinant Calculator

  1. Choose a matrix size and enter every value, or paste a complete square matrix.
  2. Choose the row used for the first expansion. A row with several zeros produces fewer nonzero terms.
  3. Select Calculate determinant to see the final value and top-level expansion.
  4. Open each nonzero contribution to trace its minor determinant down to 2×2 arithmetic, then copy or download the full working.

Worked 3×3 Determinant Example

For A = [[2,−3,1],[2,0,−1],[1,4,5]], expanding along row 1 gives:

det(A) = 2(0·5 − (−1)·4) − (−3)(2·5 − (−1)·1) + 1(2·4 − 0·1) = 49

Zero terms save work

If an expansion entry is zero, its entire contribution is zero, so that minor determinant does not need to be evaluated.

Changing the row

Expanding the same matrix along row 2 or row 3 rearranges the arithmetic but still gives 49.

What the Determinant Tells You

The absolute determinant is the factor by which a linear transformation scales area in two dimensions or volume in three dimensions. Its sign records orientation. A determinant of zero means the transformation collapses at least one dimension, so the matrix is singular and has no inverse.

Cofactor expansion is especially useful for learning, proofs, and matrices with many zeros. For large dense matrices, elimination-based methods such as LU decomposition are usually more efficient.

Determinant Calculator FAQs

What is a matrix determinant?

It is a single number defined for a square matrix. It describes signed scaling and helps determine whether the matrix is invertible.

What is cofactor expansion?

It expresses a determinant as a sum of entries from one row or column, each multiplied by its alternating sign and minor determinant.

Can I expand along any row?

Yes. Every row and every column produces the same determinant. Choosing a row or column with many zeros usually shortens the work.

What does a zero determinant mean?

The rows or columns are linearly dependent, the matrix has no inverse, and the corresponding transformation collapses space into a lower dimension.

Why is the calculator limited to 5×5?

Recursive cofactor expansion grows very quickly. The limit keeps the complete step-by-step tree usable; elimination-based methods are better suited to larger dense matrices.

Why is a decimal result sometimes extremely close to zero instead of zero?

Binary floating-point cannot represent every decimal exactly, and subtraction can expose a small rounding residue. Increase or decrease displayed precision according to the accuracy of the inputs.

Are my matrix entries private?

Yes. This page performs parsing, calculation, copying, and file creation locally. Its calculator code does not transmit or store your entries.

Calculation Notes

Last reviewed: August 4, 2026 by the Starlight Tools editorial team.

The calculator performs literal recursive cofactor expansion, skipping branches whose coefficient is exactly zero. It does not round intermediate values. Results for ill-conditioned decimal matrices should be interpreted at the precision justified by the input data.

Explore more tools