Gauss–Jordan elimination turns a matrix into its reduced row echelon form (RREF) using three row operations: swapping two rows, multiplying a row by a nonzero number, and adding a multiple of one row to another. Because these operations never change the solutions of the corresponding linear system, the reduced matrix lets you read the answer directly.
This calculator works on matrices of up to 5 rows and 6 columns. In augmented mode the last column holds the constants of a system , and the calculator tells you whether the system has one solution, infinitely many (with the free variables named) or none. In matrix mode it simply reduces the matrix and reports its rank and pivot columns.
Every row operation is listed with the matrix after it, so you can compare line by line with your own work. The calculator also stops halfway to show the row echelon form (REF) — the result of Gaussian elimination alone — before finishing with the back elimination that produces the RREF. All arithmetic uses exact fractions: no 0.333333 rounding, so a zero is really zero and a dependent row is always detected. For square systems up to 3 × 3 with Cramer's rule or substitution, see the system of equations calculator; for determinants and inverses, the matrix calculator.
How to use this calculator
- Choose Augmented matrix to solve a system, or Matrix only to reduce a matrix.
- Type the matrix row by row. Separate the rows with semicolons and the entries with spaces:
1 1 1 6; 0 2 5 -4; 2 5 -1 27. Fractions (2/3) and decimals (0.5) are fine, and a bar|before the last column is accepted. - For a system, put each equation on its own row with the variables in the same order, writing 0 for a missing variable, and the constant last.
- Read the solution (or the RREF), then open the steps to follow each row operation. The matrices in the results use the input format, so you can copy one back into the box.
The formula
A matrix is in row echelon form when all zero rows are at the bottom, the first nonzero entry (the pivot) of each row is to the right of the pivot above it, and the entries below each pivot are 0. In the convention used here, each pivot is also scaled to 1. It is in reduced row echelon form when, in addition, each pivot is the only nonzero entry in its column.
The algorithm, column by column: find a row with a nonzero entry, swap it up (), scale it so the pivot is 1 (), then clear the column below with . Back elimination then clears the entries above each pivot, from the last pivot upward.
For an augmented matrix with unknowns, the Rouché–Capelli theorem decides the outcome:
- : no solution (a row reads );
- : exactly one solution;
- : infinitely many, with free variables.
Worked example
A system with one solution. Solve , , . The augmented matrix and its echelon forms are
after 7 row operations (the first is ). The RREF reads , , . Check: .
A system with infinitely many solutions. For and , the matrix 1 2 -1 3; 2 4 1 9 reduces to two pivots (columns 1 and 3), so is free: .
Row echelon form vs reduced row echelon form
| Row echelon form (REF) | Reduced row echelon form (RREF) | |
|---|---|---|
| Zeros below each pivot | yes | yes |
| Zeros above each pivot | not required | yes |
| Pivots equal to 1 | depends on the textbook | yes |
| Unique for a given matrix | no | yes |
| Obtained by | Gaussian elimination | Gauss–Jordan elimination |
The REF is enough to solve a system by back substitution and to read the rank, but different sequences of row operations give different REFs. The RREF is unique: whatever operations you choose, you end with the same matrix, which is why it is the standard answer to check against. This page therefore doubles as a row echelon form calculator: the REF line is the matrix after the forward phase.
Reading free variables
A column without a pivot corresponds to a free variable: it can take any value, and each pivot variable is expressed in terms of the free ones. In the example above the RREF has rows and , so and , with free. Choosing gives the particular solution ; adding multiples of gives all the others. The same reading on a matrix without constants gives the null space.
Frequently asked questions
What is the difference between Gaussian and Gauss–Jordan elimination?
Gaussian elimination stops at row echelon form and finishes with back substitution. Gauss–Jordan continues until the matrix is in reduced row echelon form, so the solution can be read without any substitution.
Is row echelon form unique?
No. Different choices of pivots or row operations give different row echelon forms of the same matrix. The reduced row echelon form, however, is unique, and the number of pivots (the rank) is the same in every echelon form.
How do I enter a system of equations?
Write one equation per row, with the coefficients in a fixed variable order and the constant last. For 2x − z = 4 in x, y, z, type 2 0 -1 4. Rows are separated by semicolons.
How do I know the system has no solution?
If the reduction produces a row of zeros with a nonzero constant, that row says 0 = 1, which is impossible. The calculator then reports an inconsistent system and shows the ranks.
Why use fractions instead of decimals?
Decimal rounding can make a zero look like 0.0000001 and hide a dependent row, changing the rank and the conclusion. Exact fractions avoid that completely.
Sources
- OpenStax, Precalculus 2e — §9.6 Solving Systems with Gaussian Elimination
- Strang, G. — Introduction to Linear Algebra, 6th ed., Wellesley-Cambridge Press (2023), ch. 2–3
- MIT OpenCourseWare 18.06 Linear Algebra (Strang) — Spring 2010
- Weisstein, Gauss-Jordan Elimination — Wolfram MathWorld
Last updated: