What Is a Matrix Determinant?
The determinant is a single scalar value associated with every square matrix. Written det(A) or |A|, it encodes crucial geometric and algebraic information about the matrix. Geometrically, |det(A)| is the factor by which A scales volumes: a 2×2 matrix with det = 3 expands areas by 3, while det = −2 flips orientation and doubles areas.
Algebraically, det(A) ≠ 0 is exactly the condition for A to be invertible. A zero determinant means the matrix is singular — its rows are linearly dependent, the linear system Ax = b may be inconsistent, and no inverse exists.
Key determinant properties:
- det(AB) = det(A) · det(B) — multiplicativity (use the matrix multiplication calculator to form AB before computing its determinant)
- det(Aᵀ) = det(A) — transpose preserves the determinant
- det(A⁻¹) = 1/det(A)
- det(kA) = kⁿ det(A) for an n×n matrix scaled by k
- Swapping two rows multiplies det by −1
- Scaling a row by c multiplies det by c
- Adding a multiple of one row to another does not change det
How This Calculator Computes Determinants
This calculator uses cofactor expansion along the first row, also called Laplace expansion. For an n×n matrix A, the determinant is:
where M₁ⱼ is the (n−1)×(n−1) minor obtained by deleting row 1 and column j. This recursion bottoms out at 2×2 matrices, which are computed directly as ad − bc. All arithmetic uses BigInt-based exact rational numbers — no floating-point approximation.
For sparse matrices (many zeros), cofactor expansion is especially efficient because terms with a₁ⱼ = 0 contribute nothing and can be skipped. For dense matrices, row reduction is more efficient — but since our matrices top out at 5×5 here, cofactor expansion shows every step clearly.
Worked Example 1: 2×2 Determinant
For A = [[3, −2], [1, 4]]:
Since det = 14 ≠ 0, A is invertible. The transformation scales areas by a factor of 14.
Worked Example 2: 3×3 Determinant (Cofactor Expansion)
For A = [[2, −1, 0], [3, 1, 2], [−1, 4, 3]]:
det(A) = 2 · det([[1,2],[4,3]]) − (−1) · det([[3,2],[−1,3]]) + 0 · det([[3,1],[−1,4]])
= 2(3−8) + 1(9+2) + 0
= 2(−5) + 11
= −10 + 11 = 1
det = 1, so the transformation preserves volume exactly and the matrix is invertible.
Worked Example 3: Singular Matrix (det = 0)
For A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] (the "rank 2" matrix that appears in many textbooks):
det(A) = 1 · det([[5,6],[8,9]]) − 2 · det([[4,6],[7,9]]) + 3 · det([[4,5],[7,8]])
= 1(45−48) − 2(36−42) + 3(32−35)
= −3 + 12 − 9 = 0
det = 0 because row 3 = row 1 + row 2. The matrix is singular — it has no inverse and rank 2 (not 3).
Determinant vs. Trace: Two Key Scalar Invariants
Every square matrix has two fundamental scalar invariants: the determinant and the trace (sum of diagonal entries). Both are unchanged by similarity transformations (changing basis).
For a 2×2 matrix with eigenvalues λ₁ and λ₂: det = λ₁λ₂ and trace = λ₁ + λ₂. This is why the characteristic polynomial p(λ) = λ² − trace·λ + det gives the eigenvalues directly.
The determinant is the product of all eigenvalues; the trace is their sum. This relationship extends to n×n matrices through the coefficients of the characteristic polynomial.
Applications of Determinants
The determinant is one of the most important scalar invariants in linear algebra. For the conceptual foundations — what the determinant means geometrically and how it connects to rank and invertibility — see our linear algebra basics guide. For how determinants appear in the context of solving linear systems (Cramer's rule, checking consistency), see the solving linear systems guide.
Invertibility test. The quickest check for whether a matrix is invertible: compute det. If det = 0, no inverse exists. If det ≠ 0, the matrix is invertible.
Cramer's rule. For the system Ax = b, Cramer's rule gives xᵢ = det(Aᵢ)/det(A), where Aᵢ is A with column i replaced by b. Pedagogically important but computationally inefficient for large systems.
Area and volume. The absolute value of det([[u₁,u₂],[v₁,v₂]]) equals the area of the parallelogram spanned by vectors u and v. For 3D, |det([u,v,w])| gives the volume of the parallelepiped.
Eigenvalues. The eigenvalues of A are the roots of the characteristic polynomial det(A − λI) = 0. Computing the determinant is the first step in finding eigenvalues analytically.
Change of variables in integration. The Jacobian determinant appears in multivariable calculus when substituting variables: ∫∫ f(x,y) dx dy = ∫∫ f(g(u,v)) |det J| du dv.
Computing Determinants via Row Reduction
Cofactor expansion is O(n!) in cost — completely impractical for large matrices. Row reduction to upper triangular form computes the determinant in O(n³) operations, which is how all numerical linear algebra libraries (NumPy, MATLAB, LAPACK) work internally.
Track determinant changes as you row-reduce: adding a multiple of one row to another leaves det unchanged; swapping rows multiplies det by −1; scaling a row by c multiplies det by c. Once you reach upper triangular form U, det(A) equals the product of U's diagonal entries, adjusted for all swaps and scalings applied.
A = [[0,1,2],[3,4,5],[1,0,6]]
Swap R₁↔R₂: factor of −1 → [[3,4,5],[0,1,2],[1,0,6]]
R₃ → R₃ − (1/3)R₁ → [[3,4,5],[0,1,2],[0,−4/3,13/3]]
R₃ → R₃ + (4/3)R₂ → [[3,4,5],[0,1,2],[0,0,7]]
det(A) = (−1) × 3 × 1 × 7 = −21
This determinant calculator uses cofactor expansion to display every term. For larger systems, the RREF calculator uses row reduction internally.
Determinants of Special Matrices
Recognizing special structure lets you read off the determinant immediately:
- Diagonal matrix diag(d₁,…,dₙ): det = d₁·d₂·⋯·dₙ. All off-diagonal cofactors vanish.
- Triangular matrix (upper or lower): det = product of diagonal entries, regardless of off-diagonal values. This is why LU decomposition makes det efficient.
- Orthogonal matrix Q: det(Q) = ±1. Rotations have det = +1; reflections det = −1.
- Block diagonal matrix [[A,0],[0,B]]: det = det(A)·det(B).
- Matrix with two equal rows: det = 0. Swapping them changes sign but leaves the matrix identical, forcing det = −det = 0.
- Rank-deficient matrix: det = 0 always. If the RREF has a zero row, the matrix is singular.
The Characteristic Polynomial and Eigenvalues
The eigenvalues of A are values λ where det(A − λI) = 0. The function p(λ) = det(A − λI) is the characteristic polynomial — a degree-n polynomial whose roots are the eigenvalues.
For a 2×2 matrix A = [[a,b],[c,d]]:
p(λ) = (a−λ)(d−λ) − bc = λ² − trace(A)·λ + det(A)
So det(A) equals the product of all eigenvalues, and trace(A) equals their sum. For A = [[3,1],[2,4]]: det = 10, trace = 7, eigenvalues satisfy λ² − 7λ + 10 = 0 → λ = 2 or 5. Product = 10 ✓, sum = 7 ✓.
A matrix is singular (det = 0) if and only if 0 is an eigenvalue. Use the determinant calculator above to evaluate det(A − λI) for specific λ to find eigenvalues numerically.
Cramer's Rule and the Adjugate Formula
Cramer's rule expresses the solution to Ax = b using determinants: xᵢ = det(Aᵢ)/det(A), where Aᵢ is A with column i replaced by b. While elegant for 2×2 and 3×3 systems, it requires computing n+1 determinants and is impractical for n > 3. Gaussian elimination is far more efficient.
The adjugate formula A⁻¹ = (1/det(A))·adj(A), where adj(A) is the transpose of the cofactor matrix, connects determinants to matrix inversion. For 2×2: A = [[a,b],[c,d]] → A⁻¹ = (1/(ad−bc))·[[d,−b],[−c,a]]. For practical inversion, the matrix inverse calculator uses Gauss-Jordan elimination — significantly faster than the adjugate for matrices larger than 3×3.
Frequently Asked Questions
What does a determinant of 0 mean?
The matrix is singular. Its rows are linearly dependent, it has no inverse, and the linear system Ax = b may have no solution or infinitely many.
Can a determinant be negative?
Yes. A negative determinant means the transformation reverses orientation (like a reflection). The magnitude still represents the volume scaling factor.
Is the determinant of a triangular matrix easy to compute?
Yes — for any triangular matrix (upper or lower), det = product of diagonal entries. This is why Gaussian elimination (which produces an upper triangular matrix) is efficient for determinants.
How does row reduction affect the determinant?
Adding a multiple of one row to another: det unchanged. Scaling a row by c: det multiplies by c. Swapping two rows: det multiplies by −1.
What is the determinant of the identity matrix?
det(I) = 1 for any size. The identity preserves all volumes.
Can I compute det of a non-square matrix?
No. The determinant is only defined for square matrices.
Is det(A + B) = det(A) + det(B)?
No — this formula is false in general. The determinant is multiplicative (det(AB) = det(A)det(B)) but not additive.
Is this calculator free?
Yes, completely free with no account required.