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
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.
- 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.
- To solve a system Ax = b, enter the augmented matrix [A | b] — the coefficients followed by the right-hand side as the last column.
- 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.
- Read the echelon matrix at the top. Rows are separated by semicolons.
- 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.
- Read the pivot columns to see which variables are determined and the free columns to see which are free to choose.
- For a column space basis, use the vectors given — they are the pivot columns of your original matrix, not of the reduced one.
- 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.
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.
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.
Frequently asked questions.
What is the difference between row echelon form and reduced row echelon form?
Is the row echelon form of a matrix unique?
How do I find the rank from the echelon form?
How do I get a basis for the column space from the RREF?
Can I use this to solve a system of linear equations?
What are free columns and why do they matter?
What does it mean if a whole row becomes zero?
Why does the answer show fractions instead of decimals?
References& sources.
- [1]Margalit, D. & Rabinoff, J., Interactive Linear Algebra (Georgia Institute of Technology, 2019), §1.2 Row Reduction. Source of the REF conditions, the two additional RREF conditions, and the uniqueness theorem quoted on this page: "Every matrix is row equivalent to one and only one matrix in reduced row echelon form." Retrieved 2026-07-29; open access.
- [2]Wolfram MathWorld, "Echelon Form" — independent statement of the three row-echelon conditions, and the note that scaling each leading entry to 1 is a convention rather than part of the definition. Used as the second, independent authority on the REF conventions this page declares. Retrieved 2026-07-29; open access.
- [3]Margalit, D. & Rabinoff, J., Interactive Linear Algebra, §Subspaces — definitions of the column space Col(A) as the span of the columns of A, and the null space Nul(A) as the solution set of Ax = 0. Retrieved 2026-07-29; open access.
- [4]MIT OpenCourseWare, 18.06 Linear Algebra (Spring 2010), G. Strang — Unit I covers elimination, rank and the four fundamental subspaces. Retrieved 2026-07-29; open access.
- [5]Strang, G. (2016). Introduction to Linear Algebra, 5th ed., Wellesley–Cambridge Press. §2.2 "The Idea of Elimination" and §3.3 "The Rank and the Row Reduced Form", including the rank-deficient example used as a test case. Print reference — cited bibliographically, with no URL.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 977 calculators remain free
- No billing is enabled