Determinant Calculator - 2x2, 3x3, and 4x4 Cofactor Steps

Determinant calculator that returns the scalar determinant of a 2x2, 3x3, or 4x4 square matrix together with the cofactor expansion steps and a singular-matrix warning when det(A) = 0.

Updated: June 16, 2026 • Free Tool

Determinant Calculator

Pick the matrix size.

Top-left entry of the 2x2 matrix.

Top-right entry of the 2x2 matrix.

Bottom-left entry of the 2x2 matrix.

Bottom-right entry of the 2x2 matrix.

Top-left entry.

Row 1, column 2.

Row 1, column 3.

Row 1, column 4.

Row 2, column 1.

Row 2, column 2.

Row 2, column 3.

Row 2, column 4.

Row 3, column 1.

Row 3, column 2.

Row 3, column 3.

Row 3, column 4.

Row 4, column 1.

Row 4, column 2.

Row 4, column 3.

Row 4, column 4.

Results

Determinant det(A)
0
Sarrus check 0
Cofactor C(1,1) 0
Cofactor C(1,2) 0
Cofactor C(1,3) 0
Cofactor C(1,4) 0
Sum of 3x3 minors 0
Signed area or volume 0
Singular matrix 0

What Is a Determinant Calculator?

A determinant calculator is a tool that returns the scalar determinant of a square matrix for 2x2, 3x3, and 4x4 inputs, with the cofactor expansion steps shown alongside the final number.

  • Linear algebra homework and exams: Verify the determinant of a 2x2, 3x3, or 4x4 matrix without a computer algebra system.
  • Geometry: signed area and volume: Read the signed area of a parallelogram (2x2) or signed volume of a parallelepiped (3x3) from the edge-vector matrix.
  • Singularity and invertibility checks: Decide whether a small linear system is solvable by checking the coefficient-matrix determinant.
  • Computer graphics and robotics: Use the determinant of a 3x3 transform as a quick signed-scale check on a Jacobian or a normal direction.

The determinant is defined by three properties: multilinearity in the columns, sign flip on column swaps, and det(I) = 1. The resulting scalar is the signed n-dimensional volume of the parallelotope spanned by the column vectors.

The recipes the calculator uses are corollaries of those three rules. For 2x2 the ad - bc formula drops out directly. For 3x3 the Sarrus pattern is a quick closed form. For 4x4 the calculator uses the Laplace cofactor expansion along the first row.

When the determinant is followed by a cofactor expansion to find the inverse, the adjoint matrix calculator is the natural next step on the same cofactor backbone.

How the Determinant Calculator Works

The calculator reads the matrix size, collects the entries, and walks the determinant recipe in order: the 2x2 ad - bc rule, the 3x3 Sarrus expansion, or the 4x4 Laplace cofactor expansion.

det([[a, b], [c, d]]) = a*d - b*c; det([[a, b, c], [d, e, f], [g, h, i]]) = a(ei - fh) - b(di - fg) + c(dh - eg); for n = 4, det is a Laplace cofactor expansion along the first row with 3x3 minors computed by Sarrus
  • A: The input square matrix of size 2x2, 3x3, or 4x4 with real entries.
  • M_1j: The (1, j) minor of a 4x4 matrix: the determinant of the 3x3 submatrix obtained by deleting row 1 and column j.
  • C_1j: The (1, j) cofactor: C_1j = (-1)^(1 + j) * M_1j. The 4x4 determinant is a_11 * C_11 + a_12 * C_12 + a_13 * C_13 + a_14 * C_14.
  • det(A): The scalar determinant. Positive when columns preserve orientation, negative when they reverse it, zero when they are linearly dependent.

For a 2x2 matrix A = [[a, b], [c, d]] the determinant is the difference between the two diagonal products: det(A) = ad - bc.

For a 3x3 matrix the calculator uses two independent recipes. The Sarrus pattern sums three down-right diagonals and subtracts three down-left diagonals. The first-row cofactor expansion gives the same scalar as a(ei - fh) - b(di - fg) + c(dh - eg).

For a 4x4 matrix the calculator uses the Laplace cofactor expansion along the first row, evaluating each 3x3 sub-determinant with the Sarrus recipe.

Worked 2x2 example: A = [[1, 2], [3, 4]]

a = 1, b = 2, c = 3, d = 4.

det(A) = (1)(4) - (2)(3) = 4 - 6 = -2.

