Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Matrix Determinant


Symbolic visualization of det(A): same scalar, several recipes.

det(A)·3×3|Diagonal product

Size of A (square)

A3×3
Diagonal product is not yet available for size 3×3. Try a different size, or pick another strategy.








Key Terms

Determinant — the number detA\det A, also written A|A|, attached to every square matrix; the signed factor by which AA scales area or volume, and zero exactly when AA is singular.

Main diagonal — the entries ai,ia_{i,i} running from the top-left corner to the bottom-right. The anti-diagonal runs from top-right to bottom-left.

MinorMi,jM_{i,j}, the determinant of the submatrix left after striking row ii and column jj.

CofactorCi,j=(1)i+jMi,jC_{i,j} = (-1)^{i+j} M_{i,j}, the minor with the checkerboard sign attached.

Cofactor expansiondetA=jai,jCi,j\det A = \sum_j a_{i,j}\, C_{i,j} along any row ii, or the same sum down any column; also called Laplace expansion.

Sarrus's rule — for 3×33 \times 3 only: repeat the first two columns, add the three downward diagonal products, subtract the three upward ones.

Sign pattern — the checkerboard of (1)i+j(-1)^{i+j}: plus where the row and column numbers have the same parity, minus where they differ.

SingulardetA=0\det A = 0; the matrix has no inverse and collapses space onto something lower-dimensional.

Orientation — the sign of the determinant: positive when AA preserves handedness, negative when it reverses it.

Term countn!n! products for an n×nn \times n matrix: 22, 66, 2424, 120120, which is why expansion is a small-matrix method.

Getting Started with the Visualizer

Pick a size for AA, pick a recipe for detA\det A, and watch the determinant assemble itself term by term.

• The Scenario tab holds the size stepper. AA is always square, so the second stepper is linked to the first and shows a link icon. Sizes run from 22 to 55
• The Strategy tab holds four cards for the four strategies. Each card states which sizes it supports; a card that does not fit the current size is greyed out with a size badge, and changing the size snaps you to a strategy that fits
• The two cofactor cards carry their own pill row for choosing which row or column to expand along
• The summary strip at the right of the tab bar always shows the size and the active strategy
• Below the panel, the scene player animates the recipe. Play, step back and forward, reset, and choose a speed. The caption above the matrix states the general formula for the strategy, and the Step explanations log on the right keeps every step you have passed, with the running formula growing one term at a time
• Everything is symbolic: the entries of AA stay as ai,ja_{i,j} and each term is written out, so what you see is the formula, not a numerical example

Every strategy produces the same number. They differ only in how the terms are grouped and what is highlighted while they are collected. For the theory behind the tool, see the determinants theory page; for minors and cofactors in depth, the cofactors theory page.

The Four Strategies

The Strategy tab offers four recipes for the same scalar. Two are shortcuts tied to a single size; two work for any size the tool allows.

Diagonal product2×22 \times 2 only. Main diagonal product minus anti-diagonal product: two terms
Sarrus's rule3×33 \times 3 only. Six diagonal products on an augmented 3×53 \times 5 layout, three added and three subtracted
Cofactor expansion along a row — sizes 33 to 55. Pick a row, walk its entries, multiply each by the determinant of its minor with the checkerboard sign
Cofactor expansion along a column — sizes 33 to 55. The same sum walked down a column instead

Both cofactor strategies open with the sign pattern scene, a standalone checkerboard of plus and minus signs that every cofactor term picks its sign from.

The step counts differ. At 2×22 \times 2 the diagonal product takes 66 scenes; at 3×33 \times 3 Sarrus takes 99 and either cofactor expansion takes 1212. The result is identical every time, and at 3×33 \times 3 the three cofactor terms, multiplied out, are exactly the six products Sarrus's rule lists.

Diagonal Product: the 2 × 2 Case

The first strategy is the whole determinant story at the smallest size. For a 2×22 \times 2 matrix, detA=a1,1a2,2a1,2a2,1\det A = a_{1,1} a_{2,2} - a_{1,2} a_{2,1}: the product of the main diagonal minus the product of the anti-diagonal.

