Matrix Determinant Calculator
Compute the exact determinant of any square matrix from 2×2 to 6×6. Enter your entries as integers, decimals or fractions and get the exact result, a decimal value, singularity check and step-by-step solution.
Calculate the Determinant of a Square Matrix
Determinant Formula
Where:
- \(a_{ij}\) — the entry in row \(i\), column \(j\) of the square matrix \(A\)
- \(M_{1j}\) — the minor: the determinant of the submatrix left after deleting row 1 and column \(j\)
- \((-1)^{1+j}M_{1j}\) — the cofactor of the entry \(a_{1j}\)
The first line is the diagonal rule for 2×2 matrices, the second is cofactor (Laplace) expansion along the first row for 3×3 matrices, and the last line is the general expansion that works for any \(n \times n\) matrix.
Determinant – Calculation Example
Example: find the determinant of the 3×3 matrix
\[ A = \begin{bmatrix} 2 & 1 & 3 \\ 1 & 0 & 2 \\ 4 & 1 & 3 \end{bmatrix} \]
\[ M_{11} = 0 \cdot 3 - 2 \cdot 1 = -2, \quad M_{12} = 1 \cdot 3 - 2 \cdot 4 = -5, \quad M_{13} = 1 \cdot 1 - 0 \cdot 4 = 1 \]
\[ \det A = 2(-2) - 1(-5) + 3(1) = -4 + 5 + 3 \]
Result: \(\det A = 4\). The determinant is nonzero, so the matrix is invertible. You can reproduce this by pressing calculate with the tool's default values.
How to Use the Determinant Calculator
- Open the Matrix size dropdown and choose 2 × 2, 3 × 3, 4 × 4, 5 × 5 or 6 × 6. Only the fields of the selected size are used.
- Use the Fill the grid with dropdown to choose how to supply the matrix: Use the values entered below, Random integer matrix (a new matrix is rolled each time you switch), Identity matrix, or Clear (all zeros).
- Type your entries into the fields a11, a12, … Integers, decimals such as 1.5, and fractions such as 3/4 are all accepted. Empty cells count as 0.
- Read the results: Determinant (exact) gives the answer as an exact fraction or integer, Determinant (decimal) gives its decimal form, Is the matrix singular? tells you whether the matrix is invertible, and Solution steps shows the full working.
What Is the Determinant of a Matrix?
The determinant is a single number that summarizes an important geometric and algebraic property of a square matrix. Geometrically, the absolute value of the determinant of an \(n \times n\) matrix is the volume scaling factor of the linear transformation that the matrix represents: \(|\det A|\) tells you how much the transformation multiplies lengths (2×2), areas (2×2 and 3×3 in 2D/3D contexts) or volumes in general. A determinant of 3 means the transformation triples volume; a determinant of 0 means the transformation collapses space into a lower dimension and loses information.
Algebraically, the determinant is a quick invertibility test. A square matrix has an inverse if and only if \(\det A \neq 0\). When \(\det A = 0\) the matrix is called singular: its rows (and columns) are linearly dependent, systems \(Ax = b\) have no unique solution, and \(A^{-1}\) does not exist. This is why the determinant appears everywhere from solving linear systems (Cramer's rule) to finding eigenvalues and computing cross products.
How you interpret the number depends on context. The exact value matters for hand-checks and for theory; the decimal value is convenient for estimation. The sign carries meaning too: a negative determinant means the transformation flips orientation, like a mirror reflection. Note that determinants are only defined for square matrices — a non-square matrix simply has no determinant.
How the Calculator Computes It: Two Methods
For 2×2 and 3×3 matrices the calculator uses cofactor expansion along the first row and shows every minor and product, including a rule-of-Sarrus cross-check for 3×3 matrices. For 4×4 to 6×6 matrices it switches to Gaussian elimination with exact rational arithmetic: adding a multiple of one row to another leaves the determinant unchanged, while every row swap flips its sign. The determinant is then the product of the pivots of the resulting upper triangular matrix, times \((-1)\) for each swap performed. If no pivot can be found in some column, the matrix is singular and the determinant is exactly 0.
Because all arithmetic is done with integers and fractions (not floating-point decimals), the result is exact — there is no rounding error, even for awkward fractions. Decimal entries with up to 12 places are converted internally to exact fractions, so 0.1 is treated as exactly 1/10 rather than as an approximate binary value.
Useful Properties and Limitations
- \(\det(AB) = \det A \cdot \det B\), and \(\det(A^{-1}) = 1/\det A\) for an invertible matrix.
- Swapping two rows (or columns) multiplies the determinant by −1; multiplying a row by a constant \(k\) multiplies the determinant by \(k\). A matrix with two identical rows, or a zero row, has determinant 0.
- \(\det A = \det A^{T}\), so row and column arguments are interchangeable. You can explore the transpose itself with the Matrix Transpose calculator.
- The calculator accepts sizes 2×2 to 6×6 only, with entries up to 12 decimal places. For larger matrices, use eliminations with cofactor expansion, or software built for big linear systems.
- A quick shortcut worth remembering: \(\det(kA) = k^{n} \det A\) for an \(n \times n\) matrix, because every row gets multiplied by \(k\). The Matrix Scalar Multiplication calculator lets you build such matrices directly.
- Since a nonzero determinant guarantees a unique solution of a linear system, you may also want to solve systems directly with the Elimination Method calculator, or compare related invariants such as the sum of diagonal entries using the Matrix Trace calculator.
Frequently Asked Questions
How do I calculate the determinant of a 4×4 matrix by hand?
Either expand along a row or column with many zeros (Laplace expansion reduces 4×4 to four 3×3 determinants), or convert the matrix to upper triangular form with row operations: det A is the product of the diagonal entries, multiplied by −1 for each row swap you made. Adding a multiple of one row to another does not change the determinant. The calculator's step-by-step output shows exactly this elimination process.
Can a determinant be negative or a fraction?
Yes to both. A negative determinant means the transformation reverses orientation (like a mirror reflection), so simply take the absolute value if you need the volume-scaling factor. Fractional entries, or division during elimination, naturally produce fractional determinants — for example det of a 2×2 matrix \(\begin{bmatrix} 1/2 & 0 \\ 0 & 1/3 \end{bmatrix}\) is 1/6. The tool keeps the result as an exact fraction, alongside a rounded decimal.
What do the notations det A and |A| mean?
They mean the same thing: \(\det A\), \(|A|\) and \(\det(A)\) all denote the determinant of the matrix \(A\). The vertical-bar form is common in shorthand formulas such as Cramer's rule, but be careful not to confuse it with absolute value — a determinant written as \(|A|\) can still be negative. For clarity, this calculator always labels the result as det A.
Is there a shortcut for diagonal or triangular matrices?
Yes. For any diagonal or triangular matrix (upper or lower), the determinant is simply the product of the diagonal entries: \(\det A = a_{11} \cdot a_{22} \cdots a_{nn}\). That is why the calculator reduces larger matrices to triangular form — it turns a messy expansion into one multiplication. The identity matrix is the special case where this product is 1, so det \(I\) = 1 for every size.
I did row operations by hand and got a different answer. What went wrong?
The most common mistake is forgetting that multiplying a row by a constant \(k\) multiplies the whole determinant by \(k\), and that each row or column swap flips the sign. Only the operation "add a multiple of one row to another" leaves the determinant unchanged. Also check that you expanded along a single row or column with the correct alternating signs when using cofactor expansion.
Why can't I find the determinant of a 3×4 or other non-square matrix?
Determinants are defined only for square matrices, because the determinant measures how a transformation scales an \(n\)-dimensional space into itself — a non-square matrix changes the dimension, so there is no single scaling factor. For non-square matrices, other invariants apply instead, such as the rank of \(A\), or the determinant of the square matrix \(A^T A\), which is used in least-squares formulas.
How do I enter mixed numbers or values like 1 1/2?
Enter a mixed number as an improper fraction: 1 1/2 becomes 3/2, and −2¾ becomes −11/4. The fields only accept integers, decimals (up to 12 places) and fractions written as p/q, and any empty cell is treated as 0. Decimals are converted to exact fractions internally, so 0.1 is computed as exactly 1/10 and no floating-point rounding error can creep into your determinant.