RREF Calculator

Calculate the Reduced Row Echelon Form (RREF) of any matrix using Gauss-Jordan elimination. Get accurate results with step-by-step row operations, pivot identification, and solutions for linear systems, including unique, infinite, and inconsistent cases.

Rows
Columns
Share Your Feedback

How was your experience with this calculator?

RREF Calculator: Reduced Row Echelon Form of Any Matrix, with Step-by-Step Solutions

The reduced row echelon form (RREF) of a matrix is the simplest matrix you can reach using only row operations. Every pivot is (1), every pivot is the only nonzero entry in its column, and the pivots step down and to the right. Once a matrix is in RREF, the answers to most linear algebra questions (solutions of a system, rank, independence, null space) can simply be read off.

What Is Reduced Row Echelon Form?

A matrix is in reduced row echelon form when it satisfies all four of these conditions:

  1. Any row consisting entirely of zeros sits at the bottom.
  2. The first nonzero entry in each nonzero row (the leading entry, or pivot) is exactly (1).
  3. Each pivot lies strictly to the right of the pivot in the row above it.
  4. Each pivot is the only nonzero entry in its column.

Conditions 1 to 3 describe plain row echelon form (REF). Condition 4 is what makes it reduced. That extra requirement is what gives RREF its most useful property: every matrix has exactly one RREF, no matter which sequence of row operations you use to get there. Row echelon form has no such guarantee, because two people can reach different, equally valid echelon forms from the same matrix.

Here is a matrix already in RREF:

\[ \begin{bmatrix} 1 & 0 & 2 & 0 \\ 0 & 1 & -3 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]

The pivots sit in columns \(1\), \(2\) and \(4\). Column \(3\) has no pivot, so it will matter later as a free variable.

Row Echelon Form vs. Reduced Row Echelon Form

FeatureRow echelon form (REF)Reduced row echelon form (RREF)
Pivots equal (1)Not always requiredAlways
Zeros below pivotsYesYes
Zeros above pivotsNot requiredYes
Unique for a given matrixNoYes
Typical methodGaussian eliminationGauss-Jordan elimination
Solving a systemNeeds back-substitutionRead the answer directly

The Three Elementary Row Operations

Every step the calculator shows is one of three operations. None of them changes the solution set of the underlying system, which is why the method is safe.

  • Swap two rows: \(R_1 \leftrightarrow R_2\)
  • Scale a row by a nonzero number: \(R_2 = R_2 \div 4\)
  • Replace a row with itself plus a multiple of another row: \(R_3 = R_3 - 2R_1\)

That is the entire toolkit. Gauss-Jordan elimination is just a disciplined order for applying them.

How Gauss-Jordan Elimination Works

The algorithm moves through the matrix one column at a time, from left to right:

  1. Find a pivot. In the current column, look at the rows from the current pivot position downward and pick the first nonzero entry.
  2. Swap if needed. If that entry is not already in the pivot row, swap the two rows.
  3. Scale the pivot to (1). Divide the pivot row by the pivot value.
  4. Clear the column. Use the pivot row to turn every other entry in that column, above and below, into (0).
  5. Move on. Shift one row down and one column right, then repeat. If a column has no usable pivot, skip to the next column without moving down.

The calculator follows exactly this routine, and it labels each operation in plain language (for example, "Subtract row (1) multiplied by (2) from row (3)") next to the matrix it produces. That is deliberate: the goal of a step-by-step tool is that you can follow the logic, not just trust the output.

How to Use the RREF Calculator

  1. Set the size. Choose the number of rows and columns. For an augmented matrix, include the constants column as the last column.
  2. Enter your values. Type integers, decimals, or fractions. Entries such as (0.5) and (1/2) are treated as the same exact number.
  3. Run the calculation. The tool reduces the matrix with Gauss-Jordan elimination.
  4. Read the steps. Each line states the operation and shows the matrix after it.
  5. Take the final RREF. The last step gives the reduced matrix in clean notation.

Worked Example 1: A System With a Unique Solution

Solve: \[ x + y + z = 6 \] \[ 2y + 5z = -4 \] \[ 2x + 5y - z = 27 \]

Write it as an augmented matrix: \[ \left[ \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 2 & 5 & -4 \\ 2 & 5 & -1 & 27 \end{array} \right] \]

Column 1. The pivot in row \(1\) is already \(1\). Clear below it with \(R_3 = R_3 - 2R_1\): \[ \left[ \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 2 & 5 & -4 \\ 0 & 3 & -3 & 15 \end{array} \right] \]

Column 2. The pivot candidate in row \(2\) is \(2\), so divide row \(2\) by \(2\): \[ \left[ \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & \frac{5}{2} & -2 \\ 0 & 3 & -3 & 15 \end{array} \right] \] Now clear the rest of the column. \(R_1 = R_1 - R_2\) and \(R_3 = R_3 - 3R_2\): \[ \left[ \begin{array}{ccc|c} 1 & 0 & -\frac{3}{2} & 8 \\ 0 & 1 & \frac{5}{2} & -2 \\ 0 & 0 & -\frac{21}{2} & 21 \end{array} \right] \]

