Mathematics · Algebra & Calculus
Matrix Determinant Calculator
Calculate the determinant of a 2×2 or 3×3 matrix using cofactor expansion with step-by-step results.
Calculator
Formula
For a 2×2 matrix with elements a, b, c, d: det = ad − bc. For a 3×3 matrix with rows [a,b,c], [d,e,f], [g,h,i]: det = a(ei−fh) − b(di−fg) + c(dh−eg), computed via cofactor (Laplace) expansion along the first row.
Source: Strang, G. (2016). Introduction to Linear Algebra, 5th ed. Wellesley-Cambridge Press. §5.1.
How it works
For a 2×2 matrix with entries [[a, b], [c, d]], the determinant is computed by the Leibniz formula: det(A) = ad − bc. This formula captures the signed area of the parallelogram formed by the two row vectors. If det(A) ≠ 0, the matrix is invertible (non-singular), meaning the linear transformation it represents is bijective and preserves or reverses orientation without collapsing space into a lower dimension.
For a 3×3 matrix with rows [a, b, c], [d, e, f], [g, h, i], the determinant is computed by cofactor (Laplace) expansion along the first row: det(A) = a(ei − fh) − b(di − fg) + c(dh − eg). Each term is the product of a first-row element and the determinant of the 2×2 submatrix (minor) obtained by deleting that element's row and column, multiplied by the appropriate sign (+, −, +). This recursive structure is the foundation of all determinant computation algorithms, including LU decomposition used in numerical linear algebra.
The determinant carries deep geometric meaning: for a 2×2 matrix, |det(A)| equals the area of the parallelogram spanned by its rows; for a 3×3 matrix, |det(A)| equals the volume of the parallelepiped. A determinant of zero signals that the rows (or columns) are linearly dependent — the matrix maps n-dimensional space into a subspace of lower dimension, making the transformation non-invertible. The sign of the determinant indicates whether the transformation preserves (+) or reverses (−) orientation.
Worked example
Example 1 — 2×2 Matrix: Given the matrix [[3, 8], [4, 6]], we compute the determinant as follows:
det = (3 × 6) − (8 × 4) = 18 − 32 = −14.
Since det ≠ 0, the matrix is invertible. The negative value indicates the transformation reverses orientation, and the corresponding parallelogram has area |−14| = 14 square units.
Example 2 — 3×3 Matrix: Given the matrix [[2, −1, 3], [0, 4, −2], [1, 5, 6]], expand along the first row:
det = 2 × det([[4, −2], [5, 6]]) − (−1) × det([[0, −2], [1, 6]]) + 3 × det([[0, 4], [1, 5]])
= 2 × (4×6 − (−2)×5) + 1 × (0×6 − (−2)×1) + 3 × (0×5 − 4×1)
= 2 × (24 + 10) + 1 × (0 + 2) + 3 × (0 − 4)
= 2 × 34 + 1 × 2 + 3 × (−4)
= 68 + 2 − 12 = 58.
The volume of the parallelepiped spanned by the three row vectors is 58 cubic units, and the transformation is invertible.
Limitations & notes
This calculator is designed for 2×2 and 3×3 matrices only. For larger matrices (4×4 and beyond), cofactor expansion becomes computationally prohibitive — an n×n determinant via naive expansion requires O(n!) operations — and numerical methods such as LU decomposition or Gaussian elimination with partial pivoting are used instead. Additionally, floating-point inputs may introduce rounding errors for very large or very small numbers; for exact symbolic computation, a computer algebra system (CAS) such as Wolfram Alpha, MATLAB's det() function, or Python's numpy.linalg.det() is recommended. The calculator also does not currently handle complex-number matrix entries.
Frequently asked questions
What does a determinant of zero mean?
A determinant of zero means the matrix is singular — its rows (or columns) are linearly dependent, and the matrix cannot be inverted. Geometrically, the transformation collapses n-dimensional space into a subspace of lower dimension: a 2×2 singular matrix flattens the plane into a line or point, and a 3×3 singular matrix collapses 3D space into a plane, line, or point.
Does the order of rows matter for the determinant?
Yes. Swapping any two rows of a matrix changes the sign of the determinant but not its absolute value. If you swap rows twice, the sign returns to the original. This property is one of the three axiomatic properties of the determinant (multilinearity, alternating sign, and normalization) and underpins Gaussian elimination algorithms.
Can the determinant be negative, and what does that mean?
Absolutely — a negative determinant is perfectly valid. It indicates that the linear transformation represented by the matrix reverses orientation: in 2D, it reflects the plane (like flipping a transparency sheet), and in 3D, it converts a right-handed coordinate system into a left-handed one. The absolute value still gives the area or volume scaling factor.
How is the determinant used in solving systems of linear equations?
The determinant is central to Cramer's Rule, which provides an explicit formula for the solution of a system Ax = b: each variable xᵢ equals the determinant of a modified matrix (with the i-th column replaced by b) divided by det(A). If det(A) = 0, the system either has no solution or infinitely many solutions. While Cramer's Rule is elegant for 2×2 and 3×3 systems, Gaussian elimination is far more efficient for larger systems.
What is the relationship between the determinant and eigenvalues?
The determinant of a square matrix equals the product of all its eigenvalues (counting multiplicity). This means det(A) = 0 if and only if at least one eigenvalue is zero, confirming the matrix is singular. The characteristic polynomial det(A − λI) = 0 is the equation whose roots are the eigenvalues, directly connecting determinants to the spectral theory of linear operators.
Last updated: 2025-01-15 · Formula verified against primary sources.