(Reduced) Row Echelon Form Calculator

Enter any matrix (one row per line) to reduce it to row echelon form (REF) and reduced row echelon form (RREF) via Gaussian/Gauss-Jordan elimination, with rank and pivot columns identified.

Quick Facts

Row echelon form (REF)
Zeros below every pivot
Pivots step to the right as you move down the rows; found by forward (Gaussian) elimination.
Reduced row echelon form (RREF)
Zeros above and below each pivot = 1
Found by continuing with Gauss-Jordan elimination; RREF is unique for a given matrix.
Rank
Number of pivots (nonzero rows)
Same in REF and RREF; bounded above by min(rows, columns).

Your Results

Calculated
Row Echelon Form (REF)
-
Zeros below each pivot
Reduced Row Echelon Form (RREF)
-
Zeros above and below each pivot
Rank
-
Number of pivot rows
Pivot columns
-
1-indexed columns containing a pivot

Ready

Enter a matrix and press Calculate.

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.

Frequently Asked Questions

What is the difference between row echelon form (REF) and reduced row echelon form (RREF)?
Row echelon form (REF) only requires zeros below each pivot (leading entry), so the matrix looks upper-triangular with pivots stepping to the right as you go down. Reduced row echelon form (RREF) goes further: every pivot is scaled to exactly 1, and every entry above and below each pivot is zero, so each pivot column looks like a column of the identity matrix. RREF is unique for a given matrix; REF is not, because different valid elimination orders produce different (but equally correct) echelon forms.
How do you find the rank of a matrix from its row echelon form?
The rank equals the number of nonzero rows (equivalently, the number of pivots) in the row echelon form. Once a matrix is reduced, count the rows that are not entirely zero — that count is the rank, and it does not change whether you stop at REF or continue to RREF.
What are pivot columns and free columns?
Pivot columns are the columns that contain a leading 1 in RREF; the variables associated with those columns are determined uniquely once the others are fixed. The remaining columns are free columns, and if you are solving a homogeneous system Ax = 0, each free column corresponds to a free variable that can take any value, contributing one dimension to the null space.
Why does this calculator use partial pivoting?
Partial pivoting selects the entry with the largest absolute value in the current column (from the current row downward) as the pivot before eliminating, then swaps it into place. This avoids dividing by a zero or very small pivot, which would either break the elimination or amplify floating-point rounding error, so the computed REF and RREF stay numerically stable.