Row Echelon Form (REF) and RREF
The rules for row echelon form and reduced row echelon form, how to tell if a matrix qualifies, why RREF is unique, with examples and non-examples.
REF and RREF: The Two Definitions You Must Know
A matrix is in row echelon form (REF) when it meets three conditions. Every nonzero row is above every zero row. The leading entry of each nonzero row is to the right of the leading entry of the row above it. All entries below a leading entry are zero. Strang, in Introduction to Linear Algebra (ch. 2), adds that the leading entry should be 1, though many textbooks allow any nonzero number and call the 1 version 'reduced' later. The OpenStax and LibreTexts linear algebra texts use the same staircase pattern: pivots step down and to the right, and below each pivot is nothing but zeros. If your matrix looks like a set of stairs, you are in REF. The failure case: a zero in the pivot position. That is not a pivot, it is a gap that forces a row swap or tells you the system is singular. If you cannot swap because every entry below is also zero, the row is all zeros and belongs at the bottom.
Reduced Row Echelon Form: The Extra Two Conditions
Reduced row echelon form (RREF) starts with REF and adds two more rules. Every pivot must be exactly 1. And each pivot must be the only nonzero entry in its column, zeros above it as well as below. The LibreTexts notation is explicit: RREF is REF with each pivot a 1 and every other entry in that column zero. That means the column for a basic variable looks like an identity matrix column. RREF is what you get at the end of Gauss-Jordan elimination, which continues past REF to clear above each pivot. Gauss-Jordan elimination gets its own page elsewhere; here the point is that RREF is stricter than REF and is unique for any given matrix. The confusion pair between REF and RREF is the most common error in homework: students stop at REF and call it RREF, or they leave a pivot of 2 and think they are done. Check: is every pivot a 1, and is it the only nonzero in its column? Then it is RREF. If not, it is REF at best.
Examples and Non-Examples Gallery
The best way to learn REF and RREF is to look at matrices side-by-side. Below are four examples. The first is REF. The second is the same matrix after it becomes RREF. The third is not REF at all. The fourth looks like REF but fails the zero-row rule.
Example 1: REF
⎡1 3 2⎤
⎢0 1 4⎥
⎣0 0 0⎦
This satisfies REF: the leading 1 in row 1 is to the left of the leading 1 in row 2, and below each pivot are zeros. The bottom row is all zeros and sits at the bottom. It is not RREF because the 3 above the second pivot is nonzero.
Example 2: RREF (same system)
⎡1 0 -10⎤
⎢0 1 4 ⎥
⎣0 0 0 ⎦
Now every pivot is a 1 and each pivot column has only that 1. The row operations that got you from REF to RREF were adding a multiple of row 2 to row 1. This is the unique RREF for that matrix.
Non-Example 1: Not REF
⎡0 1 2⎤
⎢1 0 3⎥
⎣0 0 1⎦
This fails because the first nonzero row has a leading entry in column 2, but the row below it has a leading entry in column 1, that is not to the right. Also, the bottom row has a leading entry in column 3, which is fine by itself, but the pattern is wrong overall. Swap rows 1 and 2 to get a valid REF.
Non-Example 2: Zero Row in the Middle
⎡1 2 0⎤
⎢0 0 0⎥
⎣0 1 3⎦
The zero row is not at the bottom. That is a violation. REF requires all zero rows at the bottom. Swapping rows 2 and 3 fixes it. After the swap, the 1 in row 3 is in column 2, which is to the right of the pivot in row 1, that works. The matrix then qualifies as REF.
Uniqueness of RREF
RREF is unique for every matrix. That means no matter which sequence of elementary row operations you use, swap, scale, add, you will arrive at the same RREF. REF is not unique. You can multiply a row by a scalar and it remains REF. You can add a multiple of a row to another row above it and it stays REF. But RREF pins down the pivots to exactly 1 and clears the columns above and below, leaving no freedom. Strang (ch. 2) proves this by showing that the pivot columns are determined by the original matrix alone, and the row reduction algorithm eliminates all non-unique choices. The practical consequence: if two classmates get different RREFs, at least one of them made an arithmetic error. The failure mode here is that a student who stops at REF and thinks they have RREF will not catch that mistake. Always reduce to RREF if you want to check your answer against a friend's or a calculator's.
Pivots, Rank, and Free Variables
Find the Rank by Counting Pivots
The pivot position in REF tells you three things: the rank of the matrix, which variables are basic, and which are free. A pivot is the first nonzero entry in a row. Count the pivots, that number is the rank. For an m×n matrix, the rank cannot exceed the smaller of m and n. Every column that contains a pivot corresponds to a basic variable. Every column without a pivot corresponds to a free variable. Free variables can take any real number; basic variables are then determined by back-substitution or by reading off the RREF. If the augmented matrix has a row of zeros on the coefficient side but a nonzero constant, the system is inconsistent, no solution, and rank does not help because the system is broken. Burdens & Faires (10th ed.) point out that partial pivoting, which swaps rows so the pivot is the largest absolute value in the column, protects against small pivots that amplify round-off error. That matters when you are checking by hand: a pivot of 0.0001 is numerically dangerous even if theoretically valid. Swap to get a larger number. The LAPACK routine dgesv uses exactly this strategy, storing the row interchanges in an array called IPIV.
Work Through a Concrete Example
Suppose after elimination you have a 3×3 matrix with pivots in columns 1 and 2 only. Column 3 has no pivot. The rank is 2. Variables x1 and x2 are basic; x3 is free. The solution set will have one free parameter, meaning infinitely many solutions. If the rank equals the number of variables (3), every column has a pivot and the solution is unique. If the rank is less than the number of variables but the system is consistent, you get infinite solutions. The confusion pair between unique and infinite solutions comes down to this pivot count: no free variables means unique; at least one free variable means infinite. No solution does not involve rank at all, it is a contradiction in the augmented column.
Quick Checklist for REF and RREF
Use this checklist every time you finish an elimination. For REF: Are all zero rows at the bottom? Does each leading entry sit to the right of the one above it? Are all entries below each leading entry zero? If you answered yes to all three, the matrix is in REF. For RREF: Is the matrix already in REF? Is every leading entry exactly 1? Is each leading entry the only nonzero in its column? If yes to all, it is RREF. If you get a zero pivot, do not just skip it, swap rows or declare the system singular. The most common mistake is calling a matrix RREF when the pivots are not 1 or when there are nonzero entries above a pivot. The second most common is thinking a row of zeros means infinite solutions without checking the constant term. If the constant is also zero, infinite solutions. If the constant is nonzero, no solution. That is the difference between 0 = 0 and 0 = 5.
What REF and RREF Cannot Tell You
The row echelon form and its reduced cousin give you the solution structure, rank, free variables, consistency, but they do not tell you how numerically stable that solution is. A matrix can be in perfect RREF and still produce huge errors when the original matrix is ill-conditioned. The Hilbert matrix is the classic example: it is theoretically invertible, but Gaussian elimination with partial pivoting produces garbage for n > 10 or so. Burden & Faires cover this in their section on pivoting strategies. Condition number, not RREF, is what measures that sensitivity. If you are solving a system by hand on a 5×5 matrix, you are safe. If you scale up to 1000×1000, you need a sparse solver library like scipy.sparse.linalg.splu, and you need to check the condition number. REF and RREF are the algebra; numerical analysis handles the arithmetic.
The One Thing That Most Often Goes Wrong
A student reduces a 3×4 augmented matrix, gets to what looks like REF, and sees a row that reads [0 0 0 | 5]. They think the system has infinite solutions because of the row of zeros on the left. It does not.The system has no solution. The failure mode is forgetting to check the augmented column. The row of zeros must be zero all the way across, including the constant term. If the constant is nonzero, stop, the system is inconsistent. The matrix might be in perfect REF, but the system is dead. That moment, when you read 0 = 5, is where most people lose points on an exam. The fix: before you ever identify a row as a zero row, look at the entire row, not just the coefficient part. If the coefficient side is all zeros and the constant is not, you are done. Write 'no solution' and move on.
| Condition | REF | RREF |
|---|---|---|
| All nonzero rows above zero rows | Yes | Yes |
| Each leading entry to the right of the one above | Yes | Yes |
| Entries below each leading entry are zero | Yes | Yes |
| Each leading entry is exactly 1 | No | Yes |
| Each leading entry is the only nonzero in its column | No | Yes |
Next Step: Check Your Work Against a Calculator
The single most practical thing you can do after you reduce a matrix to REF or RREF is to verify it against a step-by-step calculator that shows fractions, not decimals. This calculator handles 5×5 matrices, shows every row operation, and outputs fractions to avoid round-off error. The research shows that floating-point error from decimal approximations is one of the top failure modes. If you used partial pivoting and got a pivot of 0.0001, the calculator will swap it for you and show the swap as a distinct step. If your answer differs from the calculator's, look at the first row operation where you diverged. Most errors happen at the third or fourth operation, not the first. Do not compare just the final RREF, compare each intermediate matrix. That is how you learn which step went wrong.
Common Questions
What is the difference between REF and RREF?
REF has zeros below each pivot, and pivots step to the right. RREF adds that every pivot must be 1 and must be the only nonzero entry in its column. REF is not unique; RREF is unique for any given matrix.
How do I check if a matrix is in REF?
Three conditions: all zero rows at the bottom, each leading entry is to the right of the one above, and all entries below each leading entry are zero. If any condition fails, it is not REF.
Can a matrix be in REF but not in RREF?
Yes, and most matrices in elimination are in REF before they reach RREF. If pivots are not 1 or there are nonzero entries above a pivot, it is REF only. Continuing to RREF requires extra row operations.
What is a pivot position and why does it matter?
A pivot position is the location of the first nonzero entry in each row after the matrix is in REF. The number of pivots equals the rank. Columns with pivots hold basic variables; columns without pivots hold free variables.
What does a free variable mean for the solution?
A free variable can take any real number. That creates infinitely many solutions, each corresponding to a different choice of the parameter. If there are no free variables, the solution is unique.
When do I swap rows in Gaussian elimination?
You swap when the pivot position is zero. Swap with a row below that has a nonzero in that column. If no such row exists, that column is a free variable and you move to the next column.
What should I do if I get a row of zeros with a nonzero constant?
That row says 0 = c with c nonzero. The system is inconsistent and has no solution. Stop, there is no need to reduce further. The rank of the coefficient matrix is less than the rank of the augmented matrix.