Matrix Determinant Calculator

Calculate the determinant of any square matrix with full step-by-step Gaussian Elimination. Free online matrix determinant calculator — instant results.

Share Your Feedback

How was your experience with this calculator?

Matrix Determinant Calculator

Use this free matrix determinant calculator to find the scalar value of any square matrix — from a simple 2×2 up to a 5×5. Select your matrix size, enter your values, and get a full step-by-step solution instantly. No sign-up, no cost, no guesswork.

What Is the Determinant of a Matrix?

The determinant of a matrix is a single number that reveals the core behavior of a square matrix. Mathematicians write it as det(A) or |A|. Think of it as the matrix's "fingerprint" — one value that tells you whether a system of equations has a unique solution, whether a matrix can be inverted, and how a linear transformation scales space.

Here is what the result means:

  • det(A) ≠ 0 → The matrix is invertible (non-singular). A unique solution exists, and tools like Cramer's Rule apply.
  • det(A) = 0 → The matrix is singular. It has no inverse. The rows are linearly dependent, and the system has either no solution or infinitely many.

The determinant is not just a classroom exercise. It shows up in eigenvalue problems, coordinate transformations, physics simulations, machine learning (PCA), and structural engineering. Knowing how to calculate the determinant of a matrix — and what the result means — is one of the most practical skills in applied mathematics.

How to Use This Calculator

This determinant of a matrix calculator is designed to be as direct as possible:

  1. Choose your matrix size — Select 2×2, 3×3, 4×4, or 5×5 from the size selector. All inputs must form a square matrix.
  2. Enter your values — Type each element into the grid. Negative numbers and decimals are fully supported.
  3. Try a quick example — Not sure where to start? Use the built-in examples: 2×2 Simple, 3×3 Example, or 3×3 Identity to see the calculator in action before entering your own data.
  4. Click Calculate — The tool returns the determinant value along with a detailed breakdown of every step taken to reach it.
Going further? If you need to solve a full system of equations or find the inverse of your matrix, continue your work with our Gauss-Jordan Elimination calculator — it picks up right where the determinant leaves off.

Methods This Calculator Uses

The method applied depends on the size of your matrix. Smaller matrices use exact algebraic formulas; larger ones use a more efficient numerical approach.

Matrix SizeMethodWhy
2×2Gaussian EliminationFast and consistent with larger matrix handling
3×3Gaussian EliminationEliminates below each pivot, then multiplies the diagonal
4×4 and 5×5Gaussian EliminationEfficient; avoids exponential cofactor growth

How to Calculate the Determinant of a 2×2 Matrix

The 2×2 case is the building block of everything else. To calculate the determinant of a 2×2 matrix, you need just four numbers and one formula.

For matrix:

A = | a b | | c d |

Formula: det(A) = (a × d) − (b × c)

Subtract the product of the anti-diagonal from the product of the main diagonal.

Worked Example:

A = | 2 4 | | 1 2 |

  • Main diagonal: 2 × 2 = 4
  • Anti-diagonal: 4 × 1 = 4
  • det(A) = 4 − 4 = 0

A determinant of zero here tells you that row 2 is simply row 1 divided by two — the rows are linearly dependent. This matrix is singular and cannot be inverted, meaning Cramer's Rule cannot produce a unique solution for any system it represents.

Try the 2×2 Simple quick example in the calculator above to see this computed automatically.

How to Calculate the Determinant of a 3×3 Matrix

For a 3×3 matrix determinant, this calculator applies Laplace Expansion (Cofactor Expansion) along the first row. The process breaks the 3×3 problem into three 2×2 sub-problems — each of which you already know how to solve.

Before expanding, two definitions:

  • Minor (Mᵢⱼ): The determinant of the 2×2 matrix left after removing row i and column j.
  • Cofactor (Cᵢⱼ): The minor scaled by (−1)^(i+j). The sign alternates in a checkerboard pattern across the matrix.

Sign pattern for cofactor positions:

| + − + | | − + − | | + − + |

General formula (Row 1 expansion):

det(A) = a₁₁·C₁₁ + a₁₂·C₁₂ + a₁₃·C₁₃

Worked Example:

A = | 3 1 2 | | 0 4 1 | | 2 0 3 |

  • C₁₁ (+): det|4 1; 0 3| = (12 − 0) = 12 → 3 × 12 = 36
  • C₁₂ (−): det|0 1; 2 3| = (0 − 2) = −2 → −(1 × −2) = +2
  • C₁₃ (+): det|0 4; 2 0| = (0 − 8) = −8 → 2 × (−8) = −16

