Math calculators

Gaussian Elimination Calculator

Updated Sep 19, 2026 By Infinity Calculator
Rate Formulas

Configuration

Used when fraction output is off.
Reduction Mode
Variable Names
Rename the variables (e.g. x, y, z). Leave a box blank to keep the default x₁, x₂, x₃…

Augmented Matrix [ A | b ]

Accepted entries: integers (3), decimals (-2.5) and fractions (5/7). Blank cells count as 0. Move around with the arrow keys; press Enter to solve.
Your Input
Input Matrix (What Was Computed)
Step-by-Step Solution
Final Matrix
Solution
Solution Verification
Elimination Progress

Introduction

This Gaussian Elimination Calculator solves systems of linear equations step by step. You type in your numbers, and it shows the row operations that turn your matrix into row echelon form (REF) or reduced row echelon form (RREF).

Start by picking how many equations and variables you have. Then fill in the augmented matrix [ A | b ]. You can enter whole numbers, decimals like -2.5, or fractions like 3/4. Blank boxes count as zero. Press Solve to see the answer.

The calculator tells you if the system has one solution, many solutions, or no solution at all. For a single answer, it checks the work by plugging the values back into each equation. If there are free variables, it writes the answer in parametric form.

You can also rename the variables to x, y, and z, show answers as exact fractions or decimals, and hide the steps if you just want the result. Use it to check homework, or to watch how Gauss-Jordan elimination works one row at a time.

How to use our Gaussian Elimination Calculator

Type the numbers from your system of equations into the augmented matrix, and the calculator will row reduce it, show each row operation, and give you the solution.

Equations / Rows: Pick how many equations your system has. This sets the number of rows in the matrix.

Variables / Columns: Pick how many variables your system has. This sets the number of coefficient columns.

Decimal Precision: Choose how many decimal places to show. This only matters when fraction output is turned off.

Reduction Mode: Choose Gaussian (REF) to stop at row echelon form, or Gauss-Jordan (RREF) to fully reduce the matrix and read the answer right off it.

Show results as exact fractions: Check this box to see answers like 3/7 instead of rounded decimals.

Show step-by-step row operations: Check this box to see every swap, scaling, and row replacement with the matrix after each step.

Variable Names: Type your own names, like x, y, and z. Leave a box empty to keep the default x₁, x₂, x₃.

Augmented Matrix [ A | b ]: Fill in each coefficient and each constant on the right side. You can enter whole numbers, decimals like -2.5, or fractions like 5/7. Empty cells count as 0.

Solve: Row reduces the matrix and shows the solution, the final matrix, and a check of your answer.

Load Example: Fills the grid with a sample system that works with your chosen size.

Randomize: Fills the grid with random numbers for practice.

Clear All: Empties every cell and clears the results.

Reset: Puts all settings and the matrix back to the starting 3 × 3 example.

What Is Gaussian Elimination?

Gaussian elimination is a step-by-step method for solving a system of linear equations. You write the equations as a grid of numbers called an augmented matrix, then change the rows until the answer is easy to read.

The Augmented Matrix

A system like:

2x + y − z = 8
−3x − y + 2z = −11
−2x + y + 2z = −3

becomes this matrix [ A | b ], where each row is one equation and the last column holds the numbers after the equals sign:

[  2   1  −1 |   8 ]
[ −3  −1   2 | −11 ]
[ −2   1   2 |  −3 ]

The Three Row Operations

Only three moves are allowed. None of them change the answer:

  • Swap: trade the places of two rows.
  • Scale: multiply or divide a whole row by a number that is not zero.
  • Replace: add or subtract a multiple of one row to another row.

REF and RREF

The goal is to make zeros below the leading numbers, called pivots.

  • Row Echelon Form (REF) is the "staircase" shape. Every entry below a pivot is 0. You then work backward, plugging answers in one at a time. This is Gaussian elimination.
  • Reduced Row Echelon Form (RREF) goes further. Each pivot is 1, and the entries above and below it are 0. The answers sit right in the last column. This is Gauss-Jordan elimination.

Three Possible Outcomes

  • One solution: every variable has its own pivot. There is exactly one set of values that works.
  • Infinitely many solutions: some variables have no pivot. These are free variables. You can pick any value for them, so the answer is written as a formula with parameters.
  • No solution: a row reads 0 = 5 (or any nonzero number). That can never be true, so the equations fight each other. The system is called inconsistent.

Why It Matters

Gaussian elimination is the base method behind much of linear algebra. It is used to find the rank of a matrix, invert matrices, compute determinants, and solve real problems in engineering, physics, computer graphics, economics, and machine learning. Computers use this same process to solve systems with thousands of equations.

Tips for Getting It Right

  • Use fractions instead of decimals when you can. Rounding errors build up fast.
  • If a pivot spot holds a 0, swap in a row below it that has a nonzero number there.
  • A whole row of zeros is fine. It just means one equation repeated information from the others.
  • Always check your answer by putting the values back into the original equations.

Formulas used

