๐Ÿ‡บ๐Ÿ‡ธ USC
Math & Conversion
๐Ÿงพ

RREF Calculator

Reduced row echelon form with every row operation, exact fractions and the solution set

An RREF calculator row-reduces a matrix to reduced row echelon form, where every pivot is 1 and is the only nonzero entry in its column. This one runs Gauss-Jordan elimination with exact fractions, lists every row operation with the matrix after each step, and returns the row echelon form, the RREF, the pivot columns, the rank and, for an augmented matrix, the solution of the system.

โœ…

Last updated October 2026

Method: Gauss-Jordan elimination in exact rational arithmetic. Forward elimination works through the columns from left to right: it takes the first row at or below the current position with a nonzero entry, swaps it up if needed, scales it so the pivot is 1 and clears every entry below. That matrix is the row echelon form. Back substitution then clears the entries above each pivot, from the last pivot up, giving the unique reduced row echelon form.

Included: Matrices up to 6 rows by 7 columns (six equations in up to six unknowns), integer, decimal and fraction entries, a numbered list of every swap, scaling and row replacement with the matrix after each one, REF and RREF, pivot positions, rank, nullity and a null-space basis, and for augmented matrices a verdict (one solution, none or infinitely many) with free variables in parametric form.

Not included: Symbolic or complex entries, partial pivoting by largest entry (the calculator follows the hand method instead), least-squares answers for inconsistent systems, and matrices larger than 6 × 7.

๐Ÿงพ Enter your matrix

Try:
Show entries as

Empty cells count as 0. The arithmetic is always exact; the decimal view only changes how numbers are shown.

๐Ÿงพ Reduced row echelon form (RREF)

Unique solution
1001
0102
0013
Rank of A
3
Pivot columns
1, 2, 3
Free variables
0
xโ‚ = 1, xโ‚‚ = 2, xโ‚ƒ = 3

๐Ÿ’ก What the RREF tells you

rank(A) = rank([A | b]) = 3, which equals the number of unknowns (3). Every variable has a pivot, so the system has exactly one solution.

xโ‚
1
xโ‚‚
2
xโ‚ƒ
3

๐Ÿชœ Row echelon form (REF)

1-125
011/27/2
0013

This is the matrix after forward elimination: zeros below every pivot and each pivot scaled to 1. A matrix has many valid echelon forms, but only one reduced row echelon form.

๐Ÿ“‹ Row operations, in order (8)

  1. Forward elimination (to REF)

    Step 1.R1 โ†” R2

    swap rows to bring a nonzero entry into the pivot spot of column 1

    1-125
    0217
    21-11
  2. Step 2.R3 โ†’ R3 โˆ’ 2R1

    add a multiple of the pivot row to clear the entry below the pivot in column 1

    1-125
    0217
    03-5-9
  3. Step 3.R2 โ†’ (1/2)R2

    scale the row so the pivot in column 2 becomes 1

    1-125
    011/27/2
    03-5-9
  4. Step 4.R3 โ†’ R3 โˆ’ 3R2

    add a multiple of the pivot row to clear the entry below the pivot in column 2

    1-125
    011/27/2
    00-13/2-39/2
  5. Step 5.R3 โ†’ โˆ’(2/13)R3

    scale the row so the pivot in column 3 becomes 1

    1-125
    011/27/2
    0013
  6. Back substitution (REF to RREF)

    Step 6.R1 โ†’ R1 โˆ’ 2R3

    add a multiple of the pivot row to clear the entry above the pivot in column 3

    1-10-1
    011/27/2
    0013
  7. Step 7.R2 โ†’ R2 โˆ’ (1/2)R3

    add a multiple of the pivot row to clear the entry above the pivot in column 3

    1-10-1
    0102
    0013
  8. Step 8.R1 โ†’ R1 + R2

    add a multiple of the pivot row to clear the entry above the pivot in column 2

    1001
    0102
    0013

Notation: R2 โ†’ R2 โˆ’ 3R1 means "replace row 2 with row 2 minus 3 times row 1". Highlighted rows changed in that step.

Everything is computed in your browser with exact fractions, so no rounding error can creep into the row operations. The method is Gauss-Jordan elimination: forward elimination to row echelon form, then back substitution to reduced row echelon form. Underlined entries mark the pivot positions.

RREF calculator: reduced row echelon form, step by step

Row reduction is the workhorse of linear algebra. The same three moves (swap two rows, scale a row, add a multiple of one row to another) solve systems of equations, find the rank of a matrix, test vectors for independence, compute inverses and describe null spaces. By hand it means carrying fractions through a dozen steps, where one slip spoils everything after it. The calculator above performs each step exactly and shows it, so you can compare your work line by line.

Three related tools cover the neighbors. The Matrix Calculator multiplies and inverts matrices and finds determinants and eigenvalues. The System of Equations Calculator accepts equations typed in x, y and z. The Vector Calculator handles dot and cross products. In the text below, matrices are written row by row with semicolons between rows and a bar before the right-hand side, so [1, 2 | 3; 4, 5 | 6] is the augmented matrix of x + 2y = 3 and 4x + 5y = 6. The Paste as text box accepts exactly that notation.

What row echelon form and reduced row echelon form mean

A matrix is in row echelon form (REF) when three conditions hold: rows of all zeros sit at the bottom; the first nonzero entry of each row, called its pivot or leading entry, lies to the right of the pivot in the row above; and every entry below a pivot is zero. Reduced row echelon form (RREF) adds two more: every pivot equals 1, and each pivot is the only nonzero entry in its column. The matrix [1, 2, 0 | 5; 0, 0, 1 | 1; 0, 0, 0 | 0] is in RREF. The matrix [1, −1, 2 | 5; 0, 1, 1/2 | 7/2; 0, 0, 1 | 3] is in REF but not RREF, because the entries above its second and third pivots are not zero.

The distinction matters because of uniqueness. A matrix has many row echelon forms (scale a row, or add a lower row to a higher one, and you have another valid REF), but exactly one reduced row echelon form. That is why answer keys can disagree about an REF yet must agree about the RREF. The REF this calculator reports is the one produced by forward elimination with each pivot scaled to 1, the version many textbooks print.

The three elementary row operations

Every step of row reduction is one of three moves. Each can be undone by another move of the same kind, which is why row operations never change the solution set of a system:

Operation Notation Undone by Effect on det(A)
Swap two rowsR1 ↔ R2R1 ↔ R2Changes sign (× −1)
Scale a row by k ≠ 0R2 → kR2R2 → (1/k)R2Multiplied by k
Add a multiple of another rowR3 → R3 + kR1R3 → R3 − kR1Unchanged

The notation matches the step list: R2 → R2 − 3R1 means "replace row 2 with row 2 minus 3 times row 1". A replacement must keep the row being replaced, with a nonzero coefficient; writing R2 → R1 + R3 is not an elementary operation and can throw information away. The last column explains why row reduction also computes determinants, which the section on determinants below puts to use.

Gauss-Jordan elimination in five steps

  1. Start in the top-left corner and find the leftmost column with a nonzero entry at or below the current row.
  2. If the current row has a zero in that column, swap it with the first row below that does not.
  3. Scale the row so the pivot becomes 1.
  4. Add multiples of the pivot row to each row below until every entry under the pivot is zero. Move one row down and one column right, and repeat until you run out of rows or columns. The matrix is now in REF.
  5. Starting from the last pivot and working upward, add multiples of each pivot row to the rows above it until every entry above the pivot is zero. The matrix is now in RREF.

Gaussian elimination stops after step 4 and finishes with back substitution in the equations. Gauss-Jordan elimination continues to the RREF so the answer can be read directly from the matrix. The calculator follows this hand method exactly and never reorders rows except to replace a zero pivot, so its steps look like what you would write on paper.

Worked example 1: three equations with exactly one solution

