How to Compute a Determinant via Row Reduction
Row reduction is typically introduced as a tool for solving linear systems, but it also gives a clean, mechanical path to computing determinants. For large matrices, this approach beats cofactor expansion handily, because the work scales with Gaussian elimination rather than with the factorial blow-up of recursive minors.
At a Glance
- Row swaps flip the sign of the determinant (multiply by −1). Row scaling by k multiplies the determinant by k. Row replacement (adding a multiple of one row to another) leaves the determinant unchanged.
- The strategy: reduce to upper triangular using mostly row replacement, log every swap and scale, then multiply the diagonal entries by your accumulated correction factor.
- The determinant of any triangular matrix is simply the product of its diagonal entries.
- Stop at REF (triangular), not RREF. Continuing to RREF scales every pivot to 1 and destroys the diagonal-product shortcut.
- A zero row appearing during elimination means det = 0 immediately; the matrix is singular and you're done.
- For n at or above about 4, row reduction is dramatically faster by hand and by computer than cofactor expansion, which requires computing n smaller determinants recursively.
How Row Operations Change the Determinant

Before touching any numbers, you need one fact: the determinant is not preserved by row operations. Each type of operation changes it in a specific, trackable way. Keeping a running "correction factor" as you reduce is the whole technique. Wikipedia's determinant article lays out the same three rules used here: "Interchanging any pair of columns (or rows) of a matrix multiplies its determinant by −1," "multiplying a row by a number multiplies the determinant by this number," and "adding a multiple of one row to another row does not change the determinant."
Row Swap
Swapping two rows multiplies the determinant by -1. Order a swap, write down a factor of -1, and keep going.
Swap R1 and R2 → det(new) = -det(old)
If you end up doing three swaps before reaching triangular form, your accumulated factor is (-1)³ = -1. Two swaps cancel out, giving +1. Count carefully.
Scaling a Row
Multiplying every entry in a row by a scalar k multiplies the determinant by k. Equivalently, if you divide a row by k to produce a leading 1, you must compensate by multiplying the determinant by k at the end.
Replace Ri with k·Ri → det(new) = k · det(old)
This shows up most often when people scale a pivot row to clear fractions. Every such operation needs to be logged.
Row Replacement (Adding a Multiple of One Row to Another)
This is the workhorse operation of elimination, and it is the friendliest for determinants: it leaves the determinant completely unchanged.
Replace Ri with Ri + c·Rj (i ≠ j) → det(new) = det(old)
That's why row reduction works so well here. You can zero out every entry below (and above) each pivot without touching the determinant, as long as you only use row replacement. The only time you pay a penalty is when you swap rows or scale them.
See the three elementary row operations for a deeper look at why each rule holds, including the connection to the alternating multilinear definition of the determinant.
Reducing to Upper Triangular Form
The goal is to reach an upper triangular matrix: zeros everywhere below the main diagonal. Once you're there, the determinant equals the product of the diagonal entries. That's a theorem, not a trick, and it follows from cofactor expansion applied repeatedly along the first column.
det of upper triangular matrix:
| a b c |
| 0 d e | = a · d · f
| 0 0 f |
So the algorithm is:
- Apply Gaussian elimination using only row replacement when possible.
- Log every swap (factor of -1 each) and every row scale (factor of k each).
- Read off the diagonal of the resulting triangular matrix and multiply.
- Multiply that product by your accumulated correction factor.
Wikipedia's article states the general version of this recipe directly: "If Gaussian elimination applied to a square matrix A produces a row echelon matrix B, let d be the product of the scalars by which the determinant has been multiplied... Then the determinant of A is the quotient by d of the product of the elements of the diagonal of B." That quotient-by-d phrasing is exactly the "correction factor" bookkeeping in steps 2 and 4 above, just stated as a division instead of a running multiplication, since a divide-to-scale operation and a multiply-to-correct operation are inverses of each other.
Worked 3x3 Example
Start with this matrix:
A = | 2 1 -1 |
| 4 3 2 |
| -2 1 3 |
Step 1: Eliminate below the first pivot (a₁₁ = 2).
R2 ← R2 - 2·R1:
| 2 1 -1 |
| 0 1 4 |
| -2 1 3 |
R3 ← R3 + R1:
| 2 1 -1 |
| 0 1 4 |
| 0 2 2 |
Both operations were row replacements, so the determinant is unchanged so far. Correction factor: 1.
Step 2: Eliminate below the second pivot (a₂₂ = 1).
R3 ← R3 - 2·R2:
| 2 1 -1 |
| 0 1 4 |
| 0 0 -6 |
Row replacement again. Correction factor still 1.
Step 3: Read the diagonal and multiply.
Diagonal entries: 2, 1, -6.
det(A) = 2 · 1 · (-6) · (correction factor)
= -12 · 1
= -12
You can verify this with cofactor expansion along the first row if you want, but for a 3x3 the reduction above is already shorter. As a cross-check, cofactor expansion along row 1 gives det(A) = 2·(3·3 − 2·1) − 1·(4·3 − 2·(-2)) + (-1)·(4·1 − 3·(-2)) = 2·(7) − 1·(16) − 1·(10) = 14 − 16 − 10 = -12. Same answer, confirming the row-reduction result.
Tracking Signs and Scales in Practice
A common mistake is reducing all the way to reduced row echelon form and then reading the diagonal, which gives 1s across the diagonal and a determinant that always looks like ±1. That's wrong. Stop at upper triangular, not RREF.
Another pitfall: dividing a row to make a leading 1 without logging it. Say you divide R1 by 2 to get a cleaner pivot. You've multiplied det by (1/2), which means you owe a factor of 2 at the end.
Divide R1 by 2 → correction factor becomes 2 (to compensate)
Keeping a side ledger, even just a column of notes next to your work, prevents these from accumulating silently. A useful habit: write the correction factor as a running product in the margin after every single operation, not just at the end. If you only try to reconstruct it afterward from memory, swaps are the ones most often forgotten, since they don't change any numbers in the matrix itself, only the sign of the final answer.
If you want practice spotting how pivots relate to the full RREF, how to find RREF by hand walks through the elimination steps in detail.
When the Determinant is Zero
If Gaussian elimination produces a row of all zeros before you've reached a fully triangular form, the determinant is 0. That row of zeros means at least one row was a linear combination of the others, the matrix is singular, and it has no inverse.
| 1 2 3 |
| 2 4 6 | ← R2 = 2·R1
| 0 1 -1 |
Eliminating with R2 ← R2 - 2·R1 produces a zero row immediately. Diagonal product is 0. Done.
This connects directly to the relationship between rank and invertibility. A square matrix with det = 0 has rank less than n and at least one free variable in every associated system. For more on reading rank from a reduction, see how to find the rank of a matrix.
Correction Factor Quick Reference
Use this table as a checklist while reducing; each row operation you actually perform contributes exactly one factor.
| Operation performed | Effect on det | Correction factor to apply at the end |
|---|---|---|
| Swap two rows | Multiplies det by −1 | Multiply final product by −1 |
| Scale a row by k | Multiplies det by k | Divide final product by k |
| Row replacement (Ri + c·Rj) | No change | None |
| Two total swaps | Multiplies det by (−1)² = 1 | No net change |
| Three total swaps | Multiplies det by (−1)³ = −1 | Multiply final product by −1 |
| Zero row appears | det becomes 0 | Stop; det(A) = 0 |
Frequently asked questions
Does the order of row operations matter for the final determinant?
The final answer does not depend on which sequence of valid row operations you choose, as long as you log each one correctly. Different reduction paths may produce different intermediate matrices, but the product of the diagonal times the correction factor always comes out the same. The determinant is a property of the original matrix.
Can I use row reduction to find det for a 2x2 matrix?
Yes, though the formula det(A) = ad - bc is usually faster for 2x2. Row reduction becomes worthwhile starting around 3x3, and it clearly beats cofactor expansion for anything 4x4 or larger, where cofactor expansion requires computing four 3x3 determinants recursively.
What if I need the inverse as well as the determinant?
Run Gauss-Jordan elimination on the augmented matrix [A | I] to get the inverse, and track row operations separately for the determinant. Alternatively, once you know det(A) ≠ 0, you can compute the inverse via the adjugate formula or just read it off the RREF process. Finding a matrix inverse with Gauss-Jordan covers the full procedure.
Does row reduction work for non-square matrices?
Determinants are only defined for square matrices, so this method applies only when n = n. For non-square matrices, the relevant concept is rank, not determinant.
What's the fastest way to catch a sign error in this process?
Compare your reduced diagonal product against a quick independent check, like the 2×2 or 3×3 direct formula if the matrix is small enough, or a spot check using cofactor expansion along whichever row or column has the most zeros. A mismatch almost always traces back to a forgotten row swap, since swaps don't leave any visible trace in the numbers themselves, only in the sign of the final result.