Gaussian Elimination Calculator

Solve systems of up to 5 linear equations by Gaussian elimination. See each row operation, the RREF matrix, exact fractions and the solution type.

Gaussian Elimination Calculator

Solve systems of linear equations using Gaussian elimination method. Enter the coefficients of your equations and get step-by-step solutions showing row operations, reduced row echelon form, and the final solution.

System Configuration

Augmented Matrix [A|b]

Display Options

Gaussian Elimination Calculator: Solve Systems and Check Every Row Operation

Gaussian elimination is a sequence of three row operations: swap, scale, add. They are applied in a specific order to an augmented matrix. This calculator lets you enter a system up to 5×5, watch each operation as it happens, and see the reduced row echelon form (RREF) at the end. It checks your homework step by step, with fractions that do not round off.

The calculator works as Strang defines it in Introduction to Linear Algebra (Chapter 2). Supply the coefficients and constants in the augmented matrix [A|b], choose between 2 and 5 equations, and the solver performs forward elimination with partial pivoting, then back-substitution to reach RREF. Every swap, scaling, and row addition is recorded and displayed.

Start with the built-in example. It runs a 3×3 system and shows each step in plain language: "R2 → R2 - (2)R1". That is the notation OpenStax and LibreTexts use, and it is what you will write in your homework. The calculator handles the arithmetic so you can focus on whether you picked the right pivot and applied the operation to the full row, including the augmented column.

  • Max system size: 5 equations × 5 variables
  • Number representation: Fractions or decimals (0-5 decimal places)
  • Step output: Every row operation shown: swap, scale, add
  • Final form: Reduced row echelon form (RREF)
  • Solution types detected: Unique, infinite (parametric), none (inconsistent)

How To Enter A System: The Augmented Matrix [A|b]

Every system of linear equations goes into the calculator as an augmented matrix. The coefficient side, the numbers that multiply the variables, goes on the left. The constant terms go on the right, separated by a vertical bar. This is the standard notation in every linear algebra text, from Strang to Burden & Faires.

Select the number of equations and variables first. For a system with 3 equations and 3 unknowns, choose 3 equations and 3 variables. The grid appears with variable labels x, y, z. Fill each cell with a number. Missing cells default to zero, so you only need to enter non-zero coefficients. The augmented column (the b column) is the last entry in each row.

If you have a system like x + y + z = 6, 2y + z = 4, z = 2, enter the coefficients as they appear: row one gets 1, 1, 1 and b=6; row two gets 0, 2, 1 and b=4; row three gets 0, 0, 1 and b=2. The calculator does the rest.

What Happens When You Click Solve

The solver copies your matrix and begins forward elimination. It finds the pivot, the largest absolute value in the current column (partial pivoting), and swaps rows if needed. Each swap is logged. Then it scales the pivot row so the leading entry becomes 1, and eliminates all entries below it. This repeats column by column. After the matrix is in row echelon form, it cleans up entries above each pivot to reach RREF. The whole sequence is displayed as numbered steps.

Reading The Steps: Row Swaps, Scaling And Replacement

Each step shows three things: the operation description, the resulting matrix, and the operation type (swap, scale, eliminate, back-substitute). A swap looks like "R3 ↔ R1", rows 3 and 1 trade places. Scaling appears as "R2 → (1/3)R2". Elimination looks like "R3 → R3 - (2)R1". Every operation applies to the entire augmented row, coefficients and constant together.

If a pivot is zero, the calculator automatically swaps rows to put a non-zero value in the pivot position. This is the same partial pivoting strategy Burden & Faires describe in Numerical Analysis (10th ed., 2015). Without it, a zero pivot would crash the algorithm or produce garbage.

Pay attention to steps where a row becomes all zeros on the left but has a non-zero constant on the right. That is the inconsistent case: 0 = c, no solution. The calculator flags it immediately. If a whole row becomes all zeros, including the constant, the system is dependent and has infinite solutions.

Reading The Result: Unique, Infinite Or None

The calculator classifies the solution into three types, each with a distinct visual card.

Unique solution. The RREF looks like an identity matrix on the left with a constant vector on the right. Every variable has exactly one value. The card is green and says "Unique Solution".

