How to Use the RREF Calculator
This RREF calculator row reduces any matrix to reduced row echelon form — select the matrix size (2×2, 2×3, 3×3, or 3×4) then fill in every cell. For systems of equations, choose a size where the number of columns equals the number of variables plus one (the right-hand side): use 2×3 for 2 equations in 2 unknowns, or 3×4 for 3 equations in 3 unknowns. Click Compute RREF to see the result matrix and the list of row operations. Toggle Show row operations to follow each step. For matrix inverses, see our inverse matrix calculator. For simpler 2×2 and 3×3 systems without matrix notation, our systems of equations calculator accepts coefficients directly and shows step-by-step Gaussian elimination.
The calculator uses partial pivoting (choosing the row with the largest absolute value in each column) to maximize numerical stability — the same strategy used by professional linear algebra libraries.
What Is Reduced Row Echelon Form?
A matrix is in reduced row echelon form (RREF) when all four conditions are met:
- Any rows consisting entirely of zeros are at the bottom.
- The first non-zero entry in each non-zero row is 1 — this is called the pivot or leading 1.
- Each pivot is strictly to the right of the pivot in the row above it (staircase pattern).
- Every entry in a pivot column other than the pivot itself is zero — both above and below.
RREF is unique: every matrix has exactly one RREF, regardless of the sequence of row operations used to reach it. This makes it a powerful canonical form for analysis and computation.
The Gauss-Jordan Elimination Algorithm
Gauss-Jordan elimination extends Gaussian elimination by eliminating entries above each pivot as well as below, producing RREF directly. The algorithm proceeds column by column:
- Select the pivot column — move to the next column from left to right.
- Partial pivoting — find the row with the largest absolute value in this column at or below the current pivot row. Swap it into the pivot position. This reduces floating-point error.
- Scale the pivot row — divide every entry in the pivot row by the pivot value so the pivot becomes 1.
- Eliminate above and below — for every other row, subtract the appropriate multiple of the pivot row to zero out the entry in the pivot column.
- Advance the pivot row — move to the next row and repeat.
The three allowed operations — row swap, row scaling, and row addition — preserve the solution set of the linear system at every step.
Reading the Solution from RREF
When you row-reduce an augmented matrix [A|b], the RREF reveals the solution immediately:
- Unique solution: each variable column has exactly one pivot, and the last column gives the variable values directly. For a 3×4 matrix, the solution is x = last column row 1, y = last column row 2, z = last column row 3.
- No solution (inconsistent): a row appears that has all zeros in the variable columns but a non-zero value in the last column — this is a contradiction (0 = non-zero).
- Infinitely many solutions: the number of pivots is less than the number of variables. Columns without pivots are free variables; set them to parameters and express the other variables in terms of them.
For matrix rank and invertibility, our determinant calculator is complementary — the determinant is non-zero exactly when the matrix has full rank and a unique solution.
RREF Example: 3×4 Augmented Matrix
Solve the system: x + y + z = 6, 2x + y − z = 1, x − y + 2z = 5.
Write as the augmented matrix and apply row operations:
- Initial: rows [1, 1, 1 | 6], [2, 1, −1 | 1], [1, −1, 2 | 5]
- R2 ← R2 − 2·R1 → [0, −1, −3 | −11]
- R3 ← R3 − R1 → [0, −2, 1 | −1]
- R2 ← −R2 → [0, 1, 3 | 11]; R3 ← R3 + 2·R2 → [0, 0, 7 | 21]
- R3 ← R3 / 7 → [0, 0, 1 | 3]; back-substitute: z = 3, y = 11 − 9 = 2, x = 6 − 2 − 3 = 1
- RREF: [1, 0, 0 | 1], [0, 1, 0 | 2], [0, 0, 1 | 3] → x = 1, y = 2, z = 3
Applications of RREF
- Solving linear systems — the most common use; works for any number of equations and variables, regardless of whether the system has a unique, no, or infinite solutions.
- Finding matrix rank — the rank equals the number of non-zero rows in the RREF. A 3×3 matrix with 3 pivot rows has rank 3 (full rank) and is invertible.
- Computing the null space — the null space (kernel) of a matrix can be read from the RREF by expressing free variables as parameters.
- Testing linear independence — a set of vectors is linearly independent if and only if the matrix formed by those vectors has full column rank, visible from its RREF.
- Computing matrix inverses — by augmenting with the identity matrix [A|I] and row reducing, if A is invertible you obtain [I|A⁻¹].
Common Mistakes
- Skipping partial pivoting — always choose the largest pivot to avoid amplifying rounding errors. Never use a zero pivot.
- Sign errors in row addition — when eliminating, double-check whether you are adding or subtracting a multiple of the pivot row.
- Forgetting to eliminate above the pivot — RREF requires zeros above each pivot, not just below. REF only requires zeros below; RREF requires both.
- Confusing rows and columns — row operations act on entire rows, not columns. Each operation affects every entry across that row.
Sources & References
- Row Echelon Form — Khan Academy — Khan Academy
- Gaussian Elimination — Math is Fun — Math is Fun