det(A) = -2. The signed area of the parallelogram spanned by (1, 3) and (2, 4) is -2.

Worked 3x3 example: A = [[2, 1, 0], [1, 3, 1], [0, 1, 2]]

a = 2, b = 1, c = 0, d = 1, e = 3, f = 1, g = 0, h = 1, i = 2.

Sarrus down-right: 2*3*2 + 1*1*0 + 0*1*1 = 12. Sarrus down-left: 0*3*0 + 1*1*2 + 2*1*1 = 4. det = 12 - 4 = 8.

det(A) = 8. The Sarrus and cofactor recipes both return 8.

According to Wikipedia, the determinant of a square matrix is the scalar det(A), defined by multilinearity in the columns, alternating sign on row swaps, and det(I) = 1, and it is the signed n-dimensional volume of the parallelotope spanned by the column vectors of A

When the same 2x2 or 3x3 matrix is the input to the eigenvalue problem, the characteristic polynomial calculator uses the same cofactor expansion with a shifted diagonal to return p(lambda) = det(A - lambda I).

Key Concepts Behind the Determinant

Four ideas cover the entire determinant pipeline the calculator runs.

Signed n-dimensional volume

The absolute value of det(A) is the n-dimensional volume of the parallelotope spanned by the column vectors of A. The sign is positive when the columns preserve orientation and negative when they reverse it.

Minor and cofactor

The (i, j) minor M_ij is the determinant of the (n - 1) x (n - 1) submatrix left after deleting row i and column j. The cofactor adds the checkerboard sign: C_ij = (-1)^(i + j) * M_ij.

Sarrus pattern for 3x3

The rule of Sarrus is a quick way to write down the 3x3 determinant as a sum of three products on the down-right diagonals minus three products on the down-left diagonals. It only works for 3x3.

Singular vs invertible

The matrix is singular when det(A) = 0, which means at least two rows or columns are linearly dependent. A non-zero determinant means A is invertible.

These four ideas are the entire toolbox the calculator uses.

When the same 2x2 or 3x3 matrix is the coefficient matrix of a linear system, the system of equations calculator uses the determinant of A and the sub-determinants to apply Cramer's rule.

How to Use the Determinant Calculator

Pick the matrix size, type the entries, and read the determinant, the Sarrus cross-check, the cofactor contributions, and the singular-matrix flag in the right-hand panel.

  1. 1 Choose the matrix size: Select 2x2, 3x3, or 4x4. The other entry grids hide automatically.
  2. 2 Type the matrix entries: Enter each entry as a real number, using decimals when the cofactor expansion is going to produce a fraction.
  3. 3 Read the determinant: For 2x2 it is the ad - bc value, for 3x3 it is the Sarrus expansion, and for 4x4 it is the Laplace cofactor expansion.
  4. 4 Cross-check with the Sarrus value: For 3x3 matrices the panel also shows the Sarrus result, which should match the determinant within rounding.
  5. 5 Read the cofactor contributions: The four cofactor rows show the C_1j values used in the first-row cofactor expansion, with the matching checkerboard sign.
  6. 6 Check the singular-matrix flag: The bottom row of the panel is a 1/0 flag that fires when the determinant rounds to 0.

Suppose a small structural model produces a 3x3 Jacobian A = [[2, 1, 0], [1, 3, 1], [0, 1, 2]] and you want to confirm it is invertible. Drop the entries into the 3x3 grid. The determinant is 8, the Sarrus cross-check is 8, and the signed volume is 8.

When the same three vectors come from a 3D geometry problem, the cross product calculator is the 3x3 determinant of the i, j, k column matrix, which is the same recipe the determinant calculator runs on a 3x3 input.

Benefits of Using the Determinant Calculator

The determinant is the workhorse scalar of linear algebra, and the calculator keeps every recipe for it in one place.

  • Cofactor expansion shown as its own step: The cofactor contributions sit between the determinant and the Sarrus cross-check, so the user can audit the checkerboard sign pattern before accepting the final scalar.
  • Sarrus cross-check for 3x3: The 3x3 result is computed twice, once by the Sarrus recipe and once by the first-row cofactor expansion. The two values should match within rounding.
  • Singular-matrix flag built in: When the determinant is exactly zero the singular flag fires, the signed area or volume drops to 0, and the user does not have to spot the singular case by hand.
  • Geometric interpretation as a scalar: The signed area (2x2) and signed volume (3x3) rows translate the determinant into the geometric reading the textbook uses.
  • Decimal-friendly arithmetic: Entries can be decimals like 1.5 or 0.25, and the result panel keeps four decimal places of precision.

