Skip to main content
Mathovia

Math / Algebra

Gaussian Elimination Calculator

Type a system of two or three linear equations and watch it turn into an augmented matrix and then into row-echelon form, one row operation at a time. Switch to Gauss-Jordan to carry on to reduced row-echelon form and read the answer straight off the matrix.

Use x, y and z. Fractions, decimals and brackets are fine: 1/2x, 0.5y, 2(x + y) = 14, y = 3x − 4.

One solution

x = 1,y = 2,z = 3

(1, 2, 3)

  1. Start with the systemx + y + z = 62x − y + z = 3x + 2y − z = 2
  2. Write the augmented matrix11162−11312−12
  3. R2 − 2R1 → R211160−3−1−912−12
  4. R3 − R1 → R311160−3−1−901−2−4
  5. R2 ÷ (−3) → R21116011/3301−2−4
  6. R3 − R2 → R31116011/3300−7/3−7
  7. R3 ÷ (−7/3) → R31116011/330013
  8. Row-echelon form reached: zeros below every leading 1. Now back-substitute from the bottom row upx + y + z = 6y + (1/3)z = 3z = 3
  9. Row 3 gives z directlyz = 3
  10. Row 2: substitute z = 3y = 2
  11. Row 1: substitute y = 2 and z = 3x = 1
  12. Check in every original equationx + y + z = 6: left side = 6 ✓2x − y + z = 3: left side = 3 ✓x + 2y − z = 2: left side = 2 ✓
Written by
MPhil in Mathematics, Founder of Mathovia
Published

Mathematics verification: Mathematical formulas, calculations, worked examples and solutions are reviewed for accuracy before publication. How we check our work

Gaussian elimination is elimination with the letters taken out. Instead of writing , and over and over, you write only the coefficients in a grid called an augmented matrix and tidy that grid with three simple row operations. It’s the method graphing calculators and computers use to solve systems, and once you can do it for three equations you can do it for thirty. This Gaussian elimination calculator shows the full matrix after every operation, so nothing happens off the page.

A 3 by 3 augmented matrix reduced by Gaussian elimination to row-echelon form, with leading 1s on the diagonal and zeros below them
Gaussian elimination turns any augmented matrix into a staircase of leading 1s

How to use the Gaussian elimination calculator

  1. Choose 2 or 3 equations and type them in, using , and . The equations don’t need to be in standard form.
  2. Pick Gaussian elimination (row-echelon form plus back-substitution) or Gauss-Jordan (reduced row-echelon form).
  3. Follow the matrices. Each step names the row operation, such as , and shows the matrix that results.
  4. Read the answer at the top, with a check in every original equation.

From a system to an augmented matrix

The calculator opens on this system:

Its augmented matrix has one row per equation and one column per variable, with the constants after the bar:

If an equation is missing a variable, that entry is . For example, becomes the row . The calculator fills in those zeros for you.

Gaussian elimination step by step

The goal of the forward phase is to make zeros below each pivot, working one column at a time from left to right.

Column 1. Use row 1 to clear the entries below its leading : and .

Column 2. Make the pivot with , then clear below it with . Finally scale the last row so its pivot is too:

That’s row-echelon form: a staircase with zeros below every leading . Now back-substitute from the bottom row up:

Three augmented matrices for x + y + z = 6, 2x − y + z = 3, x + 2y − z = 2: the starting matrix, the matrix after column 1 is cleared, and row-echelon form, followed by back-substitution giving z = 3, y = 2 and x = 1
Clear the columns left to right, then solve from the bottom row up

The solution is . Switch the calculator to Gauss-Jordan and it keeps going, clearing the entries above each pivot as well, until the left side is the identity matrix and the last column simply reads .

Why row operations don’t change the answer

Each row of the matrix is an equation, so each row operation is something you could do to the equations themselves. Swapping two rows just lists the equations in a different order. Multiplying a row by (3) multiplies both sides of an equation by (3), which keeps it balanced. Adding a multiple of one row to another is exactly what the elimination method does when it adds two equations. None of these moves can create a new solution or lose an old one, so the system you end with has the same solution as the one you started with. That’s also why the calculator never multiplies a row by (0): that would erase an equation and throw information away.

Gaussian vs Gauss-Jordan elimination

Gaussian eliminationGauss-Jordan elimination
Zeros createdbelow each pivotbelow and above each pivot
Ends inrow-echelon formreduced row-echelon form
Last stepback-substitutionread the answer off the matrix
Row operationsfewermore
Best forsolving by handreading answers, finding inverses

When there’s no solution or infinitely many

The final matrix also tells you when a system doesn’t have exactly one solution:

Final row looks likeMeaning
is false, so there’s no solution
a redundant equation, so there are infinitely many solutions

Try the example x + y + z = 5, x + y + z = 8, x − y = 1. After , the second row reads , so the system is inconsistent. When a row of zeros appears instead, the calculator gives the general solution with a parameter .

Mistakes that row-reduction catches

  • Changing only part of a row. changes every entry of , including the constant after the bar.
  • Using the wrong row as the pivot row. Always subtract multiples of the pivot row, not the row you’re changing.
  • Dividing a row by zero. If the pivot position is , swap in a row below that has a non-zero entry. The calculator does this and shows the swap.
  • Rounding too early. A rounded to pushes every later step slightly off. Keep fractions.

For the theory behind every step, read the augmented matrices lesson and work through the augmented matrix practice problems. To solve the same system by substitution, elimination or Cramer’s rule instead, use the system of equations calculator.

Frequently Asked Questions

What is Gaussian elimination?+

A method for solving a system of linear equations by writing it as an augmented matrix and using row operations to create zeros below each leading entry. The result is row-echelon form, a staircase of equations that you solve from the bottom row up by back-substitution.

What is the difference between Gaussian and Gauss-Jordan elimination?+

Gaussian elimination stops at row-echelon form, with zeros below each pivot, and finishes with back-substitution. Gauss-Jordan keeps going until there are zeros above the pivots too, reaching reduced row-echelon form, where each row reads off one variable directly.

What are the row operations?+

There are three: 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 of the system, which is why they are allowed.

How does the calculator show no solution or infinitely many solutions?+

If a row becomes all zeros on the left with a non-zero number after the bar, like 0 0 0 | 4, it means 0 = 4, so there is no solution. If a whole row becomes zeros, an equation was redundant, and the system has infinitely many solutions, which the calculator writes as a general solution.

Is this an augmented matrix calculator?+

Yes. The first step builds the augmented matrix from your equations: one row per equation, one column per variable and a final column for the constants. Every later step shows the full matrix again, so you can check each row operation.

Why does the calculator use fractions instead of decimals?+

Row operations often create fractions such as 1/3, and rounding them to 0.3333 makes the later steps slightly wrong. Keeping exact fractions means the final answer is exact too.

Learn and practice this topic

Related calculators