/

Gaussian Elimination Calculator — Augmented Matrix Solver with Steps

Gaussian Elimination Calculator — Augmented Matrix Solver with Steps
Linear Algebra Tool

Gaussian Elimination Calculator

Solve any system of linear equations using the Gaussian elimination method with complete step-by-step row operations — every pivot, every multiplier, every augmented matrix state shown. Also performs Gauss-Jordan elimination to produce the reduced row echelon form (RREF) directly.

Gaussian Elimination Calculator — Augmented Matrix Solver
System size:

Enter coefficients (left of bar) and constants (right of bar). Accepts integers, decimals, and fractions (e.g. 3/4).

Quick Examples:

2×2 Unique
3×3 Unique
No Solution
Infinite Solutions
4×4 System
Error
A — Initial Augmented Matrix [A|b]
B — Step-by-Step Row Operations (Forward Elimination)
C — Row Echelon Form (REF)
D — Back Substitution
E — Solution

Gauss-Jordan elimination extends Gaussian elimination to produce reduced row echelon form (RREF) — zeros both above and below each pivot, with each pivot scaled to 1. The solution can be read directly without back substitution.

System size:
3×3 Example
2×2 Example
Error

Gauss-Jordan vs Gaussian: Gaussian elimination creates zeros only BELOW each pivot (REF) and needs back substitution. Gauss-Jordan continues to eliminate ABOVE each pivot as well, and scales each pivot to 1, producing RREF where the solution is read directly from the last column.

Initial Augmented Matrix
Phase 1 — Forward Elimination (same as Gaussian elimination — zeros below pivots)
Row Echelon Form (REF) — after Phase 1
Phase 2 — Back Elimination + Scaling (Gauss-Jordan extension — zeros above pivots, scale to 1)
Reduced Row Echelon Form (RREF) — Solution

Table A — The Three Elementary Row Operations

OperationSymbolEffectExample
Row swapRᵢ ↔ RⱼExchange two rows (partial pivoting)R₁ ↔ R₂
Row scalingkRᵢ → RᵢMultiply row by nonzero scalar k(1/2)R₁ → R₁
Row replacementRᵢ + kRⱼ → RᵢAdd multiple of Rⱼ to RᵢR₂ − 3R₁ → R₂

Table B — System Classification

Condition in REFSystem TypeSolutions
Rank = n variables, no contradictionConsistent, independentUnique solution
Rank < n variables, no contradictionConsistent, dependentInfinite solutions
Row [0 0...0 | c≠0] appearsInconsistentNo solution

Table C — REF vs RREF

FeatureRow Echelon Form (REF)Reduced REF (RREF)
Zeros below pivots✓ Yes✓ Yes
Zeros above pivots✗ Not required✓ Yes
Pivots equal 1✗ Not required✓ Yes
Solution methodBack substitution neededRead directly from matrix
AlgorithmGaussian eliminationGauss-Jordan elimination

Key Formulas

Multiplier for eliminating row i using pivot row p, column c: m = −M[i][c] / M[p][c] Then: Rᵢ = Rᵢ + m × Rₚ Rank = number of non-zero rows in REF | Free variables = n_vars − rank

What Is Gaussian Elimination? — Algorithm Overview

The Gaussian elimination calculator above implements the standard algorithm for solving systems of linear equations: transform the augmented matrix [A|b] into row echelon form using elementary row operations, then use back substitution to extract the solution. Gaussian elimination is the backbone of computational linear algebra — every numeric solver uses some variant of it.

The three elementary row operations that Gaussian elimination uses are: (1) Row swap Rᵢ ↔ Rⱼ — exchange two rows; (2) Row scaling kRᵢ → Rᵢ — multiply a row by a nonzero constant; (3) Row replacement Rᵢ + kRⱼ → Rᵢ — add a multiple of one row to another. All three operations preserve the solution set because they correspond to valid algebraic manipulations of the underlying equations.

The goal of Gaussian elimination's forward phase is to create zeros below each pivot (the leading nonzero entry of each row), producing an upper triangular system that is trivially solvable by back substitution. The Gauss-Jordan extension continues eliminating above each pivot as well, producing the reduced row echelon form (RREF).

How to Build the Augmented Matrix