Solve 2y + z = 7, x − y + 2z = 5 and 2x + y − z = 1 (the calculator's default). The augmented matrix is [0, 2, 1 | 7; 1, −1, 2 | 5; 2, 1, −1 | 1]. Its top-left entry is 0, so the first move has to be a swap. The table lists all eight row operations exactly as the calculator reports them:

Step Row operation Matrix after the step
Startnone[0, 2, 1 | 7; 1, −1, 2 | 5; 2, 1, −1 | 1]
1R1 ↔ R2[1, −1, 2 | 5; 0, 2, 1 | 7; 2, 1, −1 | 1]
2R3 → R3 − 2R1[1, −1, 2 | 5; 0, 2, 1 | 7; 0, 3, −5 | −9]
3R2 → (1/2)R2[1, −1, 2 | 5; 0, 1, 1/2 | 7/2; 0, 3, −5 | −9]
4R3 → R3 − 3R2[1, −1, 2 | 5; 0, 1, 1/2 | 7/2; 0, 0, −13/2 | −39/2]
5R3 → −(2/13)R3[1, −1, 2 | 5; 0, 1, 1/2 | 7/2; 0, 0, 1 | 3] (REF)
6R1 → R1 − 2R3[1, −1, 0 | −1; 0, 1, 1/2 | 7/2; 0, 0, 1 | 3]
7R2 → R2 − (1/2)R3[1, −1, 0 | −1; 0, 1, 0 | 2; 0, 0, 1 | 3]
8R1 → R1 + R2[1, 0, 0 | 1; 0, 1, 0 | 2; 0, 0, 1 | 3] (RREF)

The last column now reads x = 1, y = 2, z = 3. Substituting into the original equations confirms it: 2·2 + 3 = 7, 1 − 2 + 2·3 = 5 and 2·1 + 2 − 3 = 1. Steps 3 and 4 create the fractions 1/2, 7/2, −13/2 and −39/2. Halves survive a decimal calculator, but if a pivot had been 3 or 7, decimals would have rounded at that point and carried the error forward; exact fractions keep every value until it cancels.

Worked example 2: infinitely many solutions and free variables

Now take x + 2y − z = 4, 2x + 4y + z = 11 and 3x + 6y = 15 (the Infinitely many preset). Five operations produce the RREF [1, 2, 0 | 5; 0, 0, 1 | 1; 0, 0, 0 | 0]. Columns 1 and 3 hold pivots and column 2 does not, so y is a free variable and x and z are basic. The bottom row reads 0 = 0 and carries no information, because the third equation is simply the sum of the first two. The two remaining rows say x + 2y = 5 and z = 1. Setting y = t gives

x = 5 − 2t,   y = t,   z = 1 (x, y, z) = (5, 0, 1) + t(−2, 1, 0)

Every real number t produces a solution: t = 0 gives (5, 0, 1) and t = 1 gives (3, 1, 1), and both satisfy all three original equations. Geometrically, the three planes meet in a line, and the vector form describes it as a point on the line plus multiples of its direction (−2, 1, 0).

Worked example 3: a system with no solution

The No solution preset is x + y + 2z = 3, 2x + 3y + z = 4 and 3x + 4y + 3z = 9. After three replacements the third row is [0, 0, 0 | 2], which says 0x + 0y + 0z = 2. No choice of x, y and z can make that true, so the system is inconsistent. The cause is visible in the original equations: adding the first two gives 3x + 4y + 3z = 7, which contradicts the third equation's 9. The calculator still finishes the job, scaling that row and reaching the RREF [1, 0, 5 | 0; 0, 1, −3 | 0; 0, 0, 0 | 1]. The pivot in the last column is the formal signal: rank(A) = 2 but rank([A | b]) = 3.

Rank, pivot columns and the number of solutions

Three numbers decide every case: the rank of the coefficient matrix A, the rank of the augmented matrix [A | b], and the number of unknowns n. If rank(A) < rank([A | b]), there is no solution. If rank(A) = rank([A | b]) = n, there is exactly one. If rank(A) = rank([A | b]) < n, there are infinitely many, with n − rank(A) free variables. Each system below was row-reduced with the calculator.

Augmented matrix rank(A) rank([A | b]) Unknowns Result
[3, 2 | 12; 1, −1 | −1]222One solution: x = 2, y = 3
[2, −4 | 6; −1, 2 | 5]122No solution (parallel lines)
[2, −4 | 6; −1, 2 | −3]112Infinitely many: x = 3 + 2t, y = t
[1, 1 | 5; 1, −1 | 1; 2, 3 | 12]222One solution: x = 3, y = 2
[1, 1 | 5; 1, −1 | 1; 2, 3 | 13]232No solution
[1, 2, 0, −1 | 3; 2, 4, 1, 0 | 10]224Infinitely many, 2 free: x1 = 3 − 2s + t, x3 = 4 − 2t
[1, 2, 3 | 0; 4, 5, 6 | 0; 7, 8, 9 | 0]223Infinitely many: x = t(1, −2, 1)

The fourth and fifth systems differ in a single number and land on opposite sides of the rule: three equations in two unknowns can be consistent, but only when the third equation agrees with the first two. The last system is homogeneous (every right-hand side is 0), so it always has at least the zero solution, and its free variable spans the null space of the coefficient matrix.

Determinants and inverses from the same row operations

Row reduction does more than solve systems. In worked example 1 the only operations that change a determinant are the swap (factor −1) and the two scalings (factors 1/2 and −2/13). The coefficient part ends as the identity matrix, whose determinant is 1, so det(A) × (−1) × (1/2) × (−2/13) = 1, which gives det(A) = 13. To invert a matrix, row-reduce [A | I]. For the same coefficient matrix A = [0, 2, 1; 1, −1, 2; 2, 1, −1], eight operations produce A−1 = [−1/13, 3/13, 5/13; 5/13, −2/13, 1/13; 3/13, 4/13, −2/13], and multiplying A−1 by (7, 5, 1) returns (1, 2, 3) again. You can enter the 3 × 6 matrix [A | I] here with the augmented box unticked, or use the inverse operation of the Matrix Calculator.

How to use this calculator, and who it is for

Set the number of rows and columns (up to 6 × 7). Leave Augmented matrix ticked when the last column holds the right-hand sides of equations; untick it to analyze a plain matrix, and the calculator reports rank, pivot columns, nullity and a basis for the null space instead of solutions. Type entries as integers, decimals or fractions such as −3/4, and leave a cell empty for 0. Paste as text accepts a whole matrix, one row per line, with an optional bar before the last entry; write numbers without thousands separators (1000, not 1,000). The results show the RREF with its pivots underlined, the verdict, the REF, and the numbered row operations with the changed rows highlighted. Switching to decimals changes only the display; the arithmetic stays exact, and a nonzero entry too small for the chosen decimal places appears in e-notation, such as 3.333e-5, rather than as 0.

It is built for students in a first linear algebra course who want to check homework one row operation at a time, for teachers who need worked examples with predictable fractions, and for anyone who has to solve a small linear system quickly, such as balancing a chemical equation, splitting a budget across several constraints or fitting a polynomial through a few points.

Key terms

  • Pivot (leading entry): the first nonzero entry of a row in echelon form; in RREF it is always 1.
  • Pivot column: a column that contains a pivot; the matching variable is a basic variable.
  • Free variable: a variable whose column has no pivot; it can take any value, and the basic variables are written in terms of it.
  • Rank: the number of pivots, equal to the number of nonzero rows in echelon form.
  • Nullity: the number of free columns, n − rank, which is the dimension of the null space.
  • Consistent and inconsistent: a system with at least one solution, and a system with none.
  • Homogeneous system: Ax = 0, which always has the zero solution.
  • Row equivalent: two matrices that can be turned into each other by row operations; they share the same RREF and the same solution set.

Tips for row reducing by hand

  • If some row starts with 1, swap it to the top first; it keeps fractions out of the first column. The calculator does not do this, so its steps may show fractions where yours do not, but the RREF will match.
  • Clear one column completely before moving to the next, and always apply the operation to the whole row, including the entry after the bar.
  • Divide out common factors early: if every entry of a row is a multiple of 3, scale it by 1/3 before using it.
  • A row that turns into all zeros is not an error; it marks a dependent equation. Keep going.
  • Check the final answer by substituting into the original equations, not the reduced ones, since a slip in an early step carries into every later matrix.

Limitations

The calculator handles up to six rows and seven columns, enough for six equations in six unknowns, and every entry must be a number. It deliberately follows the hand method rather than the partial pivoting used in numerical software, which picks the largest available entry as each pivot to limit rounding error. With exact fractions there is no rounding error to limit, but it does mean the intermediate steps can differ from software that pivots, even though the final RREF is identical. For an inconsistent system it reports that no solution exists; it does not compute a least-squares compromise.

Related calculators

Sources

Row reduction is a deterministic algorithm, so the steps, matrices and tables above were computed directly by applying it to the matrices shown. The definitions follow these references:

โš ๏ธ Common mistakes & edge cases

Skipping the right-hand side

Every operation acts on the whole row, including the entry after the bar. In worked example 1, step 2 turns the right-hand 1 of row 3 into −9. Leaving it at 1 produces an answer that looks plausible and is wrong.

Stopping at row echelon form

When a question asks for the RREF, an REF is not finished. [1, −1, 2 | 5; 0, 1, 1/2 | 7/2; 0, 0, 1 | 3] still needs three more replacements to clear the entries above its pivots.

Reading a zero row as "no solution"

A row of zeros all the way across, [0, 0, 0 | 0], only says 0 = 0 and marks a redundant equation. The system has no solution only when a row reads [0, 0, 0 | c] with c not equal to 0.

Setting free variables to zero

Putting y = 0 in worked example 2 gives (5, 0, 1), which is one solution out of infinitely many. A complete answer keeps the parameter: x = 5 − 2t, y = t, z = 1.

Using an operation that is not elementary

Replacing a row with a combination that leaves it out, such as R3 → R1 + R2, or multiplying a row by 0, changes the solution set. A replacement must keep the row it replaces with a nonzero coefficient.

Rounding in the middle of the work

Writing 2/3 as 0.67 halfway through can leave 0.01 where an exact zero belongs, which creates a false pivot and changes the rank. Keep fractions until the end, as the calculator does.

Note: The arithmetic is exact for the numbers you enter. Intermediate steps follow the hand method and may differ from other tools, but the reduced row echelon form of a matrix is unique.

❓ Frequently asked questions

What is reduced row echelon form (RREF)?

Reduced row echelon form is the simplest form a matrix can be row-reduced to. Zero rows sit at the bottom, every nonzero row starts with a 1 called the pivot, each pivot lies to the right of the pivot above it, and each pivot is the only nonzero entry in its column. For example, [1, 2, 0 | 5; 0, 0, 1 | 1; 0, 0, 0 | 0] is in RREF. Every matrix has exactly one reduced row echelon form.

What is the difference between row echelon form and reduced row echelon form?

Both forms have zeros below every pivot, with the pivots stepping down to the right. Reduced row echelon form adds two requirements: every pivot equals 1, and every entry above a pivot is zero as well. The matrix [1, โˆ’1, 2 | 5; 0, 1, 1/2 | 7/2; 0, 0, 1 | 3] is in row echelon form; clearing the entries above its pivots turns it into the RREF [1, 0, 0 | 1; 0, 1, 0 | 2; 0, 0, 1 | 3]. A matrix has many row echelon forms but only one RREF.

How do you find the RREF of a matrix step by step?

Work column by column from the left. In each column, get a nonzero entry into the pivot position (swap rows if necessary), divide that row by the pivot so the pivot becomes 1, and subtract multiples of it from the rows below until every entry under the pivot is zero. Once every pivot is placed, work back up from the last pivot and clear the entries above each one. The calculator lists each of these row operations in order, with the matrix after every step.

What is the difference between Gaussian elimination and Gauss-Jordan elimination?

Gaussian elimination stops at row echelon form and finishes with back substitution in the equations: solve the last equation, then substitute upward. Gauss-Jordan elimination keeps row-reducing until the matrix is in reduced row echelon form, so the solution can be read straight from the last column. Gauss-Jordan needs a few more operations on large systems but leaves a cleaner final matrix, and it is the method this calculator uses.

Is the reduced row echelon form of a matrix unique?

Yes. Whatever sequence of row operations you choose, a matrix always reduces to the same RREF, which is why it is the standard answer format. The row echelon form is not unique: scaling a row or adding a lower row to a higher one produces another valid echelon form. If your row echelon form differs from an answer key, compare the reduced forms instead.

How can you tell from the RREF that a system has no solution?

Look for a row whose coefficient entries are all zero but whose right-hand side is not, such as [0, 0, 0 | 1]. It reads 0 = 1, which is impossible, so the system is inconsistent. Equivalently, the rank of the augmented matrix is larger than the rank of the coefficient matrix. A row that is zero all the way across, [0, 0, 0 | 0], is harmless: it reads 0 = 0 and only means one equation was redundant.

How do you write the solution when there are free variables?

Variables whose columns contain a pivot are basic; the others are free. Give each free variable a parameter, then solve each nonzero row of the RREF for its basic variable. For the RREF [1, 2, 0 | 5; 0, 0, 1 | 1; 0, 0, 0 | 0], y is free, so with y = t the solution is x = 5 โˆ’ 2t, y = t, z = 1, or x = (5, 0, 1) + t(โˆ’2, 1, 0) in vector form. The calculator writes both forms.

How do you find the rank of a matrix using row reduction?

Row-reduce the matrix and count the pivots. The rank equals the number of nonzero rows in any echelon form, which is the same as the number of pivot columns. The matrix [1, 2, 0, 3; 2, 4, 1, 7; 3, 6, 1, 10] reduces to [1, 2, 0, 3; 0, 0, 1, 1; 0, 0, 0, 0], with pivots in columns 1 and 3, so its rank is 2 and its nullity is 4 โˆ’ 2 = 2.

Can you find the inverse of a matrix with RREF?

Yes. Write the identity matrix beside the matrix to form [A | I] and row-reduce. If the left half becomes the identity, the right half is the inverse; if a row of zeros appears on the left, A has no inverse. For A = [0, 2, 1; 1, โˆ’1, 2; 2, 1, โˆ’1] the result is Aโปยน = [โˆ’1/13, 3/13, 5/13; 5/13, โˆ’2/13, 1/13; 3/13, 4/13, โˆ’2/13]. Enter the 3 ร— 6 matrix [A | I] here with the augmented box unticked.

Why do my row operations differ from the calculator's but give the same answer?

Row reduction has many valid paths. You might move a row with a leading 1 to the top to avoid fractions, or clear the columns in a different order, while the calculator follows one fixed rule: it uses the first row with a nonzero entry and swaps only when the current pivot is zero. The intermediate matrices, and even the row echelon form, can differ, but the reduced row echelon form is unique, so the final RREF must match exactly.

๐Ÿ’ก Good to know

Rounding can change the number of solutions

The system [1/3, 1/6 | 1/2; 2, 1 | 3] has infinitely many solutions, because its second row is 6 times the first: x = 3/2 − t/2, y = t. Round the first row to two decimals, [0.33, 0.17 | 0.5], and the rows stop being proportional, so the rounded system reports the single solution (1, 1). Exact fractions keep the whole line of solutions.

The RREF is a one-line invertibility test

A square matrix is invertible exactly when its RREF is the identity matrix. That single check is equivalent to a nonzero determinant, full rank, and a unique solution of Ax = b for every right-hand side b.

Every row operation is a matrix multiplication

Applying a row operation to A is the same as multiplying A on the left by an elementary matrix: the identity with that operation applied. Row reduction therefore writes RREF = Ek … E2E1A, which is why it never changes the solution set and why it leads directly to the LU factorization used in numerical software.

Related Calculators