Augmented matrix of a linear system
[A \mid b] = \left[\begin{array}{cccc|c} a_{11} & a_{12} & \cdots & a_{1n} & b_1 \\ a_{21} & a_{22} & \cdots & a_{2n} & b_2 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} & b_m \end{array}\right]
Row swap (interchange two rows)
R_i \leftrightarrow R_k
Row scaling (normalize pivot to 1)
R_i \rightarrow \frac{1}{p} R_i, \qquad p = a_{i\ell} \ne 0
Row replacement (eliminate entry below/above pivot)
R_k \rightarrow R_k - f\, R_i, \qquad f = a_{k\ell}
Unique solution read from RREF
x_{c_i} = a_{i,n+1}^{\text{(rref)}} \quad \text{when } \operatorname{rank} = n
Parametric solution with free variables
x_{p} = a_{r,n+1}^{\text{(rref)}} - \sum_{j \in \text{free}} a_{r,j}^{\text{(rref)}}\, x_j
Inconsistency (no solution) condition
a_{r1} = a_{r2} = \cdots = a_{rn} = 0 \;\wedge\; a_{r,n+1} \ne 0 \;\Rightarrow\; 0 = a_{r,n+1}
Back-substitution verification of each equation
\sum_{j=1}^{n} a_{ij} x_j = b_i

Frequently asked questions

How do you know when a matrix is in row echelon form?

A matrix is in row echelon form when all three of these are true:

  • Any rows of all zeros sit at the bottom.
  • The first nonzero number in each row (the pivot) is to the right of the pivot in the row above.
  • Every entry below a pivot is 0.

This gives the numbers a staircase shape going down and to the right.

Is the reduced row echelon form of a matrix always the same?

Yes. Every matrix has exactly one reduced row echelon form (RREF). It does not matter which order you do the row operations in, or which valid path you take. You always land on the same final matrix.

Row echelon form (REF) is different. A matrix can have many valid REF versions, because you can stop scaling rows at different points.

What is a pivot in Gaussian elimination?

A pivot is the first nonzero number in a row, and it is the number you use to make zeros in the rest of its column.

The column a pivot sits in is called a pivot column, and the matching variable is a pivot variable. In RREF, every pivot equals 1 and every other entry in its column is 0.

How do you find the rank of a matrix using row reduction?

Row reduce the matrix, then count the pivots. That count is the rank. It is the same as the number of rows that are not all zeros.

Example: if a 4 × 4 matrix reduces to three nonzero rows, its rank is 3. Rank can never be bigger than the number of rows or the number of columns.

How many free variables does a system of equations have?

Free variables = number of variables − rank.

So a system with 5 variables that reduces to 3 pivots has 2 free variables. You can pick any value for each free variable, which is why such a system has infinitely many solutions. If there are no free variables and no contradiction, the answer is unique.

Can a system of linear equations have exactly two solutions?

No. A linear system has either one solution, no solution, or infinitely many.

Here is why: if two different solutions exist, then every point on the straight line between them also solves the system. That already makes infinitely many.

How do you find the inverse of a matrix with Gauss-Jordan elimination?

Put the matrix next to the identity matrix, like [ A | I ]. Then row reduce until the left side becomes the identity.

Whatever ends up on the right side is A⁻¹. If the left side can never become the identity (you get a row of zeros), the matrix has no inverse. It is singular.

Do row operations change the determinant of a matrix?

It depends on the operation:

  • Swapping two rows flips the sign of the determinant.
  • Multiplying a row by k multiplies the determinant by k.
  • Adding a multiple of one row to another does not change it at all.

That is why row reduction is a fast way to find determinants: reduce to a triangle shape, multiply the diagonal entries, then fix the sign and scaling.

What is back substitution?

Back substitution is the finishing step of Gaussian elimination. Once the matrix is in row echelon form, the bottom row has only one variable left, so you solve it right away.

Then you move up one row, plug in the value you just found, and solve for the next variable. Keep going until you reach the top row. Gauss-Jordan skips this by reducing all the way to RREF.

What is partial pivoting and why is it used?

Partial pivoting means swapping rows so the number with the largest absolute value sits in the pivot spot.

It helps in two ways. It avoids dividing by zero, and it keeps rounding errors small when you work with decimals. Dividing by a tiny number blows up small errors, so computers almost always use partial pivoting.

Does a homogeneous system always have a solution?

Yes. A homogeneous system has 0 on the right side of every equation, so setting every variable to 0 always works. That is called the trivial solution.

If the system has more variables than pivots, it also has infinitely many nonzero solutions. A homogeneous system can never be inconsistent.

Does Gaussian elimination work when there are more equations than variables?

Yes. The method works on any size matrix, tall or wide.

With more equations than variables, the extra rows often turn into rows of zeros, which just means those equations repeated information. If instead a row reads 0 = 5, the equations disagree and there is no solution.

How long does Gaussian elimination take for large systems?

Solving an n × n system takes about 2n³/3 arithmetic operations. Gauss-Jordan (full RREF) takes about n³, so it is a bit slower.

That growth adds up fast. Doubling the number of equations makes the work about eight times bigger, which is why big real-world systems use special shortcuts.

Who invented Gaussian elimination?

The method is much older than its name. Chinese mathematicians used it in The Nine Chapters on the Mathematical Art around 2,000 years ago.

It carries the name of Carl Friedrich Gauss, who used it in the early 1800s for astronomy calculations. Wilhelm Jordan later popularized the fully reduced version, which is why it is called Gauss-Jordan elimination.