Beyond the convenience, the result panel is laid out so the three independent recipes for the determinant are visible: the ad - bc value for 2x2, the Sarrus expansion for 3x3, and the Laplace cofactor expansion for 4x4.

When the same small system is better solved by row reduction than by cofactor, the elimination method calculator is the row-reduction counterpart that produces the same solution without expanding any determinant.

Factors That Affect Your Determinant Result

A handful of input choices and structural facts decide whether the determinant is meaningful and numerically safe.

Matrix size

The recipe is different for 2x2, 3x3, and 4x4. Mixing the three by leaving entries in the wrong grid is the most common reason a hand check disagrees with the calculator.

Checkerboard sign pattern

Each cofactor carries a (-1)^(i + j) factor that flips sign at every step. A single sign error on one cofactor mirrors into a sign error on the determinant.

Triangular and diagonal matrices

For a triangular matrix the determinant is the product of the diagonal entries, which is a fast cross-check.

Singular matrices

When two rows or two columns of A are linearly dependent, det(A) is zero, the matrix is singular, and no inverse exists.

Decimal precision

The output is rounded to four decimal places for display, but the calculation uses full double precision internally.

  • The calculator is restricted to 2x2, 3x3, and 4x4 square matrices. For 5x5 and larger the cofactor expansion is the same in principle, but row reduction is more practical.
  • The output is rounded for display, so a determinant that produces a clean fraction like 1/3 will show as 0.3333.
  • Numerical round-off in the determinant can hide a true singular matrix when det(A) is just above or below zero. The calculator treats only an exact zero as singular.

According to Wolfram MathWorld, for an n x n matrix the determinant can be computed as the sum over all permutations sigma in S_n of sign(sigma) times the product of the selected entries, and the first-row cofactor expansion is the most common recursive recipe

According to MIT OpenCourseWare 18.06 (Strang), the determinant of a triangular matrix is the product of its diagonal entries, and row operations change the determinant in predictable ways: row swaps flip the sign, row scaling multiplies the determinant, and row replacement leaves the determinant unchanged

When the same matrix is symmetric and positive-definite, the cholesky decomposition calculator is the LU-style alternative that uses triangular determinants as the building blocks of the Cholesky factor.

determinant calculator showing 2x2, 3x3, and 4x4 matrix input grids with the Sarrus pattern and Laplace cofactor expansion result panels
determinant calculator showing 2x2, 3x3, and 4x4 matrix input grids with the Sarrus pattern and Laplace cofactor expansion result panels

Frequently Asked Questions

Q: What is a determinant in a matrix?

A: The determinant of a square matrix is a single scalar that captures how the matrix scales lengths, areas, and volumes. The absolute value is the n-dimensional volume of the parallelotope spanned by the column vectors, and the sign reports whether the columns preserve or reverse orientation.

Q: How do you calculate the determinant of a 2x2 matrix?

A: For a 2x2 matrix A = [[a, b], [c, d]], the determinant is the difference of the two diagonal products: det(A) = a*d - b*c. The sign of ad - bc reports the orientation of the column vectors.

Q: How do you calculate the determinant of a 3x3 matrix?

A: Use the rule of Sarrus. Copy the first two columns to the right of the matrix, sum the three down-right diagonals, and subtract the three down-left diagonals. Equivalently, expand along the first row as a(ei - fh) - b(di - fg) + c(dh - eg).

Q: What is the formula for the determinant of a 4x4 matrix?

A: Use the Laplace cofactor expansion along the first row: det(A) = a_11 * C_11 + a_12 * C_12 + a_13 * C_13 + a_14 * C_14, where C_1j = (-1)^(1 + j) * det(submatrix after deleting row 1 and column j). Each 3x3 sub-determinant is then evaluated with the rule of Sarrus.

Q: What does it mean if the determinant of a matrix is zero?

A: A zero determinant means the matrix is singular: at least two rows or two columns are linearly dependent. The matrix has no inverse and the linear system A x = b has either no solutions or infinitely many.

Q: Can the determinant of a matrix be negative?

A: Yes. A negative determinant means the linear map reverses orientation: the column vectors form a basis that has been flipped. For 2x2 matrices the sign of ad - bc is the sign of the column vector cross product.