Column 3. Divide row \(3\) by \(-\frac{21}{2}\), which turns the pivot into \(1\) and the right side into \(-2\): \[ \left[ \begin{array}{ccc|c} 1 & 0 & -\frac{3}{2} & 8 \\ 0 & 1 & \frac{5}{2} & -2 \\ 0 & 0 & 1 & -2 \end{array} \right] \]

Clear above it with \(R_1 = R_1 + \frac{3}{2}R_3\) and \(R_2 = R_2 - \frac{5}{2}R_3\): \[ \left[ \begin{array}{ccc|c} 1 & 0 & 0 & 5 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & -2 \end{array} \right] \] The solution is \(x = 5\), \(y = 3\), \(z = -2\).

Check it: \(5 + 3 - 2 = 6\) \(\checkmark\), \(2(3) + 5(-2) = -4\) \(\checkmark\), \(2(5) + 5(3) - (-2) = 27\) \(\checkmark\).

Notice the fractions in the middle. Doing this by hand, one wrong sign on \(\frac{5}{2}\) ruins everything that follows. This is where exact fraction handling in a calculator earns its keep.

Worked Example 2: Infinitely Many Solutions (Free Variables)

Solve:

\[ x + 2y + z = 4 \] \[ 2x + 4y + 3z = 9 \] \[ x + 2y + 2z = 5 \]

Augmented matrix: \[ \left[ \begin{array}{ccc|c} 1 & 2 & 1 & 4 \\ 2 & 4 & 3 & 9 \\ 1 & 2 & 2 & 5 \end{array} \right] \]

Clear column \(1\) with \(R_2 = R_2 - 2R_1\) and \(R_3 = R_3 - R_1\): \[ \left[ \begin{array}{ccc|c} 1 & 2 & 1 & 4 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 \end{array} \right] \]

Column \(2\) has no nonzero entry from row \(2\) downward, so there is no pivot there. The algorithm skips to column \(3\), where row \(2\) already holds a \(1\).

Clear that column with \(R_1 = R_1 - R_2\) and \(R_3 = R_3 - R_2\): \[ \left[ \begin{array}{ccc|c} 1 & 2 & 0 & 3 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{array} \right] \]

The pivot columns are \(1\) and \(3\).

Column \(2\) (the \(y\) column) is a free column, so \(y\) can be any real number.

Set \(y = t\): \[ x = 3 - 2t \] \[ y = t \] \[ z = 1 \]

Check it with \(t = 1\): \(x = 1\), \(y = 1\), \(z = 1\) gives \(1 + 2 + 1 = 4\) \(\checkmark\), \(2 + 4 + 3 = 9\) \(\checkmark\), \(1 + 2 + 2 = 5\) \(\checkmark\).

A zero row combined with a free column is the signature of a dependent system with infinitely many solutions.

Worked Example 3: No Solution

Solve: \[ x + y = 2 \] \[ 2x + 2y = 5 \]

Augmented matrix and its RREF: \[ \left[ \begin{array}{cc|c} 1 & 1 & 2 \\ 2 & 2 & 5 \end{array} \right] \rightarrow \left[ \begin{array}{cc|c} 1 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right] \]

The second row reads \(0 = 1\), which is impossible. In RREF terms, a pivot in the augmented (constants) column means the system is inconsistent. Geometrically, these are two parallel lines that never meet.

Worked Example 4: Finding a Matrix Inverse With RREF

To invert a square matrix \(A\), reduce the augmented matrix \([A \mid I]\).

If the left side becomes \(I\), the right side becomes \(A^{-1}\).

Take \(A = \begin{bmatrix} 2 & 1 \\ 5 & 3 \end{bmatrix}\):

\[ \left[ \begin{array}{cc|cc} 2 & 1 & 1 & 0 \\ 5 & 3 & 0 & 1 \end{array} \right] \]

\[ \begin{aligned} R_1 = R_1 \div 2 &\;\text{ gives }\; \left[\,1,\ \tfrac{1}{2} \mid \tfrac{1}{2},\ 0\,\right] \\[4pt] R_2 = R_2 - 5R_1 &\;\text{ gives }\; \left[\,0,\ \tfrac{1}{2} \mid -\tfrac{5}{2},\ 1\,\right] \\[4pt] R_2 = 2R_2 &\;\text{ gives }\; \left[\,0,\ 1 \mid -5,\ 2\,\right] \\[4pt] R_1 = R_1 - \tfrac{1}{2}R_2 &\;\text{ gives }\; \left[\,1,\ 0 \mid 3,\ -1\,\right] \end{aligned} \]

Result: \[ \left[ \begin{array}{cc|cc} 1 & 0 & 3 & -1 \\ 0 & 1 & -5 & 2 \end{array} \right] \] So \(A^{-1} = \begin{bmatrix} 3 & -1 \\ -5 & 2 \end{bmatrix}\).

Check it: the determinant of \(A\) is \(2 \cdot 3 - 1 \cdot 5 = 1\), and for a \(2 \times 2\) matrix the inverse is \(\frac{1}{\det A}\) times \(\begin{bmatrix} 3 & -1 \\ -5 & 2 \end{bmatrix}\), which matches. If the left block can never reach the identity, the matrix is singular and has no inverse.

