Matrix Determinant Calculator

Find the determinant of any 2×2 to 6×6 matrix with full step-by-step working.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

A matrix determinant calculator that handles 2×2 through 6×6 matrices and shows you every step of the computation, not just the final number. Built for students tackling linear algebra, engineers checking system solvability, and anyone who wants to understand exactly why a determinant has the value it does.

How it works

The calculator uses Gaussian elimination with partial pivoting — the standard numerically stable algorithm for computing determinants.

Starting from the original matrix A, the algorithm:

  1. Finds the largest absolute value in the current column (the pivot) and swaps it into the leading position. Each swap multiplies the determinant by −1, so the algorithm tracks a sign variable.
  2. Subtracts a scalar multiple of the pivot row from every row below it, driving those column entries to zero. These row-addition operations do not change the determinant.
  3. Repeats for the next column until the matrix is upper-triangular (U).
  4. Computes the determinant as:

det(A) = sign × U[1,1] × U[2,2] × … × U[n,n]

where sign is +1 or −1 depending on how many row swaps were needed.

If any diagonal entry of U is zero (after pivoting), the matrix is singular and det = 0. The calculator reports this immediately and stops eliminating further.

Why Gaussian elimination rather than cofactor expansion?

Cofactor expansion along a row or column is the formula you often see first in textbooks. For a 3×3 matrix it is perfectly practical — six multiplications — but for a 5×5 matrix it requires 120 multiplications and for 6×6 it reaches 720. Gaussian elimination is O(n³): a 6×6 needs at most ~72 multiply–add pairs. More importantly, partial pivoting keeps the arithmetic numerically stable, whereas cofactor expansion on an ill-conditioned matrix can accumulate large cancellation errors.

Worked example — 3×3 matrix

Take the matrix:

A = | 2  -1   3 |
    | 4   5  -2 |
    | 1   3   7 |

Step 1 — Identify pivot in column 1. Largest absolute value is 4 (row 2). Swap rows 1 and 2; sign flips to −1.

→ | 4   5  -2 |
  | 2  -1   3 |
  | 1   3   7 |

Step 2 — Eliminate below pivot 4.

  • R2 ← R2 − (2/4)·R1 = R2 − 0.5·R1
  • R3 ← R3 − (1/4)·R1 = R3 − 0.25·R1
→ | 4   5   -2  |
  | 0  -3.5  4  |
  | 0   1.75  7.5|

Step 3 — Pivot in column 2: −3.5 (row 2). No swap needed.

Step 4 — Eliminate R3 below pivot −3.5.

  • R3 ← R3 − (1.75/−3.5)·R2 = R3 + 0.5·R2
U = | 4   5   -2  |
    | 0  -3.5   4  |
    | 0   0    9.5 |

Step 5 — Final answer. det(A) = sign × 4 × (−3.5) × 9.5 = −1 × (−133) = 133

You can verify: 133 ≠ 0, so A is invertible and full-rank.

Matrix typedetInvertible?
Identity n×n1Yes
Singular (rows/cols linearly dependent)0No
Orthogonal rotation matrix±1Yes
Scaled identity k·IkⁿYes (if k ≠ 0)

Formula note

The relationship det(AB) = det(A) · det(B) holds for all square matrices of the same size. This means the determinant is a multiplicative homomorphism from the group of invertible matrices to the non-zero reals — a core reason it appears throughout group theory, differential geometry, and multivariate calculus (the Jacobian determinant governs how integration measures transform).

Ad placeholder (rectangle)