Reduce Any Matrix to RREF and Read Off Its Rank
Paste a matrix, choose exact-fraction or decimal output, and watch full Gauss-Jordan elimination run row by row. This calculator reports the reduced row echelon form, the rank, every pivot and free column, and a basis for the null space — with each swap, scale, and elimination logged so you can check your own homework.
How the calculation works
Gauss-Jordan elimination transforms a matrix into reduced row echelon form (RREF) using three elementary row operations: swapping two rows, scaling a row by a nonzero constant, and adding a multiple of one row to another. The algorithm walks left to right. For each column it searches at or below the current pivot row for a nonzero entry; if found, that row is swapped into place, scaled so the pivot becomes 1, and then that multiple is subtracted from every other row to zero out the rest of the column. A column that yields a leading 1 is a pivot column; a column with no available pivot is a free column.
The number of pivots equals the rank of the matrix — the dimension of its row space and column space. For an m×n matrix the rank-nullity theorem states rank + nullity = n, so the count of free columns is exactly the nullity, the dimension of the null space. To keep results exact and avoid floating-point drift, this tool performs every operation in rational arithmetic: numerators and denominators are stored as integers and reduced with the Euclidean greatest-common-divisor algorithm after each step, so a pivot of 1/3 stays 1/3 and never becomes 0.333…. When you treat the last column as an augmented right-hand side, the RREF also reveals whether the linear system is consistent, has a unique solution, or has infinitely many — a row of the form [0 … 0 | c] with nonzero c flags an inconsistent system with no solution. The null-space basis below is built directly from the free columns by back-substituting each RREF pivot equation.