The frozen scene below is the second of six. The main diagonal, a1,1a_{1,1} and a2,2a_{2,2}, is highlighted in blue; the anti-diagonal has not yet been visited.
A2×2a1,1a1,2a2,1a2,2
Diagonal product, main diagonal revealed

A is 2×2. The main diagonal, a1,1 and a2,2, is highlighted in blue; its product is the first term. The anti-diagonal has not been visited yet and will be subtracted.

The tool then highlights the anti-diagonal pair in grey and subtracts its product, and the running formula in the log fills in one term at a time: first a1,1a2,2a_{1,1} a_{2,2}, then a1,2a2,1- a_{1,2} a_{2,1}, then both together with the result framed.

This two-term formula is the base case for everything larger. A cofactor expansion of a 3×33 \times 3 matrix produces three 2×22 \times 2 minors, each evaluated by exactly this rule, and a 4×44 \times 4 expansion bottoms out in 2×22 \times 2 blocks the same way. Nothing about determinants of any size is more than this formula applied repeatedly with signs.

The sign already appears here. The anti-diagonal term is subtracted, and the sign pattern for n=2n = 2 is exactly plus on the main diagonal and minus off it. The 2×22 \times 2 rule is the cofactor expansion along row 11 with the minors written out.

Geometrically, a1,1a2,2a1,2a2,1a_{1,1} a_{2,2} - a_{1,2} a_{2,1} is the signed area of the parallelogram spanned by the two columns of AA, which the geometric meaning section develops.

Sarrus's Rule: the 3 × 3 Shortcut

The second strategy works only at 3×33 \times 3. Write the first two columns of AA again to its right, giving a 3×53 \times 5 layout, and read six diagonals of three cells each: three running down-right, whose products are added, and three running up-right, whose products are subtracted.

The frozen scene is positive diagonal 22 of 33: the cells a1,2a_{1,2}, a2,3a_{2,3} and a3,1a_{3,1}, the last of them sitting in the duplicated columns, which are dimmed when not in use.
Aa1,1a1,2a1,3a1,1a1,2a2,1a2,2a2,3a2,1a2,2a3,1a3,2a3,3a3,1a3,2
Sarrus's rule, positive diagonal 2 of 3

A is written as a 3×5 layout with its first two columns repeated on the right, dimmed. The highlighted diagonal a1,2, a2,3, a3,1 runs down-right and lands in the duplicated columns, which is what they are there for.

The six terms, in the order the tool collects them, are

detA=a1,1a2,2a3,3+a1,2a2,3a3,1+a1,3a2,1a3,2a1,3a2,2a3,1a1,1a2,3a3,2a1,2a2,1a3,3\det A = a_{1,1} a_{2,2} a_{3,3} + a_{1,2} a_{2,3} a_{3,1} + a_{1,3} a_{2,1} a_{3,2} - a_{1,3} a_{2,2} a_{3,1} - a_{1,1} a_{2,3} a_{3,2} - a_{1,2} a_{2,1} a_{3,3}


Each term takes exactly one entry from every row and every column, and the six terms are all the ways of doing that: six is 3!3!, the number of permutations of three things. That is the general definition of the determinant in miniature, a signed sum over permutations, and it is why Sarrus does not extend. A 4×44 \times 4 determinant has 2424 such terms, and no arrangement of diagonals on an augmented grid produces them all with the right signs; forcing the pattern onto a 4×44 \times 4 gives eight products and a wrong answer.

The rule is fast, which is its whole appeal, and it agrees with the cofactor expansion term for term: group the six products by which entry of row 11 they contain and the three cofactor terms of row 11 appear. Run both strategies at 3×33 \times 3 and compare the running formulas.

The dimmed duplicate columns are the same entries as columns 11 and 22; they are drawn again only so that every diagonal has three cells to land on and the wrap-around diagonals read as straight lines.

Cofactor Expansion Along a Row

The third strategy is the general method. Choose a row ii. For each entry ai,ja_{i,j} in it, strike out its row and column, take the determinant of what is left, the minor det(Mi,j)\det(M_{i,j}), attach the checkerboard sign (1)i+j(-1)^{i+j}, and multiply by the entry. Add the nn signed products.