Infinite solutions. At least one column has no pivot. The corresponding variable is free, it can be any real number. The calculator shows the parametric form: x = 2 - z, y = 3 + z, z free. Every basic variable is expressed in terms of the free ones. The card is amber and says "Infinite Solutions".

No solution. A row reads [0 0 0 | 5] after elimination. That means 0 = 5, which is impossible. The card is red and says "No Solution". No further computation is needed.

If you are working through Strang's Chapter 2 exercises, this is the exact classification he teaches. The calculator follows the same rank logic: number of pivots = rank; rank less than number of variables means infinite solutions; a row of zeros with a non-zero constant means inconsistency.

Solution Types in Gaussian Elimination
OutcomeRREF PatternRank vs VariablesExample Row
UniqueIdentity on leftrank = variables[1 0 0 | 3]
InfiniteAt least one zero column on leftrank < variables[1 0 2 | 5]
NoneZero row with non-zero constantrank incomplete[0 0 0 | 4]

A Fully Worked 3×3 Example

The built-in example on this calculator solves exactly this system:

x + y + z = 6
2y + z = 4
z = 2

Load it by clicking "Load Example". Here is what the step-by-step shows.

Initial matrix.

[1 1 1 | 6]
[0 2 1 | 4]
[0 0 1 | 2]

Step 1. Column 1: pivot is 1 at row 1. No swap needed. Eliminate below: row 2 already has 0, row 3 already has 0. No operation.

Step 2. Column 2: pivot is 2 at row 2. Scale row 2: R2 → (1/2)R2. Matrix becomes [0 1 0.5 | 2].

Step 3. Eliminate above and below pivot in column 2. Row 1 has 1 in column 2: R1 → R1 - (1)R2. Matrix becomes [1 0 0.5 | 4]. Row 3 has 0 in column 2, no operation.

Step 4. Column 3: pivot is 1 at row 3. Scale row 3: already 1. Eliminate above: Row 1 has 0.5, so R1 → R1 - (0.5)R3. Matrix becomes [1 0 0 | 3]. Row 2 has 0.5, so R2 → R2 - (0.5)R3. Matrix becomes [0 1 0 | 1].

Final RREF.

[1 0 0 | 3]
[0 1 0 | 1]
[0 0 1 | 2]

x = 3, y = 1, z = 2. Every step matches what Strang calls back-substitution to RREF. The calculator shows each of these steps exactly as written here, with the matrix after each operation.

If you missed a row operation in your homework, forgot to apply the elimination to the augmented column, or scaled only the coefficient side, the calculator catches it because its step output includes the whole row.

Row Reduction Calculator: What The Calculator Shows At Each Step

This is a row reduction calculator. It transforms your augmented matrix into RREF using elementary row operations. Every step is a row operation: swap, scale, or add a multiple. The calculator never skips a step, it shows the matrix after every single operation, not just after each column.

If you want to check whether you performed the elimination correctly at row 3, you can pause at step 5 and compare matrices. If your matrix matches, you eliminated correctly. If it does not, you can see which operation you applied wrong. This is the fastest way to debug homework errors.

Partial Pivoting In Action

Suppose your system has a zero in the pivot position. The calculator automatically swaps rows so the largest absolute value in the column becomes the pivot. For example, if row 1 column 1 is 0 but row 2 column 1 is 5, the calculator swaps rows 1 and 2. The step description says "Swap R1 ↔ R2" and shows the new matrix. This follows Burden & Faires' partial pivoting strategy exactly.

Rref Calculator: Why RREF And Not Just REF

This rref calculator goes all the way to reduced row echelon form. A calculator that stops at row echelon form requires you to back-substitute manually. This one does everything: forward elimination, then back-substitution on the matrix itself, until the left side is an identity matrix (or as close as possible for singular systems).

That means you read the solution directly from the last column of the final matrix. No extra algebra. If the system has infinite solutions, the final matrix shows the parametric form. For the example above, the final row says z = 2 directly. There is no need to substitute into any other equation.

System Of Equations Solver: Checking Your Work

Use this system of equations solver as a verification tool. Enter your system, solve it by hand, then compare each step the calculator shows to your own work. If they match at every step, your solution is correct. If they diverge, the step where they diverge is the one you need to re-check.

The calculator also verifies the solution by plugging it back into the original equations. It shows each equation with the substituted values and the result. If all equations balance, the solution is confirmed.

What To Do When Your Answer Differs

