How Row Echelon Form and Reduced Row Echelon Form Work
Row echelon form (REF) and reduced row echelon form (RREF) are the two standard "reduced" shapes a matrix can be transformed into using elementary row operations: swapping two rows, multiplying a row by a nonzero scalar, and adding a multiple of one row to another. None of these operations change the matrix's row space, null space, or rank, which is why row reduction is the workhorse behind solving linear systems, computing rank, finding a basis for the null space, and testing whether a square matrix is invertible.
Formula and method
This calculator parses your matrix and runs Gaussian elimination with partial pivoting. Starting at column 1, it scans the current column (from the current row downward) for the entry with the largest absolute value and swaps it into the pivot row — this avoids dividing by a zero or tiny pivot, which keeps the arithmetic numerically stable. It scales the pivot row so the pivot equals 1, then subtracts multiples of that row from every row below it so every entry underneath the pivot becomes 0. Moving to the next column and next row, it repeats this until no columns or rows remain. The resulting matrix is the row echelon form (REF): every pivot is a leading 1, every entry below a pivot is 0, and each pivot sits strictly to the right of the pivot in the row above. Continuing from the REF, the calculator works backward from the last pivot to the first, subtracting multiples of each pivot row from the rows above it so every entry above each pivot also becomes 0. That final matrix is the reduced row echelon form (RREF) — unlike REF, which is not unique (different valid elimination paths can produce different, equally correct echelon matrices), RREF is unique for any given matrix. The number of pivots found is the matrix's rank, and the columns holding those pivots are the pivot columns; the remaining columns are free columns.
Common sources of error
- Dividing by a zero (or near-zero) pivot: without swapping rows first, a zero pivot makes elimination undefined and a tiny pivot amplifies rounding error — this is exactly what partial pivoting is designed to avoid.
- Stopping at REF when you need RREF: REF alone still requires back-substitution to solve a system by hand; RREF lets you read the solution (or the inconsistency) directly off the matrix.
- Mismatched row lengths: every row you enter must have the same number of entries, or the input is not a valid matrix.
Checking your result
In a correct REF or RREF, each pivot must sit strictly to the right of the pivot in the row above it, and any all-zero rows must be at the bottom. In RREF specifically, every pivot column should contain a single 1 with 0s everywhere else in that column — if you see a nonzero entry above a pivot, the reduction is not yet fully reduced. If you are treating the matrix as an augmented system [A | b] and a row reduces to all zeros except a nonzero last entry (a "0 = k" row with k ≠ 0), the system is inconsistent and has no solution.
Applications
Row reduction is the standard tool for solving systems of linear equations (Gaussian elimination with back-substitution, or Gauss-Jordan elimination to read the solution straight off RREF), determining a matrix's rank and nullity, finding a basis for the null space and column space, testing linear independence of a set of vectors, and — for a square matrix — computing the inverse by row-reducing [A | I] until the left block becomes the identity.