Audited 29 Jul 2026·Last updated 31 Jul 2026·5 citations·Tier 1·0 uses

Row Echelon Form Calculator (REF and RREF)

Row reduce any matrix up to 6x6 to row echelon or reduced row echelon form, with the rank, pivot and free columns, and a column space basis.

Row Echelon Form Calculator

One row per line, up to 6 rows and 6 columns. Separate entries with commas or spaces. Fractions like 1/2 are accepted. For a system Ax = b, enter the augmented matrix [A | b].
Which form?
Echelon form
[1, 0, 0, 52; 0, 1, 0, -45; 0, 0, 1, -42]
Rows are separated by a semicolon. RREF is unique — every correct route reaches the same matrix. REF is not unique: this page always uses the first non-zero row as the pivot and scales every pivot to 1, so your textbook may show a different but equally correct REF.
Rank
3
What the rank means
Full row rank 3 — the 3 rows are independent, so Ax = b is solvable for every b
Pivot columns
1, 2, 3
Free columns
4
Column space basis
(1, 2, -2), (2, 3, 0), (-1, -1, -3)
Row operations used
8

Background.

This row echelon form calculator row reduces any matrix up to 6 by 6 and shows you what the result means. Pick reduced row echelon form (RREF) or plain row echelon form (REF), type the matrix one row per line, and you get the echelon matrix itself plus the rank, the pivot columns, the free columns, a basis for the column space, and a count of the elementary row operations the reduction took. If you are solving a system Ax = b, enter the augmented matrix [A | b] and read the solution straight off the reduced form.

Row reduction is the single most-used algorithm in linear algebra because so many questions collapse into it. Solving a linear system, deciding whether a set of vectors is independent, finding the rank, inverting a matrix, computing a determinant, extracting a basis for the column space or the null space — every one of those is row reduction with a different question asked at the end. The mechanics are three reversible moves: swap two rows, multiply a row by a non-zero number, and add a multiple of one row to another. None of them changes the solution set of the system the matrix represents, which is exactly why the technique is legitimate.

A matrix is in row echelon form when all its zero rows sit at the bottom, and the leading entry of each non-zero row lies strictly to the right of the leading entry of the row above, with only zeros beneath each leading entry. Reduced row echelon form adds two more conditions: every leading entry equals 1, and each of those leading 1s is the only non-zero number in its column. The leading entries are called pivots, and the columns that hold them are the pivot columns.

One fact about these two forms matters more than any other, and it is the reason this page names its conventions in the open rather than in a footnote. **RREF is unique — REF is not.** Every matrix is row equivalent to exactly one matrix in reduced row echelon form, no matter which legal sequence of operations you use to get there. There is no such theorem for plain row echelon form: different sequences give genuinely different row echelon forms, and all of them are correct. So if your REF disagrees with the one shown here, neither of you is necessarily wrong. This calculator fixes one sequence so its answers are reproducible: it works left to right, takes the first non-zero row at or below the current one as the pivot rather than hunting for the largest entry, always scales the pivot to 1, and in REF mode clears only the entries below each pivot. Scaling the pivot to 1 is itself a convention — some definitions of row echelon form do not require it — so a textbook that skips that step will show your rows differing from these by a scale factor.

The rank is the number of pivots, and it is the same whichever echelon form you use, because the pivot positions do not change. Rank counts the independent rows, and simultaneously the independent columns, and equals the dimension of the column space. The page turns that number into a plain-language verdict: full rank means a square matrix is invertible and its reduced form is the identity; full row rank means Ax = b can be solved for every b; full column rank means Ax = 0 has only the zero solution; rank deficient means both the rows and the columns carry redundancy.

The column space basis output is where students most often go wrong, so the page computes it explicitly. A basis for the column space of A is the set of pivot columns **of the original matrix**, not of the echelon form. Row operations preserve which columns are independent, but they change what the columns actually are — the echelon form's columns span a different subspace. Only the pivot positions transfer, and then you go back to A and take those columns.

What is row echelon form calculator?