The frozen scene is term 22 of the expansion along row 11 of a 3×33 \times 3 matrix. The pivot a1,2a_{1,2} is highlighted, the rest of its row and column are struck through and dimmed, and the 2×22 \times 2 minor M1,2M_{1,2} stands beside AA with its entries keeping their original indices.
A3×3a1,1a1,2a1,3a2,1a2,2a2,3a3,1a3,2a3,3M1,22×2a2,1a2,3a3,1a3,3
Cofactor along row 1, term 2 of 3

The pivot a1,2 is highlighted; the rest of row 1 and column 2 are struck through and dimmed. The 2×2 minor M1,2 stands beside A, built from the surviving entries with their original indices. This term carries a minus sign, since 1 + 2 is odd.

Each entry of the chosen row produces three scenes in the player: the strike, the minor appearing, and the term joining the running formula. The tool expands one level only. The minor's determinant is left as the symbol det(Mi,j)\det(M_{i,j}) rather than expanded again, because a 3×33 \times 3 minor of a 4×44 \times 4 matrix would need its own three-term expansion and the picture would not fit. At 3×33 \times 3 the minor is a 2×22 \times 2 determinant, so the term a1,2det(M1,2)-a_{1,2}\,\det(M_{1,2}) in the frozen scene stands for a1,2(a2,1a3,3a2,3a3,1)-a_{1,2}(a_{2,1}a_{3,3} - a_{2,3}a_{3,1}). To see a minor evaluated, run the tool at the smaller size.

The row is a free choice, and the pill row under the strategy card lets you change it. The result never changes, but the work does: a row with zeros contributes nothing for those entries, so the practical rule is to expand along the row with the most zeros. Expanding along a column is the same computation with the roles of ii and jj swapped, treated in the column expansion section.

The sign is the part most often lost. It comes from the sign pattern, not from the entry, and a1,2a_{1,2} in the frozen scene is a subtracted term even if the entry itself is positive.

At 3×33 \times 3 the three cofactor terms, once the minors are written out, are exactly the six products of Sarrus's rule regrouped.

Cofactor Expansion Along a Column

The fourth strategy is the third one turned on its side. Choose a column jj and walk down it: for each ai,ja_{i,j}, strike its row and column, take the minor, attach the sign (1)i+j(-1)^{i+j}, multiply, and add.

The frozen scene is term 22 of the expansion along column 11 of a 3×33 \times 3 matrix. The pivot is a2,1a_{2,1}, its row and column are struck, and the minor M2,1M_{2,1} is shown alongside.
A3×3a1,1a1,2a1,3a2,1a2,2a2,3a3,1a3,2a3,3M2,12×2a1,2a1,3a3,2a3,3
Cofactor along column 1, term 2 of 3

The same construction walked down a column. The pivot is a2,1, row 2 and column 1 are struck, and the minor M2,1 is shown alongside. Its sign is also minus, 2 + 1 being odd.

That row and column expansions give the same number is not obvious from the recipe, and it is one of the first real theorems about determinants. The reason is that detAT=detA\det A^T = \det A: expanding AA down column jj is expanding ATA^T along row jj, and the determinant does not see the difference.

The practical consequence is freedom. Any of the 2n2n lines of a matrix may be expanded along, so pick the one with the most zeros, and pick it after looking at the matrix rather than by habit. A column with a single nonzero entry reduces an n×nn \times n determinant to one (n1)×(n1)(n-1) \times (n-1) determinant in one step.

The sign attached to a2,1a_{2,1} in the frozen scene is minus, since 2+12 + 1 is odd. Down a column the signs alternate just as they do along a row, and the sign pattern scene shows the whole checkerboard at once.

The Sign Pattern

Both cofactor strategies begin with a scene that shows no entries at all, only signs: a checkerboard with ++ in the top-left corner, alternating along every row and down every column. This is (1)i+j(-1)^{i+j} drawn out, and it is the sign each cofactor term inherits from the position of its pivot.

The still below is the pattern at n=4n = 4. The tool draws it at whatever size is selected.
sign pattern4×4++++++++
The sign pattern at n = 4