det(A) = 36 + 2 − 16 = 22

Because det(A) = 22 ≠ 0, this matrix is invertible and the system it represents has a unique solution.

Use the 3×3 Example or 3×3 Identity quick example in the calculator to compare the step-by-step output shown there against this walkthrough.

How to Calculate the Determinant of a 4×4 or 5×5 Matrix

Applying cofactor expansion to a 4×4 matrix means solving four separate 3×3 determinants — and a 5×5 means solving five 4×4 ones. The workload grows factorially and becomes impractical by hand.

This calculator determinant matrix tool handles 4×4 and 5×5 inputs using Gaussian Elimination, the same algorithm that powers professional scientific computing libraries.

How Gaussian Elimination finds the determinant:

  1. Apply elementary row operations to convert the matrix into Upper Triangular Form — zeros everywhere below the main diagonal.
  2. Track every row swap (each one multiplies the determinant by −1).
  3. Multiply all the diagonal elements. That product is the determinant.

Effect of each row operation on the determinant:

Row OperationEffect on det(A)
Swap two rowsMultiplies det by −1
Multiply a row by scalar kMultiplies det by k
Add a multiple of one row to anotherNo change

This approach is fast, accurate, and scales cleanly. It is also the foundation for LU Decomposition, which is how most software — including MATLAB and NumPy — computes determinants for large matrices.

Full Worked Example: 5×5 Matrix Determinant (Step-by-Step)

The following is a real output from this 5×5 matrix determinant calculator, showing every elimination step from the initial matrix through to the final result.

Input Matrix:

A = | 12 4 8 30 2 |

| 0 -1 0 0 11 |

| 7 0 3 9 7 |

| 6 0 0 4 0 |

| 5 14 0 0 -2 |

Method: Gaussian Elimination → Upper Triangular Form

Column 1 — Eliminate all entries below position (1,1):

The pivot is 12 (Row 1). Three row operations zero out the entries below it.

  • R3 ← R3 − (7/12) × R1 → Clears position (3,1)
  • R4 ← R4 − (1/2) × R1 → Clears position (4,1)
  • R5 ← R5 − (5/12) × R1 → Clears position (5,1)

After Column 1 is complete:

| 12 4 8 30 2 |

| 0 -1 0 0 11 |

| 0 -7/3 -5/3 -17/2 35/6 |

| 0 -2 -4 -11 -1 |

| 0 37/3 -10/3 -25/2 -17/6 |

Column 2 — Eliminate all entries below position (2,2):

The pivot is −1 (Row 2).

  • R3 ← R3 − (7/3) × R2 → Clears position (3,2)
  • R4 ← R4 − (2) × R2 → Clears position (4,2)
  • R5 ← R5 − (−37/3) × R2 → Clears position (5,2)

After Column 2 is complete:

| 12 4 8 30 2 |

| 0 -1 0 0 11 |

| 0 0 -5/3 -17/2 -119/6 |

| 0 0 -4 -11 -23 |

| 0 0 -10/3 -25/2 797/6 |

Column 3 — Eliminate all entries below position (3,3):

The pivot is −5/3 (Row 3).

  • R4 ← R4 − (12/5) × R3 → Clears position (4,3)
  • R5 ← R5 − (2) × R3 → Clears position (5,3)

After Column 3 is complete:

| 12 4 8 30 2 |

| 0 -1 0 0 11 |

| 0 0 -5/3 -17/2 -119/6 |

| 0 0 0 47/5 123/5 |

| 0 0 0 9/2 345/2 |

Column 4 — Eliminate all entries below position (4,4):

The pivot is 47/5 (Row 4).

  • R5 ← R5 − (45/94) × R4 → Clears position (5,4)

Final Upper Triangular Form:

| 12 4 8 30 2 |

| 0 -1 0 0 11 |

| 0 0 -5/3 -17/2 -119/6 |

| 0 0 0 47/5 123/5 |

| 0 0 0 0 7554/47 |

Step 8: Multiply the Main Diagonal

det(A) = 12 × (−1) × (−5/3) × (47/5) × (7554/47)

Working through the chain:

  • 12 × (−1) = −12
  • −12 × (−5/3) = 20
  • 20 × (47/5) = 188
  • 188 × (7554/47) = 30,216

det(A) = 30,216

Because the determinant is non-zero, this 5×5 matrix is invertible. It has a unique solution for any corresponding system of equations, and operations such as finding the inverse matrix or applying Cramer's Rule are valid.