Reading Information Straight From the RREF

Once you have the RREF, several properties become immediate.

Rank. The rank of a matrix is the number of nonzero rows in its RREF, which equals the number of pivots. In Example 1 the rank is (3); in Example 2 it is (2).

Consistency. A system is consistent exactly when no pivot sits in the augmented column. By the Rouché–Capelli theorem, that is the same as saying \((\operatorname{rank}\)(A) = \(\operatorname{rank}\)([A \(\mid\) \(\mathbf{b}]\))).

Uniqueness of the solution. If every variable column has a pivot, the solution is unique. If at least one variable column has no pivot, and the system is consistent, there are infinitely many solutions.

Linear independence. Put your vectors in as columns and reduce. If every column has a pivot, the vectors are linearly independent. A non-pivot column is a combination of the pivot columns to its left, and its entries in the RREF tell you exactly which combination.

Basis for the column space. The pivot columns of the original matrix (not of the RREF) form a basis for the column space. A common mistake is to take columns from the reduced matrix, which describes a different set of vectors.

Null space. Solve (\(A\mathbf{x}\) = \(\mathbf{0})\) using the RREF and write each pivot variable in terms of the free variables. The vectors multiplying each free variable form a basis for the null space.

Invertibility. An (n \(\times\) n) matrix is invertible if and only if its RREF is the identity matrix. That single fact connects RREF to determinants: the determinant calculator will return a nonzero value for exactly the same matrices.

Common Mistakes When Reducing by Hand

  • Dropping a sign when subtracting a negative multiple. Write the operation out in full before applying it.
  • Clearing only below the pivot. That gives echelon form, not reduced echelon form. Gauss-Jordan clears above as well.
  • Scaling by zero. Row scaling must use a nonzero number, otherwise you destroy information.
  • Forgetting the right-hand side. On an augmented matrix, every operation must be applied across the whole row, constants included.
  • Mixing rows and columns. Row operations on an augmented system are valid. Column operations are not, since they change the variables.
  • Rounding too early. Converting (\frac{1}{3}) to (0.33) midway can turn a clean answer into a messy one. Keep fractions exact.

Why Exact Arithmetic Matters

Most textbook matrices have integer entries, but elimination quickly produces fractions. Floating-point tools store \((\frac{1}{3})\) as an approximation, and after a few operations the error can make a true zero look like (0.0000000001), which can lead software to place a pivot where none exists. The trade-off is that very large matrices with awkward entries can produce long fractions. That is the honest cost of exactness, and for coursework-sized problems it is the right choice.

The calculator handles any rectangular matrix, including wide, tall, singular, and rank-deficient ones, so you can use it for (2 \(\times\) 2) up through larger systems such as (4 \(\times\) 4) and beyond, with or without an augmented column.

Where RREF Shows Up in Practice

Row reduction is not just a classroom exercise.

  • Engineering: solving circuit equations with Kirchhoff's laws, or balancing forces in a truss.
  • Chemistry: balancing chemical equations by finding the null space of an atom-count matrix.
  • Economics: Leontief input-output models, which are systems of linear equations.
  • Computer graphics and robotics: solving for transformations and checking whether a set of constraints is independent.
  • Data science: detecting redundant (collinear) features through rank.
  • Coding theory and cryptography: the same procedure, carried out modulo a prime, reduces matrices over finite fields.

These topics sit in the same cluster as RREF and are worth learning together.

Frequently Asked Questions

What does RREF stand for? Reduced row echelon form. It is the unique fully simplified form of a matrix under elementary row operations.

Is RREF the same as Gaussian elimination? Not quite. Gaussian elimination stops at row echelon form and finishes with back-substitution. Gauss-Jordan elimination continues until the matrix is in RREF, so no back-substitution is needed.

Can two different people get different RREFs for the same matrix? No. The RREF is unique. Their intermediate steps may differ, but the final matrix will match.

How do I use an RREF calculator for an augmented matrix? Put the coefficients and the constants in one matrix, with the constants as the final column, and reduce it. Read the solution from the last column, using the rules above for free variables and inconsistency.

Can I use it on a non-square matrix? Yes. RREF is defined for any matrix, square or rectangular.

What if my matrix has a zero in the pivot position? The algorithm swaps in a lower row that has a nonzero entry in that column. If none exists, it skips that column, and it becomes a free column.

How do I know the answer is right? Substitute the solution back into the original equations, as in the examples above. For an inverse, multiply (A) by the result and confirm you get the identity matrix.

Does the order of row operations change the answer? It changes the path, never the destination.

Learn More From Authoritative Sources

For a deeper treatment of row reduction and its theory, these are standard references:

  • Gilbert Strang, Introduction to Linear Algebra, and his MIT OpenCourseWare course 18.06, Linear Algebra
  • David C. Lay, Linear Algebra and Its Applications, which introduces echelon forms and pivots in its first chapter, Linear Algebra

Author's Review

This content has been reviewed by the theMathex Engineering team.