No entries, only signs: plus in the top-left corner, alternating along every row and down every column. Each cofactor term takes the sign of its pivot's position from this checkerboard.

The rule is simpler than the formula suggests. An entry gets ++ when its row and column numbers have the same parity and - when they differ. The main diagonal is all plus. Neighbours in any direction have opposite signs.

Two things follow. Expanding along row 11 starts with plus and alternates, which is the version most people memorise; expanding along row 22 starts with minus, which is where errors creep in. And the sign belongs to the position, not to the number sitting there: a negative entry in a plus position and a positive entry in a minus position both end up subtracting.

The alternation is what makes the expansion agree with the definition of the determinant as a signed sum over permutations, where each transposition of columns flips the sign. The pattern is the same for every size, so the 2×22 \times 2 diagonal product is a cofactor expansion in disguise: plus on the main diagonal, minus on the anti-diagonal.

Reading the Scene Player

Each scene combines highlights on AA, an optional second matrix, and a formula that grows in the log, and the same colours mean the same things in every strategy.

Blue on a cell or a diagonal marks a positive term being collected, or the pivot entry of a cofactor term
Grey marks a subtracted term, or the struck-out row and column around a pivot, whose entries are also dimmed and crossed through
• A second matrix in green brackets is a minor Mi,jM_{i,j}, drawn with the surviving entries of AA and their original indices
Dimmed entries in the Sarrus layout are the duplicated columns, drawn only so every diagonal is complete
Arrows join the cells of a diagonal, and a dashed axis marks the main diagonal in the 2×22 \times 2 case
• The final scene frames AA with a green bracket labelled detA\det A

The caption above the matrix states the general formula for the active strategy and does not change during the run. The Step explanations log is where the computation happens: each entry shows the running formula with the current term highlighted in blue, collected terms in green, and terms still to come greyed out. Click any entry to jump the player to that scene.

Choosing the Size

The stepper offers 2×22 \times 2 up to 5×55 \times 5, and the strategies available change with it.

• At 2×22 \times 2 the diagonal product is the only strategy, and it is the whole story: a1,1a2,2a1,2a2,1a_{1,1}a_{2,2} - a_{1,2}a_{2,1}, two terms, one of each sign
• At 3×33 \times 3 every minor is a 2×22 \times 2 determinant, and the three cofactor terms multiply out to six products; this is the size at which the checkerboard of signs starts to matter, and the size Sarrus's rule was invented for
• At 4×44 \times 4 each cofactor would be a 3×33 \times 3 determinant with six terms, twenty-four products in total; the tool shows the four minors but leaves their determinants as symbols, since the expressions no longer fit in a cell, and by hand the method is already impractical
• At 5×55 \times 5 there are five minors of size 4×44 \times 4 and one hundred and twenty products behind them; the point of running the tool here is to see that the recipe does not change, only the cost

Beyond that, determinants are computed by row reduction, since the determinant of a triangular matrix is the product of its diagonal; the LU decomposition visualizer shows that route.

What the Determinant Is

The determinant of a square matrix is a single number with two faces, one geometric and one algebraic.

Geometrically, detA|\det A| is the factor by which the transformation AA scales area in the plane or volume in space: the unit square maps to a parallelogram of area detA|\det A|, the unit cube to a parallelepiped of volume detA|\det A|. The sign records orientation, negative when AA turns a right-handed frame into a left-handed one. And detA=0\det A = 0 means the image is flattened to something of lower dimension, so AA has no inverse.

Algebraically, the determinant is pinned down by three properties: it is linear in each row separately, it changes sign when two rows are swapped, and it takes the value 11 on the identity matrix. Any function with those three properties is the determinant, and every recipe on this page is a way of computing the one function they define. The general formula that falls out is a signed sum over all n!n! ways of choosing one entry from each row and each column,

detA=σsgn(σ)a1,σ(1)a2,σ(2)an,σ(n)\det A = \sum_{\sigma} \operatorname{sgn}(\sigma)\, a_{1,\sigma(1)}\, a_{2,\sigma(2)} \cdots a_{n,\sigma(n)}


