Enter your matrix, open the Decompositions tab and press RREF(A). The steps panel opens automatically and lists every operation in standard notation, so you can copy the working straight into your homework and check where your own attempt diverged. Press Row echelon(A) for plain Gaussian elimination instead, or rank(A) for the rank — all three come out of the same algorithm, explained below.
The three elementary row operations
Elimination is the single most useful algorithm in linear algebra. Rank, determinant, inverse and the solution of a linear system all fall out of it. It rests on three operations, none of which changes the solution set of the underlying system:
- Swap two rows:
R(i) ↔ R(j) - Multiply a row by a non-zero scalar:
R(i) → k·R(i) - Add a multiple of one row to another:
R(i) → R(i) + k·R(j)
Multiplying a row by zero is not on the list, and is not legal: it destroys an equation rather than rewriting it.
Row echelon form
A matrix is in row echelon form (REF) when:
- all-zero rows sit at the bottom;
- each leading non-zero entry (the pivot) is strictly to the right of the pivot above it;
- everything below a pivot is zero.
| 2 | 1 | −1 |
| 0 | 3 | 2 |
| 0 | 0 | 5 |
Reduced row echelon form
RREF goes further: every pivot equals 1 and is the only non-zero entry in its column. Crucially, every matrix has exactly one RREF — the answer does not depend on the order you did the operations in. That uniqueness is what makes it a reliable thing to compare your own working against.
The algorithm, step by step
- Start at the top-left. Find the largest entry in the current column — this is partial pivoting, and it keeps rounding errors small.
- If the whole column is zero, move one column right and try again.
- Swap that row up into pivot position.
- Divide the pivot row by the pivot so the pivot becomes 1.
- Subtract multiples of the pivot row from every other row to zero out the rest of the column.
- Move down one row and right one column, and repeat.
Applying step 5 only to rows below the pivot gives Gaussian elimination and row echelon form. Clearing the rows above as well gives Gauss-Jordan and the reduced form. Gauss-Jordan does more arithmetic; in exchange the solution can be read off without back substitution.
Worked example
| 1 | 2 | 1 |
| 2 | 4 | 3 |
| 3 | 6 | 5 |
| 1 | 2 | 0 |
| 0 | 0 | 1 |
| 0 | 0 | 0 |
The second column never gets a pivot, so its variable is free — and the zero row confirms the third equation carried no new information. Reading the form back: the rank is 2, and a system with this coefficient matrix has infinitely many solutions with one free parameter.
Solving a linear system
Enter the system as an augmented matrix: one row per equation, one column per unknown, and a final column for the constants. Three equations in three unknowns make a 3×4 matrix. Every row operation applies to the full row, right-hand side included. Take x + 2y − z = −4, 2x + 3y − z = −11, −2x − 3z = 22:
| 1 | 2 | −1 | −4 |
| 2 | 3 | −1 | −11 |
| −2 | 0 | −3 | 22 |
| 1 | 2 | −1 | −4 |
| 0 | −1 | 1 | −3 |
| 0 | 0 | −1 | 2 |
The last row says −z = 2, so z = −2. Substituting upward gives y = 1 and then x = −8. Reading the three possible outcomes off the reduced form:
- Unique solution: every column of the coefficient matrix has a pivot.
- Infinitely many: some column has no pivot — those variables are free.
- No solution: a row reads
0 0 0 | cwithc ≠ 0, which claims 0 = c.
Rank: counting what survives
The rank of a matrix is the number of linearly independent rows — equivalently, of linearly independent columns. Those two numbers are always equal, a fact important enough to have a name: the row rank equals column rank theorem. To compute it, row-reduce and count the non-zero rows. Row operations never change the rank, which is exactly why this works.
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 5 | 7 | 9 |
| 1 | 2 | 3 |
| 0 | −3 | −6 |
| 0 | 0 | 0 |
Here the third row is exactly the first plus the second, so it contributes nothing new and elimination drives it to zero. For an m×n matrix, rank ≤ min(m, n); a matrix hitting that bound has full rank. For a square matrix, full rank is the same as being invertible and the same as having a non-zero determinant — three phrasings of one property.
Rank is also what decides whether a system is solvable at all. The Rouché–Capelli theorem says Ax = b is consistent exactly when rank(A) = rank([A | b]); if that common rank equals the number of unknowns the solution is unique, and otherwise there are n − rank free parameters. The companion identity is rank-nullity: rank(A) + nullity(A) = n.
Common mistakes
- Stopping at row echelon form. Zeroing only below each pivot gives REF. RREF also clears everything above.
- Leaving a pivot different from 1. The reduced form requires dividing each pivot row by its pivot.
- Reordering columns. Swapping rows is allowed; swapping columns changes which variable is which.
- Missing the inconsistent row. A row reading
0 0 0 | cwith c ≠ 0 means the system has no solution at all. - Calling a zero row unsolvable. A row of all zeros is a redundant equation, so there are infinitely many solutions. Only
0 = cwith c non-zero means none. - Counting non-zero rows before finishing. Rows only reveal themselves as dependent once elimination is complete. Reduce fully, then count.