Row reduction calculator (RREF, by Gauss–Jordan)
Reduce a matrix to row reduced echelon form and see every row operation that got it there — not just the final matrix.
What row reduced echelon form is
Row reduction rewrites a matrix by operations that do not change its solution set: swap two rows, multiply a row by a non-zero number, or add a multiple of one row to another. Carried to the end, those operations put every matrix into the same distinctive shape, and that shape is where the interesting facts are legible.
A matrix is in row echelon form when non-zero rows sit above zero rows and each row's first non-zero entry is to the right of the one above it. It is in row reduced echelon form (RREF) when, on top of that, every leading entry is 1 and is the only non-zero entry in its column.
That last condition is what makes RREF worth the extra work: because a pivot column has nothing else in it, the solution of an associated linear system can be read straight off the matrix. No back-substitution.
The four conditions, in order
- Every zero row is at the bottom.
- Each leading entry is to the right of the row above it.
- Each leading entry is
1. - Each leading entry is alone in its column.
Conditions 1 and 2 give row echelon form. All four give RREF, and the result is unique: whatever sequence of legal row operations you choose, a given matrix has exactly one RREF. That is why two people reducing the same matrix by different routes must finish with the same matrix — a useful check on any step-by-step answer, including this calculator's.
Gauss–Jordan, and how it differs from Gaussian elimination
Gaussian elimination stops at row echelon form and then solves by back-substitution: you find the last variable, feed it into the row above, and work upward. Gauss–Jordan keeps going — it eliminates above each pivot as well as below, which is where conditions 3 and 4 are met.
The trade is honest arithmetic for less thinking. Gauss–Jordan usually touches more entries, so there are more places to slip by hand; in exchange, the solution is already visible at the end. For a computer it is the obvious choice, which is why the RREF is what the calculator displays.
Worked example
A = ⎡ 1 2 3 ⎤
⎢ 2 4 6 ⎥
⎣ 1 1 1 ⎦
R2 ← R2 − 2·R1
R3 ← R3 − R1
⎡ 1 2 3 ⎤
⎢ 0 0 0 ⎥
⎣ 0 −1 −2 ⎦
swap R2, R3
⎡ 1 2 3 ⎤
⎢ 0 −1 −2 ⎥
⎣ 0 0 0 ⎦
R2 ← −R2
⎡ 1 2 3 ⎤
⎢ 0 1 2 ⎥
⎣ 0 0 0 ⎦
R1 ← R1 − 2·R2
⎡ 1 0 −1 ⎤
⎢ 0 1 2 ⎥
⎣ 0 0 0 ⎦
RREF(A) = ⎡ 1 0 −1 ⎤
⎢ 0 1 2 ⎥
⎣ 0 0 0 ⎦Two things happen here that are worth noticing. The second row was exactly twice the first, so it disappeared in the first operation — a dependent row does not survive reduction. And after the second pivot was made 1, the elimination ran back upward to clear the entry above it, which is the step that separates Gauss–Jordan from plain Gaussian elimination.
Reading the answer off the matrix
The columns with a leading 1 are pivot columns; their variables are determined. Every other column belongs to a free variable, which can take any value — and each free variable contributes one basis vector to the null space.
In the example the pivots are in columns 1 and 2, so x₃ is free. Set it to 1 and read the rest from the rows: x₁ = 1, x₂ = −2. That is the null-space vector (1, −2, 1), and it is the same vector whether you found it from the reduction or from the calculator.
Two more patterns say the rest:
- Every column is a pivot column: the only solution is the zero vector, so the columns are independent.
- A zero row beside a non-zero constant: in an augmented system,
0 = cwithc ≠ 0means there is no solution at all. The system is inconsistent, and no amount of further reduction will fix it.
What the calculator adds
It carries out Gauss–Jordan elimination and lists each operation in order — the row being replaced, the multiple, and the resulting matrix — so the answer can be followed or checked line by line rather than trusted. The rank is the number of pivots, and the null space is reported alongside, so the two halves of the rank–nullity theorem are on screen together. Matrices up to 10×10, and it works offline.
Questions
Is RREF the same as echelon form?
No — RREF is stricter. Row echelon form allows any non-zero leading entry and leaves entries above the pivots. RREF requires each pivot to be 1 and to be alone in its column, which is what makes the solution readable without back-substitution.
Is the reduced form unique?
Yes. Any matrix has exactly one RREF, although the row operations that reach it can differ. Two correct step-by-step solutions must end at the same matrix.
Does row reduction change the determinant?
Not its being zero or non-zero, which is what most questions need. The value itself does change: swapping rows flips the sign, and multiplying a row by k multiplies the determinant by k. Adding a multiple of one row to another leaves it unchanged.
What is a pivot?
The leading 1 of a non-zero row. The number of pivots is the rank, and the columns containing them are the pivot columns — the ones whose variables are determined.
Can it handle rectangular matrices?
Yes. RREF is defined for any shape, and it is most useful there: a rectangular matrix has no determinant, so its pivots and free columns are the only way to describe what it does.
Why list the row operations at all?
Because a bare reduced matrix cannot be checked. Each operation names the row being replaced, the multiple, and the result, so a step that went wrong is visible at the line where it happened instead of showing up as a wrong final answer.