If the calculator gets a different result than your textbook's answer key, the usual cause is rounding. The calculator works with fractions by default. If you used decimals, your rounding may have pushed a pivot near zero, making the system appear singular when it is not. Switch to fraction mode and re-run. If the calculator still differs, check that you entered the coefficients exactly, a sign error in one cell completely changes the solution.

Augmented Matrix Calculator: Fractions Versus Decimals And Rounding Error

This augmented matrix calculator offers two number modes: decimals (0-5 places) and fractions. Fractions are the safer choice for homework checking. Decimal rounding can turn a 1/3 pivot into 0.3333, which makes the elimination slightly off and, in a 4×4 or 5×5 system, that small error grows with each operation.

The fraction mode searches for the exact rational representation of every number you enter. If you type 0.25, it recognises 1/4. If you type 0.3333, it does not, it only displays fractions when the decimal is exact up to floating-point noise. This prevents the calculator from showing a fraction like 355/113 as if it were exactly pi.

For hand-checking, always use fractions. Set the display to 0 decimal places and enable "Display as fractions when possible". The calculator will show every operation in rational arithmetic. If your hand calculation used decimals, you can switch to decimal mode to match formats.

When Decimals Are Fine

For engineering problems where the coefficients are measurements (3.14, 9.81, 1.6e-19), decimals are appropriate. The calculator's partial pivoting minimises error, but it cannot eliminate rounding error entirely. Burden & Faires warn that even partial pivoting fails for extremely ill-conditioned matrices like the Hilbert matrix. For those, you need a library solver like LAPACK's dgesv, not a small calculator. Stick to well-conditioned systems under 5×5 and the error stays below 1e-10.

What Often Goes Wrong And How The Calculator Catches It

The most common mistake in Gaussian elimination is forgetting to apply a row operation to the entire augmented row. A student scales only the coefficient side, leaving the constant unchanged. The calculator never makes that error, every operation applies to the full row, and the step output shows the whole row.

The second most common mistake is misidentifying a row of zeros as infinite solutions when the constant is also zero. That is correct: [0 0 0 | 0] means free variables. But [0 0 0 | 5] is no solution. The calculator flags both cases distinctly and shows the contradictory row.

The third mistake is swapping rows but losing track of which variable corresponds to which column. The calculator labels variables x, y, z for 3-variable systems and x1, x2, x3, x4, x5 for 4- and 5-variable systems. The column labels are fixed, so a swap does not change which variable is in which column.

Common Questions

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

Gaussian elimination stops at row echelon form (REF), then solves using back-substitution. Gauss-Jordan elimination continues to reduced row echelon form (RREF), with ones on the diagonal and zeros everywhere else. This calculator uses Gauss-Jordan elimination because the final matrix shows the solution directly. Strang covers both variants in Chapter 2 of Introduction to Linear Algebra.

What is the difference between REF and RREF?

Row echelon form (REF) requires zeros below each pivot and each pivot to the right of the pivot above. Reduced row echelon form (RREF) additionally requires zeros above each pivot, and every pivot must be 1. The calculator outputs RREF. If you need REF for an assignment, you can stop reading the steps when the matrix first becomes upper triangular, the calculator labels that point.

What does a no-solution row look like, and how do I fix it?

A no-solution row looks like [0 0 0 | c] where c is non-zero. That means 0 = c, which is impossible. You cannot fix it by changing the elimination, the equations themselves are contradictory. Check your original equations for a sign error or a mis-copied constant. If the equations are correct, the system is inconsistent and has no solution.

Does the calculator handle non-square systems (more equations than variables, or vice versa)?

Yes. The calculator lets you choose any combination from 2 to 5 equations and 2 to 5 variables. For an overdetermined system (more equations than variables), it produces the RREF and shows whether a solution exists. For an underdetermined system (more variables than equations), it shows the parametric form with free variables.

Can I trust the calculator's fractions for exact homework checking?

Yes, when fraction mode is enabled and the numbers you enter are exact decimals (0.5, 0.25, 3.75), the calculator converts them to exact fractions and performs rational arithmetic throughout. If you enter a repeating decimal like 0.3333, it will not guess 1/3, it treats it as a decimal. For exact checking, enter 1/3 as 0.3333333333 or use the decimal mode with 9 decimal places.

Guides on this site