VectorLab

Visualize vectors, solve algebra & calculus step by step, with guides

← Back to the tools

Row Reduction: REF and RREF Step by Step

Row reduction is the workhorse of linear algebra. Learn the two target forms, the three row operations, and how to carry out the algorithm without losing track.

The three row operations

  1. Swap two rows.
  2. Scale a row by a nonzero constant.
  3. Replace a row with itself plus a multiple of another row.

Each is reversible and keeps the solution set of the corresponding system unchanged, which is why the process is safe.

REF versus RREF

Row-echelon form (REF) has all zero rows at the bottom, each pivot to the right of the pivot above it, and zeros below every pivot. Reduced row-echelon form (RREF) adds two rules: every pivot equals 1, and each pivot is the only nonzero entry in its column. Gaussian elimination stops at REF. Gauss–Jordan elimination continues to RREF. Every matrix has exactly one RREF, but many valid REFs.

The algorithm

  1. Find the leftmost column that is not all zeros. This is the pivot column.
  2. Swap a nonzero entry into the top position of the remaining rows.
  3. Eliminate every entry below the pivot with row replacements.
  4. Ignore that row and column, and repeat on what remains. This gives REF.
  5. For RREF, scale each pivot to 1, then eliminate the entries above each pivot, working right to left.

Worked example

Reduce the matrix with rows (1, 2, 3), (2, 5, 7) and (1, 1, 2).

  • R₂ − 2R₁ gives (0, 1, 1).
  • R₃ − R₁ gives (0, −1, −1).
  • R₃ + R₂ gives (0, 0, 0). This is the REF, with pivots in columns 1 and 2.
  • R₁ − 2R₂ gives (1, 0, 1).

The RREF has rows (1, 0, 1), (0, 1, 1) and (0, 0, 0). Two pivots mean the rank is 2. Column 3 has no pivot, so it is a free column, and its entries tell you column 3 = 1·(column 1) + 1·(column 2).

Reading the result

  • Pivot columns of the original matrix form a basis for its column space.
  • Free columns correspond to free variables in the solution of Ax = 0.
  • A row like (0, 0, 0 | 1) in an augmented matrix means the system has no solution.

Common mistakes

  • Dividing a row without noting that the pivot must be nonzero.
  • Clearing above pivots in the wrong order. Do it right to left.
  • Using decimals midway through. Exact fractions avoid false pivots.

FAQ

Is the REF unique?

No, only the RREF is unique for a given matrix.

Do row operations change the column space?

Yes, the column space can change, but the linear relations among the columns do not, which is why pivot positions remain meaningful.

Application: finding an inverse

To invert A with rows (1, 2) and (3, 4), row reduce [A | I]. R₂ − 3R₁ gives (0, −2 | −3, 1). Then R₂ ÷ (−2) gives (0, 1 | 3/2, −1/2), and R₁ − 2R₂ gives (1, 0 | −2, 1). The right half is the inverse, with rows (−2, 1) and (3/2, −1/2). Check the first entry of A·A⁻¹: 1·(−2) + 2·(3/2) = 1. ✓ If the left half cannot reach the identity, the matrix has no inverse.

Open the interactive tools →