which at n=2n = 2 is adbcad - bc, at n=3n = 3 the six terms of Sarrus's rule, and at n=4n = 4 already twenty-four. Cofactor expansion is the same sum organised recursively.

For the full theory, including the properties under row operations and the connection to inverses, see the determinants theory page; for minors and cofactors in depth, see the cofactors theory page.

Key Properties

The determinant interacts with every matrix operation in a definite way.

Product: det(AB)=detAdetB\det(AB) = \det A \cdot \det B
Transpose: detAT=detA\det A^T = \det A, which is why expansion along a column works as well as along a row
Inverse: detA1=1/detA\det A^{-1} = 1 / \det A, and AA is invertible exactly when detA0\det A \neq 0
Scalar: det(kA)=kndetA\det(kA) = k^n \det A for an n×nn \times n matrix, not kdetAk \det A
Row swap: changes the sign
Row scaling: scales the determinant by the same factor
Adding a multiple of one row to another: leaves the determinant unchanged, which is what makes row reduction a determinant method
Triangular matrices: the determinant is the product of the diagonal
Zero row, or two equal or proportional rows: determinant 00
Expansion along any line: detA=jai,jCi,j\det A = \sum_j a_{i,j} C_{i,j} for every row ii, and likewise for every column

The row-addition rule is the reason row reduction computes determinants: reduce AA to triangular form while tracking swaps and scalings, then multiply the diagonal. For large matrices that is far cheaper than expansion, which grows like n!n!. The product rule is the deepest of these. It says the determinant respects composition of transformations, which is what makes it a scaling factor rather than a mere formula.

Why It Matters

The determinant is the one number that answers the question "does this matrix collapse anything?", and that question turns up everywhere.

Invertibility: detA0\det A \neq 0 is the test for an inverse to exist, and the adjugate formula A1=adj(A)/detAA^{-1} = \operatorname{adj}(A) / \det A builds the inverse from the same signed minors the cofactor expansion collects
Linear systems: a square system has a unique solution exactly when its coefficient determinant is non-zero, and Cramer's rule writes that solution as ratios of determinants
Area and volume: the area of a parallelogram, the volume of a parallelepiped, and the Jacobian factor in a change of variables are all determinants
Orientation: the sign tells whether a transformation is a rotation-like motion or includes a reflection
Eigenvalues: the characteristic polynomial is det(AλI)\det(A - \lambda I), its degree is nn because the determinant is a sum of products of nn entries, and the determinant itself is the product of the eigenvalues
Cross product and independence: the cross product is a symbolic 3×33 \times 3 determinant expanded along its first row, and the determinant of a set of vectors is zero exactly when they are dependent
Numerical work: a determinant close to zero warns that the system it describes is ill-conditioned

When the Determinant Is Zero

detA=0\det A = 0 is the single most important thing the determinant can tell you, and it means several equivalent things at once.

• The rows of AA are linearly dependent: some row is a combination of the others. The same holds for the columns
AA is singular: it has no inverse
• The system Ax=bAx = b has either no solution or infinitely many, never exactly one
• The transformation xAxx \mapsto Ax collapses space onto a lower dimension: a plane onto a line, or space onto a plane
00 is an eigenvalue of AA

In the visualizer the entries are symbols, so no run produces a numeric zero, but the structure is visible in the recipes. A row of zeros kills every cofactor term along it. Two equal rows make the Sarrus positive and negative products cancel in pairs. A row that is a multiple of another vanishes under the row-addition rule before any expansion starts.

Conversely, detA0\det A \neq 0 guarantees an inverse, a unique solution to every Ax=bAx = b, and a transformation that preserves dimension.

Geometric Meaning

For a 2×22 \times 2 matrix, detA|\det A| is the area of the parallelogram whose sides are the two columns of AA. For 3×33 \times 3, it is the volume of the parallelepiped spanned by the three columns. In general, it is the factor by which the transformation xAxx \mapsto Ax scales nn-dimensional volume.

The sign carries orientation. A positive determinant means the transformation can be reached from the identity by a continuous motion; a negative one means a reflection is involved, and the ordering of the column vectors has been reversed.

