Matrix Determinant
The determinant is a single number that captures key properties of a square matrix, including whether it is invertible. Enter the matrix with rows separated by semicolons and entries by commas; the calculator returns the determinant.
One number, and what it decides
The determinant compresses a whole square matrix into one number, and that number answers a surprising amount. Whether the matrix can be inverted, whether a system built from it has a unique solution, whether its rows point in genuinely independent directions — all of it turns on whether the determinant is zero.
This calculator computes the determinant of any square matrix by cofactor expansion, reporting the working for the small sizes and flagging the singular case explicitly.
The determinant is rarely wanted for its own sake. It is computed as a precondition: before inverting a matrix, before trusting that a linear system has exactly one solution, before treating a set of vectors as a basis.
Geometrically it is a scale factor. A matrix transforms regions of space, and the determinant is the factor by which it multiplies their volume — with a negative sign when the transformation also reverses orientation. A determinant of zero means the transformation flattens space into a lower dimension, which is why nothing can undo it.
How to use this calculator
- Enter the matrix row by row Commas between entries, semicolons between rows, so a 2×2 matrix reads as 1, 2; 3, 4. Whitespace around the separators is ignored.
- Keep it square The determinant is defined only for matrices with equally many rows and columns. A rectangular matrix is rejected with a message saying so.
- Read the method line for small matrices A 2×2 matrix shows the products it subtracts; a 3×3 states that it expanded along the first row. Larger matrices report the result alone.
- Note the singular flag if it appears A determinant of exactly zero adds a line saying the matrix is not invertible. That is usually the most consequential thing the calculation reveals.
How the determinant is computed
The computation is recursive. A 1×1 matrix has its single entry as its determinant, and a 2×2 matrix uses the familiar difference of the two diagonal products — those two cases end the recursion.
Anything larger is expanded along its first row. Each entry of that row is paired with the smaller matrix obtained by deleting the entry's own row and column, the determinant of that smaller matrix is computed by the same procedure, and the products are combined with alternating signs.
That alternation is what makes cofactor expansion more than a sum of products. The sign attached to each term depends on the position of the entry, flipping from one column to the next, and it is where hand-computed expansions most often go wrong.
The method is exact for integer entries at every size, since it involves only multiplication and addition with no division. Its cost, however, grows extremely fast: each expansion replaces one determinant with several smaller ones, so the work multiplies with each additional row rather than merely increasing.
What each input means
- A Matrix — form field “Matrix (rows separated by ;)”
- A square matrix entered row by row. Entries may be negative or fractional; the recursion handles any size, though the cost rises sharply.
- det A Determinant
- A single number. Zero means the matrix is singular; the sign indicates whether the transformation preserves or reverses orientation.
- minor Minor
- The smaller matrix left after deleting one row and one column. Its determinant, with a sign attached, is the cofactor used in the expansion.
Worked examples
Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.
A 3×3 matrix by cofactor expansion
The matrix with rows (1, 2, 3), (4, 5, 6) and (7, 8, 10). The first two rows look like a familiar arithmetic progression, and the last entry breaks the pattern.
Inputs Matrix (rows separated by ;) = 1, 2, 3; 4, 5, 6; 7, 8, 10
- Matrix [[1, 2, 3], [4, 5, 6], [7, 8, 10]]
- Method Cofactor expansion along the first row
- Determinant det = -3
Result det = -3
Three 2×2 minors are formed and combined with alternating signs. Note that the middle term is subtracted rather than added, which is the step most often lost when the expansion is written out by hand.
Changing that final 10 to a 9 would make the three rows an arithmetic progression and the determinant zero. This matrix is one small perturbation away from being singular, which is a useful reminder that the determinant is sensitive to every entry.
A 2×2 matrix from the direct formula
The matrix with rows (4, 7) and (2, 6). At this size no recursion is needed — the answer is one subtraction of two products.
Inputs Matrix (rows separated by ;) = 4, 7; 2, 6
- Matrix [[4, 7], [2, 6]]
- 2×2 formula det = ad − bc = 4·6 − 7·2
- Determinant det = 10
Result det = 10
The working line shows both products explicitly before the subtraction. Reversing the two is the classic error, and it produces the negative of the right answer rather than something obviously wrong.
The determinant is non-zero, so this matrix has an inverse. That is exactly the check the inverse calculator performs before it begins, which is why the two tools are usually used in sequence.
Reading the result
Zero is the case that matters
A zero determinant means the rows are linearly dependent: at least one is a combination of the others. The matrix has no inverse, and a linear system built on it has either no solution or infinitely many rather than exactly one.
Size and sign both carry meaning
The magnitude is the factor by which areas or volumes are scaled by the transformation. The sign says whether orientation is preserved or flipped — a negative determinant corresponds to a reflection somewhere in the transformation.
Near-zero is not the same as zero
A very small determinant means the matrix is close to singular, and an inverse computed from it will amplify small errors badly. The flag only fires at exactly zero, so a tiny value deserves attention of its own.
When you would use this
Testing invertibility before inverting
Computing the determinant first is cheaper than attempting an inversion and discovering it fails, and it gives a clear reason rather than a breakdown mid-elimination.
Checking linear independence
Arranging a set of vectors as the rows of a square matrix and taking the determinant tests whether they are independent. Zero means they lie in a lower-dimensional space and cannot form a basis.
Assumptions and limitations
What this calculator assumes
- The matrix is square; the determinant is undefined otherwise.
- Entries are real numbers with commas between columns and semicolons between rows.
- Cofactor expansion along the first row is used at every level above 2×2.
- The singular note appears only when the determinant is exactly zero.
Where it stops being the right tool
- The recursive expansion grows very expensive with size, so large matrices are impractical even though the method is valid for them.
- No intermediate minors or cofactors are listed for matrices above 3×3 — only the final value.
- Floating-point entries can leave a determinant that should be zero as a tiny non-zero value, which suppresses the singular note.
- The rank of a singular matrix is not reported, so how far it falls short of invertible is not shown.
Common mistakes
Losing the alternating sign in the expansion
Why it happens. The pattern of plus and minus depends on position rather than on the entries, so it is easy to add every term. The result looks like a determinant and is simply wrong.
How to avoid it. Write the sign pattern above the row before starting. For a 3×3 expanded along the first row it is plus, minus, plus.
Reversing the two products in the 2×2 case
Why it happens. The formula is a difference, and which product is subtracted has to be recalled rather than derived. Reversing it gives exactly the negative of the correct answer.
How to avoid it. Take the product along the main diagonal first, then subtract the other. The working line shows both, in order.
Expecting a determinant from a non-square matrix
Why it happens. A rectangular matrix has rows and columns like any other, and the expansion procedure appears as though it could start.
How to avoid it. Check the shape first. The determinant is defined only for square matrices, and a rectangular one needs the rank or the singular values instead.
Learn why this works
Key terms
Frequently asked questions
How do I enter a matrix?
Separate the entries in a row with commas and the rows themselves with semicolons, so a 2×2 matrix is written 1, 2; 3, 4. Spaces around the separators are ignored, and entries may be negative or fractional.
What does a determinant of 0 mean?
That the matrix is singular. Its rows are linearly dependent, it has no inverse, and the transformation it describes collapses space into a lower dimension. A system of equations built on it has either no solution or infinitely many.
Does this work for matrices larger than 3×3?
Yes. Cofactor expansion is recursive and applies at any size, with each level reducing to determinants one size smaller. The cost grows very quickly with size, so it is best suited to the matrices that appear in hand calculations.
Why is my determinant negative?
A negative determinant is perfectly ordinary. The magnitude gives the volume scale factor and the sign says the transformation reverses orientation. Only the value zero carries the special meaning of non-invertibility.