The augmented matrix [A|b] encodes an entire linear system in one compact notation. Each row corresponds to one equation, each column to one variable, and the augmented column (after the vertical bar) holds the right-hand side constants. This augmented matrix calculator accepts either the matrix directly or a system of equations and converts automatically.

2x + 3y − z = 7 [ 2 3 −1 | 7 ] x − y + 2z = 3 → [ 1 −1 2 | 3 ] 3x + y − z = 5 [ 3 1 −1 | 5 ] Each row = one equation | Each column = one variable | Right of bar = RHS constants

When entering a system into this augmented matrix solver, write the coefficients of each variable in the same column position across all rows. If a variable is missing from an equation, enter 0 for its coefficient. The vertical bar separator is purely visual — it reminds you that the last column plays a different role (it is not being eliminated).

Step-by-Step Gaussian Elimination — The Forward Phase

The forward phase of Gaussian elimination works column by column, left to right. At each column, it selects a pivot (using partial pivoting — choosing the largest available value to minimize numerical error), swaps it into position if needed, then eliminates all entries below it.

Worked Example — Forward Elimination for x + 3y − z = 5, 2x + y + 2z = 8, x − z = 3

  1. Initial augmented matrix: [[1,3,−1|5],[2,1,2|8],[1,0,−1|3]]
  2. Step 1 — Eliminate column 1 below pivot R₁:
    Multiplier for R₂: m = −2/1 = −2 → R₂ + (−2)R₁ → R₂: [2−2,1−6,2+2|8−10] = [0,−5,4|−2]
    Multiplier for R₃: m = −1/1 = −1 → R₃ + (−1)R₁ → R₃: [0,−3,0|−2]
  3. Step 2 — Eliminate column 2 below pivot R₂:
    Multiplier for R₃: m = −(−3)/(−5) = −3/5 → R₃ + (−3/5)R₂ → R₃: [0,0,12/5|−2+6/5]
  4. REF achieved: [[1,3,−1|5],[0,−5,4|−2],[0,0,12/5|−4/5]]

Partial Pivoting: Before eliminating each column, our Gauss elimination calculator scans for the largest absolute value in that column and swaps it to the pivot position. This avoids dividing by very small numbers, which would amplify floating-point errors in decimal arithmetic. Our implementation uses exact fraction arithmetic so this is for robustness rather than numerical stability.

Back Substitution — Solving from the Bottom Up

After Gaussian elimination produces row echelon form (upper triangular), back substitution extracts the solution by working from the bottom row upward. The last row has only one unknown — solve it directly. Substitute that value into the second-to-last row (now one unknown), solve, continue upward. This is why it is called "back" substitution — you work backwards through the rows.

Back Substitution for the REF above:

  1. Row 3: (12/5)z = −4/5 → z = (−4/5)/(12/5) = −1/3
  2. Row 2: −5y + 4(−1/3) = −2 → −5y = −2 + 4/3 = −2/3 → y = 2/15
  3. Row 1: x + 3(2/15) − (−1/3) = 5 → x = 5 − 2/5 + 1/3 → x = computed exactly

Use the gaussian elimination solver above with the "3×3 Unique" example to see this computed with exact fractions at every step.

Gauss-Jordan Elimination — Getting RREF

Gauss-Jordan elimination is the extension of Gaussian elimination that continues after reaching row echelon form. While Gaussian elimination creates zeros only BELOW each pivot, Gauss-Jordan continues to eliminate ABOVE each pivot as well, and scales every pivot to equal 1 — producing the reduced row echelon form (RREF). The Gauss-Jordan solver reads the solution directly from the last column without any back substitution.

REF (after Gaussian): [ 1 3 −1 | 5 ] ← needs back substitution [ 0 −5 4 | −2 ] [ 0 0 1 | −1 ] RREF (after Gauss-Jordan): [ 1 0 0 | 2 ] → x = 2 (read directly) [ 0 1 0 | 1 ] → y = 1 [ 0 0 1 | −1 ] → z = −1 Gauss-Jordan continues Phase 2: eliminate above pivots + scale pivots to 1

Three Types of Solutions — Unique, No Solution, Infinite