The 2×22 \times 2 formula makes the area claim concrete. For columns (a,c)(a, c) and (b,d)(b, d), the parallelogram they span has area adbc|ad - bc|: the enclosing rectangle minus the four triangles and two rectangles around the edges, which is exactly the diagonal product computation.

This is the reason determinants appear in change of variables for integrals. The Jacobian determinant is the local volume scaling of a coordinate change, and an integral over the new coordinates must be corrected by it.

Worked Example

Take the 3×33 \times 3 matrix

A=(213041526)A = \begin{pmatrix} 2 & 1 & 3 \\ 0 & 4 & 1 \\ 5 & 2 & 6 \end{pmatrix}


Sarrus's rule. Positive diagonals: 246+115+302=48+5+0=532 \cdot 4 \cdot 6 + 1 \cdot 1 \cdot 5 + 3 \cdot 0 \cdot 2 = 48 + 5 + 0 = 53. Negative diagonals: 345+212+106=60+4+0=643 \cdot 4 \cdot 5 + 2 \cdot 1 \cdot 2 + 1 \cdot 0 \cdot 6 = 60 + 4 + 0 = 64. So detA=5364=11\det A = 53 - 64 = -11.

Cofactor expansion along row 1. The signs are +,,++, -, +.

detA=2412610156+30452=2(242)1(05)+3(020)=44+560=11\det A = 2 \begin{vmatrix} 4 & 1 \\ 2 & 6 \end{vmatrix} - 1 \begin{vmatrix} 0 & 1 \\ 5 & 6 \end{vmatrix} + 3 \begin{vmatrix} 0 & 4 \\ 5 & 2 \end{vmatrix} = 2(24 - 2) - 1(0 - 5) + 3(0 - 20) = 44 + 5 - 60 = -11


Cofactor expansion along column 1. The signs down the column are +,,++, -, +, and the middle entry is 00, so its term vanishes without computing the minor.

detA=241260+51341=2(22)+5(112)=4455=11\det A = 2 \begin{vmatrix} 4 & 1 \\ 2 & 6 \end{vmatrix} - 0 + 5 \begin{vmatrix} 1 & 3 \\ 4 & 1 \end{vmatrix} = 2(22) + 5(1 - 12) = 44 - 55 = -11


Three recipes, one number. The column expansion was the least work because of the zero, which is the practical rule for choosing a line to expand along. Each 2×22 \times 2 minor was evaluated by the diagonal product rule, adbcad - bc.

The determinant is nonzero, so AA is invertible, and its negative sign says the transformation reverses orientation while scaling volume by 1111. Set the tool to 3×33 \times 3 and run Sarrus, then each cofactor strategy, to watch these three groupings assemble symbolically.

Common Mistakes

Determinants are mechanical, and the mistakes are mechanical too.

Losing the checkerboard sign — the cofactor of a1,2a_{1,2} carries a minus; along the first row the signs go +,,++, -, +, and row 22 starts with minus. Read the sign from the position, not from the habit of row 11
Striking the wrong row or column — the minor of ai,ja_{i,j} is what remains after removing row ii and column jj, both of them, every time
Applying Sarrus's rule to a 4×44 \times 4 — the rule is a 3×33 \times 3 accident; a 4×44 \times 4 determinant has twenty-four terms, and the diagonal pattern produces only eight
Forgetting the sign change on a row swap — every exchange of two rows flips the sign; two swaps cancel
Scaling: det(2A)=2ndetA\det(2A) = 2^n \det A, not 2detA2 \det A; doubling a 3×33 \times 3 matrix multiplies its determinant by eight
Adding determinants: det(A+B)detA+detB\det(A + B) \neq \det A + \det B in general; the determinant is multiplicative, not additive
Confusing the determinant with the trace — the trace is the sum of the diagonal, the determinant the product of the eigenvalues; a matrix with zero trace can be invertible, and one with zero determinant usually has non-zero trace
Expecting a determinant for a non-square matrix — there is none; rank and singular values take its place
Expanding when reduction is cheaper — for anything larger than 3×33 \times 3, row reduce to triangular form and multiply the diagonal

The visualizer sizes every strategy card to the sizes it is valid for, which rules out the Sarrus mistake by construction, and its sign pattern scene is there to prevent the first one.