Verification — Properties Confirmed by the Calculator:

PropertyResultStatus
det(Aᵀ) = det(A)det(Aᵀ) = 30,216✓ Verified
Row swap changes signdet(A_swapped) = −30,216✓ Verified
Zero-row matrixdet(A_zero) = 0✓ Verified
Scalar multiplication: det(2·A) = 2⁵·det(A)32 × 30,216 = 966,912✓ Verified

These checks are automatically run by the calculator for every 5×5 result, giving you confidence the output is correct.

Key Properties of Determinants

These identities regularly appear on exams and are useful for simplifying calculations before reaching for the calculator:

  • det(Aᵀ) = det(A) — Transposing a matrix does not change its determinant.
  • det(AB) = det(A) × det(B) — The determinant of a product is the product of the determinants.
  • det(A⁻¹) = 1 / det(A) — The inverse has a reciprocal determinant.
  • det(kA) = kⁿ · det(A) — Scaling all entries by k multiplies the determinant by kⁿ (n = matrix order).
  • A matrix with an all-zero row or column → det = 0 (always singular).
  • A matrix with two identical rows or columns → det = 0 (linearly dependent).
  • The identity matrix of any size → det = 1.
  • An upper or lower triangular matrix → det = product of diagonal elements.

Real-World Applications of the Determinant

  • Cramer's Rule for Linear Systems Cramer's Rule solves a system Ax = b by expressing each unknown as a ratio of determinants. If det(A) = 0, the rule cannot be applied — a signal to investigate the system for inconsistency or infinite solutions.
  • Checking Matrix Invertibility Before computing an inverse matrix, verifying det(A) ≠ 0 saves significant computation. Our calculator gives you that answer in one click.
  • Eigenvalue Problems Eigenvalues are found by solving det(A − λI) = 0. This characteristic polynomial is essential for stability analysis, principal component analysis (PCA), and quantum mechanical models.
  • Area and Volume Scaling In 2D, |det(A)| gives the factor by which a linear transformation scales area. In 3D, it gives volume scaling. A zero determinant means the transformation collapses the space to a lower dimension.
  • Computer Graphics and Physics Simulations Rotation, scaling, and reflection matrices in 3D graphics engines use determinants to verify that transformations are orientation-preserving (det = +1) or orientation-reversing (det = −1).

Frequently Asked Questions

How do I find the determinant of a 2×2 matrix?

Multiply the top-left by the bottom-right, then subtract the product of the top-right and bottom-left. The formula is det = ad − bc. Enter your four values into the 2×2 grid above and click Calculate for an instant result.

How do I find the determinant of a 3×3 matrix?

Expand along the first row using Laplace Expansion. For each element in Row 1, remove its row and column, find the 2×2 determinant of what remains (the minor), apply the cofactor sign, and sum the three results. The 3×3 matrix determinant calculator above shows every minor and cofactor in the step-by-step solution.

What method does this tool use for 4×4 and 5×5 matrices?

Gaussian Elimination. The matrix is reduced to upper triangular form through row operations, and the diagonal elements are multiplied together. This is significantly faster than full cofactor expansion for larger matrices.

Can a determinant be negative?

Yes. A negative determinant is completely valid — it means the linear transformation reverses orientation (similar to a reflection). It does not mean the matrix is singular.

What does a zero determinant mean geometrically?

In 2D, the matrix collapses the plane onto a line or a point. In 3D, it collapses space to a plane, a line, or a point. The rows of the matrix are linearly dependent — one or more rows can be written as a combination of the others.

What is the difference between a minor and a cofactor?

A minor is the determinant of the sub-matrix formed after deleting one row and one column. A cofactor is the minor with a sign applied: positive if (row + column) is even, negative if (row + column) is odd.

How accurate is this calculator for 5×5 matrices?

Very accurate. Gaussian Elimination is numerically stable and is the standard method used in scientific computing. For matrices of this size, it outperforms cofactor expansion in both speed and reliability.

Can I use this to check if my matrix is invertible?

Yes — that is one of the most common uses. If the result is any non-zero value, the matrix is invertible. If the result is zero, the matrix is singular and has no inverse.

  • Gauss-Jordan Elimination — Extend row reduction to find the full inverse matrix or solve a system of equations.
  • Math Formulas — Browse our reference library of linear algebra identities, formulas, and worked examples.

All calculations on this page reflect standard linear algebra methods as taught in undergraduate mathematics curricula and implemented in professional computing environments. Results are computed using Gaussian Elimination across all supported matrix sizes (2×2 through 5×5).