Every system of linear equations falls into exactly one of three categories, determined by examining the row echelon form of the augmented matrix. This gaussian elimination method calculator automatically classifies your system and explains why.

Case 1 — Unique Solution (Rank = n variables)

System: 2x+3y=7, x−y=1 → REF: [[2,3|7],[0,−5/2|−5/2]] → y=1, x=2

Every variable has a unique value. Rank = 2 = number of variables.

Case 2 — No Solution / Inconsistent (Row [0 0...0 | c≠0] appears)

System: x+y=3, 2x+2y=7 → R₂−2R₁: [0,0|1] → represents 0=1 → IMPOSSIBLE

The row [0 0 | 1] represents the equation 0x+0y=1, i.e., 0=1, which is a contradiction.

Case 3 — Infinite Solutions (Rank < n variables)

System: x+y+z=6, 2x+2y+2z=12 → R₂−2R₁: [0,0,0|0] → free variables exist

Rank=1 < 3 variables → 2 free variables. Solution: x=6−s−t, y=s, z=t for any s,t.

How to Interpret the Augmented Matrix Result

Reading a row echelon form or RREF augmented matrix requires understanding pivot columns and free variable columns. A pivot column contains a leading 1 (in RREF) or leading nonzero entry (in REF) — the corresponding variable is a basic variable with a definite value. A non-pivot column corresponds to a free variable that can take any value.

Example — Reading a System with One Free Variable

RREF: [[1,2,0|3],[0,0,1|−1]] — columns 1 and 3 are pivot columns, column 2 is free

  1. Let x₂ = t (free parameter, any real number)
  2. From row 2: x₃ = −1
  3. From row 1: x₁ + 2t = 3 → x₁ = 3 − 2t
  4. General solution: x₁ = 3−2t, x₂ = t, x₃ = −1 for any t ∈ ℝ

Gaussian Elimination Worked Examples — 5 Complete Problems

Example 1 — 2×2 Unique Solution: 2x+3y=7, x−y=1

  1. Augmented matrix: [[2,3|7],[1,−1|1]]
  2. R₂ − (1/2)R₁ → R₂: [1−1, −1−3/2, 1−7/2] = [0, −5/2, −5/2]
  3. Back sub: −5y/2 = −5/2 → y=1; 2x+3=7 → x=2
  4. Solution: x=2, y=1

Example 2 — 3×3 Unique Solution: x+3y−z=5, 2x+y+2z=8, x−z=3

  1. Build augmented matrix and apply Gaussian elimination
  2. Forward elimination creates zeros below each pivot
  3. Back substitution from bottom row upward
  4. Solution: x=2, y=1, z=−1 — click "3×3 Unique" above to verify with full steps

Example 3 — 2×2 No Solution: x+y=3, 2x+2y=7

  1. Augmented matrix: [[1,1|3],[2,2|7]]
  2. R₂ − 2R₁ → R₂: [0,0|1] — impossible row!
  3. Result: No solution (inconsistent) — 0=1 is impossible

Example 4 — 3×3 Infinite Solutions: x+y+z=6, 2x+2y+2z=12

  1. R₂ − 2R₁ → R₂ = [0,0,0|0] — all zeros row
  2. Rank = 1 < 3 variables → 2 free variables
  3. General solution: x=6−s−t, y=s, z=t

Example 5 — 4×4 System

  1. Use the "4×4 System" example button above for the full step-by-step solution
  2. Gaussian elimination produces a 4×4 upper triangular system
  3. Back substitution works through 4 variables from bottom to top
  4. All arithmetic shown as exact fractions throughout

Common Mistakes in Gaussian Elimination

Mistake 1 — Wrong sign on the multiplier

  • ❌ Wrong: to eliminate a₂₁ using row 1, use multiplier +a₂₁/a₁₁
  • ✅ Correct: multiplier = −a₂₁/a₁₁ (negative!) so that Rᵢ + m·Rₚ creates a zero

Mistake 2 — Only updating the pivot column, not the whole row

  • ❌ Wrong: only zeroing out the target column entry, leaving other entries unchanged
  • ✅ Correct: the row replacement Rᵢ + m·Rⱼ → Rᵢ must update EVERY column in row i, including the augmented column

