Matrix Determinant Calculator 2x2, 3x3 and Cramer's Rule

Compute the determinant of 2×2 and 3×3 matrices, the trace, and solve linear systems with Cramer's rule. Includes Sarrus rule and Laplace cofactor expansion.

Calculation parameters
Was this calculator useful?

Determinant of a square matrix

The determinant is a scalar associated with a square matrix that encodes key geometric and algebraic information. Written det(A), |A| or Δ. Geometrically, the determinant is the signed area of the parallelogram spanned by the rows (or columns) in 2D, the signed volume of the parallelepiped in 3D, and in general the volume scaling factor of the associated linear transformation. A zero determinant means the matrix is singular: not invertible, rows linearly dependent, and the transformation collapses space onto a lower-dimensional subspace.

2×2 determinant

For A = [[a, b], [c, d]]: det(A) = ad − bc. Examples: det([[3, 2], [1, 4]]) = 10; det([[2, 4], [1, 2]]) = 0 (singular, proportional rows). Geometrically, |det| is the area of the parallelogram spanned by the columns u = (a, c) and v = (b, d); the sign indicates orientation.

3×3 determinant (Sarrus's rule)

For A = [[a₁₁, a₁₂, a₁₃], [a₂₁, a₂₂, a₂₃], [a₃₁, a₃₂, a₃₃]], Sarrus's rule gives det(A) = a₁₁a₂₂a₃₃ + a₁₂a₂₃a₃₁ + a₁₃a₂₁a₃₂ − a₁₃a₂₂a₃₁ − a₁₁a₂₃a₃₂ − a₁₂a₂₁a₃₃. Remembered by duplicating the first two columns on the right and summing products of the three descending diagonals minus the three ascending ones. det(I₃) = 1.

Laplace (cofactor) expansion

For any order, use the Laplace expansion along a row or column: det(A) = Σⱼ(−1)^(i+j) · a_{ij} · M_{ij}, where M_{ij} is the minor (det of the submatrix after removing row i and column j). First-row expansion of a 3×3: det = a₁₁(a₂₂a₃₃ − a₂₃a₃₂) − a₁₂(a₂₁a₃₃ − a₂₃a₃₁) + a₁₃(a₂₁a₃₂ − a₂₂a₃₁).

Determinant properties

  • det(I) = 1.
  • det(AB) = det(A)·det(B) (Binet's theorem).
  • det(Aᵀ) = det(A).
  • det(A⁻¹) = 1/det(A) when A is invertible.
  • Swapping two rows flips the sign.
  • Multiplying a row by k multiplies det by k. So det(kA) = k^n·det(A).
  • Linearly dependent rows → det = 0.
  • Adding a multiple of one row to another leaves det unchanged (basis for Gaussian elimination).

Cramer's rule

Cramer's rule solves square linear systems A·x = b with non-zero determinant. The i-th component is x_i = det(A_i) / det(A), where A_i is A with its i-th column replaced by b. Only valid when det(A) ≠ 0 (unique solution). 2×2 example: 2x + y = 5, x + 3y = 8 → det = 5; x = 7/5 = 1.4; y = 11/5 = 2.2.

When is Cramer efficient?

Elegant for theory but computationally inefficient for large n: n+1 determinants of order n, each O(n³), total O(n^4) versus O(n³) for Gaussian elimination. Prefer Gauss, LU or QR for n ≥ 4. Cramer is still useful for 2×2, 3×3 and symbolic solutions in physics/engineering.

How to use

Four modes: 2×2 determinant; 3×3 determinant; Cramer 2×2; Cramer 3×3. Calculator returns determinant (or solution), trace (sum of diagonal) and flags singular matrices. Integers, decimals and negatives accepted.

Geometric interpretations

The determinant is the volume scaling factor of the linear transformation. |det| > 1 expands, |det| < 1 contracts, = 1 preserves (isometric or unit-volume). Rotation matrices: det = +1; reflections: det = −1; projections: det = 0. In physics, the Jacobian determinant appears in multivariable integration: ∫f dV = ∫f(g(u,v,w))·|J| du dv dw.

Determinant, eigenvalues and the characteristic polynomial

The determinant and the trace are the two coefficients of the characteristic polynomial of a 2×2 matrix: λ² − tr(A)λ + det(A) = 0. The eigenvalues are its roots, so their sum equals the trace and their product equals the determinant. This link makes the two numbers reported by the calculator a quick diagnostic tool: a zero determinant means at least one eigenvalue is zero, while a negative determinant of a 2×2 matrix guarantees two real eigenvalues of opposite sign — a saddle point in dynamical-systems language.

Practical applications

Determinants appear wherever linear systems do: in circuit analysis (mesh and nodal equations), in structural engineering (stiffness matrices), in computer graphics (testing whether a transformation flips orientation), and in economics (Jacobians of equilibrium models). Cramer's rule, published by Gabriel Cramer in 1750, is still the standard closed-form solution for the small 2×2 and 3×3 systems handled by this calculator.

Updated July 2026

Frequently Asked Questions

How do you compute the determinant of a 2×2 matrix?

For a matrix [[a,b],[c,d]] the determinant is ad − bc: the product of the main diagonal minus the product of the anti-diagonal. For [[3,1],[2,4]] you get 3·4 − 1·2 = 10. A result of 0 means the matrix is singular and has no inverse, so the associated system has no unique solution.

What is Sarrus' rule and when can it be used?

Sarrus' rule is a mnemonic scheme valid only for 3×3 matrices: copy the first two columns to the right, add the products of the three descending diagonals and subtract the ascending ones. It does not extend to 4×4 or larger matrices, where Laplace expansion or Gaussian elimination is required.

When does Cramer's rule fail?

Cramer's rule requires the coefficient matrix to have a nonzero determinant. If det = 0 the system has no unique solution: it is either inconsistent or has infinitely many solutions. The calculator flags this case and marks the matrix as singular instead of dividing by zero.

What does it mean for a matrix to be singular?

A matrix is singular when its determinant is zero: its rows (or columns) are linearly dependent, it has no inverse, and the associated transformation collapses space onto a lower dimension. The calculator uses the numerical threshold |det| < 10⁻¹² to flag near-zero determinants.

What is the geometric meaning of the determinant?

The absolute value of the determinant is the scaling factor of areas (2×2) or volumes (3×3) under the linear map: |det| = 2 doubles volumes. The sign encodes orientation: positive preserves it, negative flips it, as with reflections (det = −1). Rotations always have det = +1.

What is the trace and how is it related to the determinant?

The trace is the sum of the main-diagonal entries and equals the sum of the eigenvalues, while the determinant is their product. For a 2×2 matrix the characteristic polynomial is λ² − tr(A)λ + det(A), so trace and determinant together give the eigenvalues directly.

Should Cramer's rule be used for large systems?

No: its cost grows factorially, and beyond 3–4 unknowns Gaussian elimination is far more efficient and numerically stable. Cramer's rule remains valuable for teaching and for closed-form solutions of 2×2 and 3×3 systems, which are exactly the cases this calculator handles.

Comments (0)

No comments yet. Be the first!