Matrix Determinant Calculator

Calculate the determinant of a square matrix (2×2 up to 5×5) using cofactor expansion.

Formula

2×2: det(A) = a₁₁a₂₂ − a₁₂a₂₁

n×n (cofactor / Laplace expansion along row 1):

det(A) = Σj=1..n (−1)1+j · a1j · det(M1j)

where M1j is the (n−1)×(n−1) minor obtained by deleting row 1 and column j.

3×3 (Sarrus' rule):
det(A) = a₁₁(a₂₂a₃₃−a₂₃a₃₂) − a₁₂(a₂₁a₃₃−a₂₃a₃₁) + a₁₃(a₂₁a₃₂−a₂₂a₃₁)

Assumptions & References

  • The matrix must be square (n×n). Non-square matrices have no determinant.
  • Entries may be any real number (integers or decimals).
  • A determinant of 0 means the matrix is singular: it has no inverse and its rows/columns are linearly dependent.
  • Computation uses recursive cofactor (Laplace) expansion — exact for exact integer inputs, subject to floating-point rounding for large decimals.
  • Supported sizes: 2×2 through 5×5. For larger matrices, numerical methods (LU decomposition) are preferred.
  • Reference: Lay, D.C. Linear Algebra and Its Applications, 5th ed., §3.1–3.2.

In the network