Mistake 3 — Not using partial pivoting when pivot is zero or near-zero

  • ❌ Wrong: trying to divide by a pivot of 0 (division by zero error)
  • ✅ Correct: swap with the row below that has the largest absolute value in that column

Mistake 4 — Confusing "no solution" with "infinite solutions"

  • ❌ Wrong: seeing a row of zeros and declaring "no solution"
  • ✅ Correct: a row [0...0|0] means a redundant equation → infinite solutions. Only [0...0|c≠0] means no solution.

Mistake 5 — Forgetting the augmented column in row operations

  • ❌ Wrong: performing R₂ − 2R₁ on the coefficient matrix A but not updating b
  • ✅ Correct: the row operation applies to the ENTIRE augmented row including the right-hand side

Frequently Asked Questions

What is Gaussian elimination?
Gaussian elimination is an algorithm for solving systems of linear equations by transforming the augmented matrix [A|b] into row echelon form (upper triangular form) using elementary row operations, then applying back substitution to find the solution. It is the fundamental algorithm of linear algebra, named after Carl Friedrich Gauss.
What is an augmented matrix?
An augmented matrix [A|b] combines the coefficient matrix A and the right-hand side column vector b into one matrix, separated by a vertical bar. Each row represents one equation and each column represents one variable. The augmented matrix form is the standard input for Gaussian elimination and Gauss-Jordan elimination.
What is the difference between Gaussian elimination and Gauss-Jordan?
Gaussian elimination stops at row echelon form (zeros below pivots) and uses back substitution to find the solution. Gauss-Jordan elimination continues to produce reduced row echelon form (RREF) — zeros both below and above each pivot, with every pivot equal to 1 — so the solution can be read directly from the last column without back substitution.
What are the three elementary row operations?
The three elementary row operations are: (1) Row swap Rᵢ ↔ Rⱼ — exchange two rows; (2) Row scaling kRᵢ → Rᵢ — multiply all entries of a row by a nonzero scalar k; (3) Row replacement Rᵢ + kRⱼ → Rᵢ — add a multiple k of row j to row i. All three operations preserve the solution set of the linear system.
What does a row of zeros mean in the augmented matrix?
A row [0 0 ... 0 | 0] — all zeros including the augmented column — means one equation was a linear combination of the others (redundant). This reduces the rank and creates a free variable, leading to infinitely many solutions. A row [0 0 ... 0 | c] where c≠0 represents the impossible equation 0=c — the system is inconsistent with no solution.
How do you know if a system has no solution?
After Gaussian elimination, if any row of the augmented matrix has the form [0 0 ... 0 | c] where c≠0, the system is inconsistent and has no solution. This row represents the impossible equation 0=c. Our Gaussian elimination calculator automatically detects and highlights this condition.
What is the difference between row echelon form and reduced row echelon form?
Row echelon form (REF) requires zeros below each pivot but allows anything above, and pivots need not equal 1 — back substitution is needed to read the solution. Reduced row echelon form (RREF) requires zeros BOTH below and above each pivot, with every pivot equal to 1 — the solution can be read directly from the matrix. RREF is unique for any given matrix; REF is not.

Related Calculators

Quick Reference
Rᵢ ↔ Rⱼ Row swap (partial pivoting)
kRᵢ → Rᵢ Scale row by nonzero k
Rᵢ + kRⱼ → Rᵢ Add multiple of Rⱼ to Rᵢ
m = −M[i][c] / M[p][c] Elimination multiplier
Period = 2π/|B| for sin/cos REF: zeros below pivots
RREF: pivot cols = identity Gauss-Jordan result
Rank = # nonzero rows in REF Determines solution type
Free vars = n_cols − rank Number of parameters
Solution Types
✅ Unique Solution
Rank = n variables
♾️ Infinite Solutions
Rank < n, no contradiction
❌ No Solution
Row [0...0 | c≠0] found

Share This Tool

Share the Gaussian Elimination Calculator!

Free chemistry, physics, biology & math calculators with step-by-step solutions. Trusted by 100,000+ students. Solve any science problem instantly!

Newsletter

Subscribe to our Newsletter to be updated. We promise not to spam.

Copyright © 2026 SciSolveLab. All Rights Reserved

Scroll to Top