Skip to content

Gauss–Jordan Elimination Calculator (RREF)

Reduce a matrix to row echelon and reduced row echelon form with exact fractions, every row operation and the solution of the system.

Your details

Interpret as

Rows separated by “;”, entries by spaces. In augmented mode the last column holds the constants: 1 1 1 6; 0 2 5 -4; 2 5 -1 27

Results update as you type

Solution

x = 5, y = 3, z = −2

Type of system
One unique solution
Reduced row echelon form (RREF)
[1 0 0 | 5; 0 1 0 | 3; 0 0 1 | −2]
Row echelon form (REF)
[1 1 1 | 6; 0 1 5/2 | −2; 0 0 1 | −2]
Rank
3
Pivot columns
1, 2, 3

rank A = rank [A | b] = 3 = number of unknowns: exactly one solution.

Step-by-step solution
  1. Forward elimination: make each pivot 1 and create zeros below it.
  2. R₃ → R₃ − 2R₁: [1 1 1 | 6; 0 2 5 | −4; 0 3 −3 | 15]
  3. R₂ → (1/2)R₂: [1 1 1 | 6; 0 1 5/2 | −2; 0 3 −3 | 15]
  4. R₃ → R₃ − 3R₂: [1 1 1 | 6; 0 1 5/2 | −2; 0 0 −21/2 | 21]
  5. R₃ → −(2/21)R₃: [1 1 1 | 6; 0 1 5/2 | −2; 0 0 1 | −2]
  6. Row echelon form (REF): [1 1 1 | 6; 0 1 5/2 | −2; 0 0 1 | −2]
  7. Back elimination: create zeros above each pivot.
  8. R₂ → R₂ − (5/2)R₃: [1 1 1 | 6; 0 1 0 | 3; 0 0 1 | −2]
  9. R₁ → R₁ − R₃: [1 1 0 | 8; 0 1 0 | 3; 0 0 1 | −2]
  10. R₁ → R₁ − R₂: [1 0 0 | 5; 0 1 0 | 3; 0 0 1 | −2]
  11. Reduced row echelon form (RREF): [1 0 0 | 5; 0 1 0 | 3; 0 0 1 | −2]

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 Ax=bA\mathbf{x} = \mathbf{b}, 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

  1. Choose Augmented matrix to solve a system, or Matrix only to reduce a matrix.
  2. 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.
  3. 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.
  4. 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 (Ri↔RjR_i \leftrightarrow R_j), scale it so the pivot is 1 (Ri→1pRiR_i \to \tfrac{1}{p} R_i), then clear the column below with Rk→Rk−c RiR_k \to R_k - c\,R_i. Back elimination then clears the entries above each pivot, from the last pivot upward.

For an augmented matrix [A∣b][A \mid \mathbf{b}] with nn unknowns, the Rouché–Capelli theorem decides the outcome:

  • rank⁡A<rank⁡[A∣b]\operatorname{rank} A < \operatorname{rank}[A \mid \mathbf{b}]: no solution (a row reads 0=10 = 1);
  • rank⁡A=rank⁡[A∣b]=n\operatorname{rank} A = \operatorname{rank}[A \mid \mathbf{b}] = n: exactly one solution;
  • rank⁡A=rank⁡[A∣b]<n\operatorname{rank} A = \operatorname{rank}[A \mid \mathbf{b}] < n: infinitely many, with n−rank⁡An - \operatorname{rank} A free variables.

Worked example

A system with one solution. Solve x+y+z=6x + y + z = 6, 2y+5z=−42y + 5z = -4, 2x+5y−z=272x + 5y - z = 27. The augmented matrix and its echelon forms are

[1116025−425−127]  →  [11160152−2001−2]  →  [10050103001−2]\left[\begin{array}{rrr|r} 1 & 1 & 1 & 6 \\ 0 & 2 & 5 & -4 \\ 2 & 5 & -1 & 27 \end{array}\right] \;\to\; \left[\begin{array}{rrr|r} 1 & 1 & 1 & 6 \\ 0 & 1 & \tfrac{5}{2} & -2 \\ 0 & 0 & 1 & -2 \end{array}\right] \;\to\; \left[\begin{array}{rrr|r} 1 & 0 & 0 & 5 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & -2 \end{array}\right]

after 7 row operations (the first is R3→R3−2R1R_3 \to R_3 - 2R_1). The RREF reads x=5x = 5, y=3y = 3, z=−2z = -2. Check: 5+3−2=65 + 3 - 2 = 6.

A system with infinitely many solutions. For x+2y−z=3x + 2y - z = 3 and 2x+4y+z=92x + 4y + z = 9, the matrix 1 2 -1 3; 2 4 1 9 reduces to two pivots (columns 1 and 3), so yy is free: x=4−2y,  z=1x = 4 - 2y,\; z = 1.

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 [1 2 0∣4][1\ 2\ 0 \mid 4] and [0 0 1∣1][0\ 0\ 1 \mid 1], so x=4−2yx = 4 - 2y and z=1z = 1, with yy free. Choosing y=0y = 0 gives the particular solution (4,0,1)(4, 0, 1); adding multiples of (−2,1,0)(-2, 1, 0) 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

Last updated:

More Math calculators

People also use