A matrix is in row echelon form (REF) when three conditions hold: every all-zero row is below every non-zero row; the leading (first non-zero) entry of each row lies strictly to the right of the leading entry of the row above it; and every entry below a leading entry is zero. It is in reduced row echelon form (RREF) when, in addition, every leading entry equals 1 and each leading 1 is the only non-zero entry in its column. The leading entries are the pivots and their columns are the pivot columns; all other columns are free columns. Any matrix can be brought to either form by elementary row operations — swapping two rows, scaling a row by a non-zero constant, and adding a multiple of one row to another — a process called Gaussian elimination (to REF) or Gauss–Jordan elimination (to RREF). These operations never change the solution set of the associated system, which is why the reduced matrix can be read as if it were the original. The reduced row echelon form of a matrix is unique: every matrix is row equivalent to one and only one RREF matrix, regardless of the sequence of operations used. Plain row echelon form is not unique. The number of pivots is the rank of the matrix; it equals the number of linearly independent rows, the number of linearly independent columns, and the dimension of the column space. The pivot columns of the original matrix form a basis for its column space, while the number of free columns is the dimension of its null space — together the rank–nullity theorem, rank + nullity = number of columns.

How to use this calculator.

  1. Type your matrix one row per line, using commas or spaces between entries. A semicolon works instead of a line break, and fractions like 1/2 are accepted directly.
  2. To solve a system Ax = b, enter the augmented matrix [A | b] — the coefficients followed by the right-hand side as the last column.
  3. Choose RREF if you want the unique, fully reduced answer, which is what you need to read solutions off directly. Choose REF if your assignment asks for forward elimination only.
  4. Read the echelon matrix at the top. Rows are separated by semicolons.
  5. Read the rank and the verdict beside it to learn what the matrix can and cannot do — whether it is invertible, whether Ax = b always has a solution, whether Ax = 0 has only the zero solution.
  6. Read the pivot columns to see which variables are determined and the free columns to see which are free to choose.
  7. For a column space basis, use the vectors given — they are the pivot columns of your original matrix, not of the reduced one.
  8. If your REF differs from the one shown, check the conventions note: REF is not unique, and this page always scales each pivot to 1.

The formula.

A → E₁E₂…Eₖ A = R rank = number of pivots

Elimination walks the columns from left to right, carrying a current row index. At each column it looks for the first row at or below the current one whose entry in that column is non-zero. If there is none, the column has no pivot and becomes a free column, and the algorithm moves on without advancing the row index. If there is one, it is swapped up if necessary, the whole row is divided by that entry so the pivot becomes 1, and multiples of the pivot row are subtracted from other rows to clear the rest of the column — from the rows below only, in REF mode, or from every other row in RREF mode. The row index then advances and the process repeats. The number of pivots produced is the rank. Two choices in that description are conventions rather than mathematics, and both are stated on the page because they change what you see: the pivot is chosen as the first non-zero candidate rather than the largest, which makes the output match a hand computation instead of a numerically optimised one; and every pivot is scaled to 1, which some definitions of row echelon form do not require. Neither choice affects the RREF, which is unique, but both affect the REF, which is not. Rounding never enters the mathematics. All arithmetic runs at 60 significant digits, and an entry is only treated as zero when its magnitude falls at or below 1e-20 times the largest magnitude in the input matrix — a threshold that never fires on a matrix of exact decimals. Rounding is applied at display time only: an entry is shown as an exact fraction whenever one with a denominator up to 1000 fits, and otherwise to 6 decimal places, which is why reducing [[3, 1], [0, 0]] prints 1/3 rather than 0.333333. The rank verdict classifies the unrounded integer rank against the unrounded row and column counts; no displayed value takes part in it.

A worked example.

Example

Take the 3 by 4 matrix A with rows (1, 2, −1, 4), (2, 3, −1, 11) and (−2, 0, −3, 22) — read as an augmented matrix, this is a system of three equations in three unknowns. Clearing the first column takes two operations: R2 ← R2 − 2R1 gives (0, −1, 1, 3), and R3 ← R3 + 2R1 gives (0, 4, −5, 30). The second pivot is the −1 now sitting in row 2, so R2 ← −R2 scales it to 1, giving (0, 1, −1, −3). Clearing the rest of column 2 takes two more operations: R1 ← R1 − 2R2 gives (1, 0, 1, 10) and R3 ← R3 − 4R2 gives (0, 0, −1, 42). Scaling that last pivot with R3 ← −R3 gives (0, 0, 1, −42), and two final operations clear column 3: R1 ← R1 − R3 gives (1, 0, 0, 52) and R2 ← R2 + R3 gives (0, 1, 0, −45). The reduced row echelon form is therefore [1, 0, 0, 52; 0, 1, 0, −45; 0, 0, 1, −42], reached in 8 elementary row operations, and read as a system it says x = 52, y = −45, z = −42. Stopping after forward elimination instead — steps 1, 2, 3, 5 and 6 only, since the other three clear entries above a pivot — gives the row echelon form [1, 2, −1, 4; 0, 1, −1, −3; 0, 0, 1, −42] in 5 operations. Both forms have pivots in columns 1, 2 and 3, so the rank is 3 and column 4 is free. Because the rank equals the number of rows but not the number of columns, the matrix has full row rank. The column space basis is columns 1, 2 and 3 of the original A — (1, 2, −2), (2, 3, 0) and (−1, −1, −3) — and emphatically not the columns of the reduced matrix, which span a different subspace entirely.

formrref
matrix1, 2, -1, 4 2, 3, -1, 11 -2, 0, -3, 22

Frequently asked questions.

What is the difference between row echelon form and reduced row echelon form?
Row echelon form only requires that zero rows sit at the bottom, that each leading entry is to the right of the one above it, and that everything below a leading entry is zero. Reduced row echelon form adds two conditions: each leading entry must be exactly 1, and each of those leading 1s must be the only non-zero number in its column. In practice REF is what you get from forward elimination alone, while RREF continues with back-substitution to clear the entries above each pivot too. In the worked example, forward elimination takes 5 operations to reach REF and 3 more to finish the job in RREF.
Is the row echelon form of a matrix unique?
The reduced row echelon form is unique — every matrix is row equivalent to one and only one RREF matrix, whichever legal sequence of operations you use. Plain row echelon form is not unique, and this trips up a lot of students comparing answers. Different orders of operations give different, equally valid row echelon forms. This calculator fixes one sequence so its output is reproducible: pivot on the first non-zero row rather than the largest entry, and always scale the pivot to 1. If your textbook does not scale the pivots, your rows will differ from these by a constant factor per row and both answers are correct.
How do I find the rank from the echelon form?
Count the pivots — the leading entries of the non-zero rows. That number is the rank, and it is the same whether you stop at REF or continue to RREF, because row reduction never changes which columns hold pivots. The rank simultaneously counts the independent rows and the independent columns, which is not obvious but is always true, and it equals the dimension of the column space. In the worked example the pivots sit in columns 1, 2 and 3, so the rank is 3.
How do I get a basis for the column space from the RREF?
Find which columns hold pivots, then take those columns from the ORIGINAL matrix — not from the reduced one. This is the most common mistake in the whole topic. Row operations preserve the dependency relationships among the columns, so the pivot positions correctly identify which columns are independent, but the operations do change the columns themselves, and the reduced matrix's columns span a different subspace. In the worked example the pivots are in columns 1, 2 and 3, so a basis is (1, 2, −2), (2, 3, 0) and (−1, −1, −3), taken from A. The calculator prints those vectors directly so there is nothing to look up.
Can I use this to solve a system of linear equations?
Yes — enter the augmented matrix [A | b], with the coefficients first and the right-hand side as the final column, and choose RREF. If every variable column holds a pivot, the last column reads off the unique solution directly, as it does in the worked example where the reduced form gives x = 52, y = −45 and z = −42. If some variable column is free, the system has infinitely many solutions parameterised by those free variables. If a row reduces to all zeros in the coefficient part but a non-zero entry in the last column, that row says 0 = something non-zero, and the system has no solution at all.
What are free columns and why do they matter?
A free column is a column with no pivot. Read as a system, its variable is not pinned down by any equation — you may choose its value freely, and every other variable follows. The number of free columns is therefore the number of parameters in the solution set of Ax = 0, which is the dimension of the null space, called the nullity. Together with the rank this gives the rank–nullity theorem: rank plus nullity equals the number of columns. In the worked example there are 4 columns and rank 3, so exactly one free column.
What does it mean if a whole row becomes zero?
It means that row was a linear combination of the others and carried no independent information. The rank is the number of non-zero rows left in the echelon form, so each zero row is one unit of redundancy. In a system of equations, a zero row that appears in the coefficient part with a zero on the right-hand side is a redundant equation and harmless; the same zero row with a non-zero right-hand side is a contradiction and means the system is inconsistent. The rank-deficient test case, [[1, 2, 2, 2], [2, 4, 6, 8], [3, 6, 8, 10]], reduces to exactly one zero row because its third row is the sum of the first two.
Why does the answer show fractions instead of decimals?
Because they are exact. All arithmetic runs at 60 significant digits, and at display time an entry is printed as a fraction whenever one with a denominator up to 1000 matches it, falling back to 6 decimal places otherwise. Reducing [[3, 1], [0, 0]] therefore prints [1, 1/3; 0, 0] rather than [1, 0.333333; 0, 0]. Row reduction generates fractions constantly — dividing by a pivot rarely gives whole numbers — and rounding them early is how hand computations go wrong, so nothing is rounded until the answer is displayed.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 977 calculators remain free
  • No billing is enabled
Coming soon