What is the RREF of this matrix?
Calculate reduced row echelon form of matrices. Linear algebra and mathematics tool.
- RREF
- [1, 0, -1; 0, 1, 2; 0, 0, 0]
The reduced row echelon form is [1, 0, -1; 0, 1, 2; 0, 0, 0], with rank 2.
- RREF in decimals
- [1, 0, -1; 0, 1, 2; 0, 0, 0]
- Rank
- 2
- Pivot columns
- 1, 2
- Columns without a pivot
- 3
- Row operations
- R2 → R2 − 4 × R1; R3 → R3 − 7 × R1; R2 → -1/3 × R2; R1 → R1 − 2 × R2; R3 → R3 + 6 × R2
RREF: [1, 0, -1; 0, 1, 2; 0, 0, 0]. The reduced row echelon form is [1, 0, -1; 0, 1, 2; 0, 0, 0], with rank 2.
How it is worked out
How to calculate
Reduces a matrix to reduced row echelon form (RREF) by Gauss-Jordan elimination in exact fractions, with the rank, the pivot columns, and every row operation.
Example with the default inputs (Matrix [1, 2, 3; 4, 5, 6; 7, 8, 9]): The reduced row echelon form is [1, 0, -1; 0, 1, 2; 0, 0, 0], with rank 2.
Method: Gauss-Jordan elimination: for each column from the left, take the first remaining row with a nonzero entry as the pivot row, swap it up, scale it so the pivot is 1, and subtract multiples of it from every other row so the rest of the column is 0.
- Every entry is read as an exact fraction: a decimal such as 0.1 is 1/10, so there is no rounding in the elimination.
- The pivot is the first row, from the top of the remaining rows, with a nonzero entry in the column. Other valid orders of row operations give the same RREF.
- The matrix has 1 to 10 rows and 1 to 10 columns.
Worked examples
Each example is checked against the calculator on every build.
- Matrix 1, 2, 3; 4, 5, 6; 7, 8, 9 gives RREF [1, 0, -1; 0, 1, 2; 0, 0, 0], Rank 2, Pivot columns 1, 2, Columns without a pivot 3.Source: MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang), Lecture 7: Solving Ax = 0, pivot variables, special solutions (reduced row echelon form). https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/resources/lecture-7-solving-ax-0-pivot-variables-special-solutions/
- Matrix 1, 1, 1, 6; 0, 2, 5, -4; 2, 5, -1, 27 gives RREF [1, 0, 0, 5; 0, 1, 0, 3; 0, 0, 1, -2], Rank 3, Pivot columns 1, 2, 3, Columns without a pivot 4.Source: MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang), Lecture 7: Solving Ax = 0, pivot variables, special solutions (reduced row echelon form). https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/resources/lecture-7-solving-ax-0-pivot-variables-special-solutions/
- Matrix 1, 3, -2, 0, 2, 0, 0; 2, 6, -5, -2, 4, -3, -1; 0, 0, 5, 10, 0, 15, 5; 2, 6, 0, 8, 4, 18, 6 gives RREF [1, 3, 0, 4, 2, 0, 0; 0, 0, 1, 2, 0, 0, 0; 0, 0, 0, 0, 0, 1, 1/3; 0, 0, 0, 0, 0, 0, 0], Rank 3, Pivot columns 1, 3, 6, Columns without a pivot 2, 4, 5, 7.Source: MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang), Lecture 7: Solving Ax = 0, pivot variables, special solutions (reduced row echelon form). https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/resources/lecture-7-solving-ax-0-pivot-variables-special-solutions/
- Matrix 0.1, 0.2, 0.3; 0.4, 0.5, 0.6 gives RREF [1, 0, -1; 0, 1, 2], Rank 2, Row operations R1 → 10 × R1; R2 → R2 − 2/5 × R1; R2 → -10/3 × R2; R1 → R1 − 2 × R2.Source: MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang), Lecture 7: Solving Ax = 0, pivot variables, special solutions (reduced row echelon form). https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/resources/lecture-7-solving-ax-0-pivot-variables-special-solutions/
- Matrix 0, 0; 0, 0 gives RREF [0, 0; 0, 0], Rank 0, Pivot columns none, Columns without a pivot 1, 2, Row operations none: the matrix is already in RREF.Source: MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang), Lecture 7: Solving Ax = 0, pivot variables, special solutions (reduced row echelon form). https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/resources/lecture-7-solving-ax-0-pivot-variables-special-solutions/
Understanding Reduced Row Echelon Form (RREF)
In linear algebra, solving a complex system of equations can feel like untangling a knotted web. Reduced Row Echelon Form, or RREF, transforms that tangled web into a simple form where the answers are laid out clearly. Every matrix has its own unique RREF.
RREF rules
- All-zero rows at the bottom. Zero rows are moved to the bottom.
- Leading 1s in every row. The first non-zero number in each other row must be 1.
- Staircase pattern. Leading 1s step down and to the right.
- Clean pivot columns. Zeros above and below each pivot.
For example, [1, 0, 0, 10; 0, 1, 0, 4; 0, 0, 0, 0] is in RREF. [1, 3; 0, 1] is not: the second column has a 3 above the leading 1, where RREF needs a 0.
Understanding your results
Read the RREF of an augmented matrix (the last column holds the constants) row by row:
- Unique solution. [1, 0, 0, 5; 0, 1, 0, -2; 0, 0, 1, 3] means x = 5, y = −2, z = 3.
- No solution. A row such as [0, 0, 0, 1] means 0 = 1, so the system is inconsistent.
- Infinite solutions. [1, -2, 0, 5; 0, 0, 1, 3; 0, 0, 0, 0] has no pivot in the second column, so y is free: y = t, x = 5 + 2t, z = 3.
How it works
The calculator uses Gauss-Jordan elimination with three elementary row operations:
- Swap rows: R₁ ↔ R₂
- Scale a row: R₁ → k × R₁
- Replace a row: R₁ → R₁ + k × R₂
For each column, from left to right:
- Find the first row, from the top of the rows not yet used as pivot rows, that has a nonzero entry in this column. If there is none, move to the next column.
- Swap that row up to the next pivot position (if it is not already there).
- Scale it so the pivot entry is 1 (if it is not already 1).
- For every other row with a nonzero entry in this column, subtract that entry times the pivot row, so the rest of the column is 0.
Every entry is converted to an exact fraction first (a decimal such as 0.1 is exactly 1/10), and all arithmetic is exact.
The page shows:
- RREF as exact fractions in lowest terms (for example 1/3 or -2/5), rows separated by semicolons.
- RREF in decimals, each number rounded to 10 significant figures. Numbers of 10²¹ or more, or under 10⁻⁶ (other than 0), are written in e-notation, for example 1.4e+22 or 1.5e-7.
- Rank: the number of pivots.
- Pivot columns and columns without a pivot, counted from 1 ("none" when the list is empty).
- Row operations: every operation in order, rows counted from 1. "R2 → R2 − 4 × R1" means subtract 4 times row 1 from row 2. The same text is listed step by step under "How it is worked out".
Assumptions
- The matrix has 1 to 10 rows and 1 to 10 columns of real numbers, typed as integers or decimals.
- Old links from the previous version of this page (rows, cols, and cells m00 to m99) still open the same matrix. A cell written as a fraction such as 3/2 in an old link is read as its decimal value, 1.5.
Worked examples by hand
The default matrix [1, 2, 3; 4, 5, 6; 7, 8, 9].
- Column 1: row 1 has a 1, so it is the pivot row. R2 → R2 − 4 × R1 gives [0, -3, -6]. R3 → R3 − 7 × R1 gives [0, -6, -12].
- Column 2: row 2 is the pivot row. R2 → -1/3 × R2 gives [0, 1, 2]. R1 → R1 − 2 × R2 gives [1, 0, -1]. R3 → R3 + 6 × R2 gives [0, 0, 0].
- Column 3: no remaining row has a nonzero entry.
RREF = [1, 0, -1; 0, 1, 2; 0, 0, 0], rank 2, pivot columns 1, 2, column without a pivot 3.
A system of three equations. x + y + z = 6, 2y + 5z = −4, 2x + 5y − z = 27, as the augmented matrix [1, 1, 1, 6; 0, 2, 5, -4; 2, 5, -1, 27].
- R3 → R3 − 2 × R1 gives [0, 3, -3, 15].
- R2 → 1/2 × R2 gives [0, 1, 5/2, -2]. R1 → R1 − R2 gives [1, 0, -3/2, 8]. R3 → R3 − 3 × R2 gives [0, 0, -21/2, 21].
- R3 → -2/21 × R3 gives [0, 0, 1, -2]. R1 → R1 + 3/2 × R3 gives [1, 0, 0, 5]. R2 → R2 − 5/2 × R3 gives [0, 1, 0, 3].
RREF = [1, 0, 0, 5; 0, 1, 0, 3; 0, 0, 1, -2]: x = 5, y = 3, z = −2. Check: 5 + 3 − 2 = 6; 6 − 10 = −4; 10 + 15 + 2 = 27.
Decimals are exact. [0.1, 0.2, 0.3; 0.4, 0.5, 0.6] is [1/10, 1/5, 3/10; 2/5, 1/2, 3/5].
- R1 → 10 × R1 gives [1, 2, 3]. R2 → R2 − 2/5 × R1 gives [0, -3/10, -3/5].
- R2 → -10/3 × R2 gives [0, 1, 2]. R1 → R1 − 2 × R2 gives [1, 0, -1].
RREF = [1, 0, -1; 0, 1, 2], rank 2.
Other questions people ask
What is an RREF calculator?
An RREF calculator is a digital tool that automates the process of transforming a matrix into its Reduced Row Echelon Form. It uses an algorithm called Gauss-Jordan elimination to perform the necessary row operations, helping you quickly and accurately solve systems of linear equations, find a matrix's rank, or assist in finding a matrix inverse.
What's the difference between RREF and REF?
Both are simplified matrix forms, but RREF is more 'reduced.' Row Echelon Form (REF), achieved via Gaussian elimination, ensures all entries below a pivot are zero. Reduced Row Echelon Form (RREF), achieved via Gauss-Jordan elimination, goes a step further and ensures all entries both above and below a pivot are zero. This makes RREF unique and allows you to read the solution to a system directly, whereas REF often requires an extra step of back-substitution.
Does every matrix have a unique RREF?
Yes. This is guaranteed by a fundamental result in linear algebra called the Uniqueness Theorem. It states that any matrix is row-equivalent to one, and only one, matrix in reduced row echelon form. This means that even if you and our calculator use different sequences of valid row operations, the final answer will always be the same.
How do I know if my system has no solution from the RREF?
You have an inconsistent system (no solution) if the RREF of its augmented matrix contains a row with all zeros on the left of the augmentation line and a non-zero number on the right. For example, a row like [0 0 0 | 1] translates to the impossible equation 0 = 1, proving that no solution exists.
What are free variables in an RREF?
Free variables arise when a system has infinitely many solutions. In the RREF of an augmented matrix, if a column corresponding to a variable does not contain a pivot (a leading 1), that variable is a 'free variable.' It can be set to any value (often represented by a parameter like t), and the other ('basic') variables will be expressed in terms of it.
Can this calculator handle fractions and decimals?
Yes. You can input integers (like 5) and decimals (like 1.5). To ensure the most accurate results, the calculator converts every decimal into its exact fractional equivalent (1.5 is 3/2) before performing any calculations, and shows the RREF as exact fractions and as decimals. To enter a fraction such as 1/3, which has no exact decimal, type the whole row multiplied by 3 instead: scaling a row does not change the RREF.
What algorithm does this calculator use?
This calculator implements the Gauss-Jordan elimination algorithm. This method systematically applies a sequence of three elementary row operations (swapping, scaling, and replacement) to transform any input matrix into its unique Reduced Row Echelon Form. It works in exact fractions, so there are no rounding errors to control.
Why are the steps shown by the calculator different from my manual calculation?
There are many valid paths to get to the RREF of a matrix. You might choose to clear a row or scale a row in a different order than our algorithm. Our calculator uses one consistent sequence: for each column from the left, the first remaining row with a nonzero entry becomes the pivot row. While your intermediate matrices may look different from ours, the Uniqueness Theorem guarantees that your final RREF will be identical to ours, provided no arithmetic errors were made.