# What is the RREF of this matrix?

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.

- Page: https://www.acalculator.org/math/rref-calculator
- JSON spec: https://www.acalculator.org/math/rref-calculator.json
- Version: e6b23f16650e

## Default answer

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.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| m | Matrix | The matrix to reduce, 1 to 10 rows and columns. For a system of equations, the last column holds the constants. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| rref | RREF | The reduced row echelon form as exact fractions, rows separated by semicolons. |
| decimal | RREF in decimals | The same matrix in decimals, each number rounded to 10 significant figures. |
| rank | Rank | The number of pivots (leading 1s). |
| pivots | Pivot columns | The columns that hold a leading 1, counted from 1. |
| free | Columns without a pivot | The columns with no leading 1: the free variables of a homogeneous system, counted from 1. |
| steps | Row operations | Every row operation, in order: swap two rows, scale a row, or add a multiple of one row to another. |

## 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.

## Assumptions

- 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

1. m = 1 or 2 or 4 or 5 gives rref = [1, 0, -1; 0, 1, 2; 0, 0, 0], rank = 2, pivots = 1, 2, free = 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/.
2. m = 1 or 1 or 0 or 2 gives rref = [1, 0, 0, 5; 0, 1, 0, 3; 0, 0, 1, -2], rank = 3, pivots = 1, 2, 3, free = 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/.
3. m = 1 or 3 or 2 or 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, pivots = 1, 3, 6, free = 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/.
4. m = 0.1 or 0.2 or 0.4 or 0.5 gives rref = [1, 0, -1; 0, 1, 2], rank = 2, steps = 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/.
5. m = 0 or 0 or 0 or 0 gives rref = [0, 0; 0, 0], rank = 0, pivots = none, free = 1, 2, steps = 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/.

## FAQ

### 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.

## Sources

- 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/
