System Size
Enter Coefficients
Solution
Augmented Matrix [A|b]
Initial Matrix
Row-Reduced Matrix
Step-by-Step Row Operations

Gaussian Elimination Algorithm

Gaussian elimination converts a system of linear equations into an equivalent upper triangular form through elementary row operations, then solves by back substitution.

Forward elimination: For each column (pivot column), find the row with the largest absolute value in that column (partial pivoting for numerical stability) and swap it to the pivot position. Then subtract multiples of the pivot row from all rows below to introduce zeros beneath the pivot.

Back substitution: Starting from the last equation (which now has only one unknown), solve for that variable. Substitute upward into each previous equation to find the remaining unknowns.

Example for a 3×3 system: given the augmented matrix [A|b], after two elimination steps the matrix has the upper triangular form:

[ a₁₁ a₁₂ a₁₃ | b₁ ] [ 0 a₂₂' a₂₃'| b₂'] [ 0 0 a₃₃''| b₃'']

Then x₃ = b₃''/a₃₃'', x₂ = (b₂' − a₂₃''·x₃)/a₂₂', x₁ = (b₁ − a₁₂·x₂ − a₁₃·x₃)/a₁₁.

Types of Solutions in Linear Systems

A system of n linear equations in n unknowns has exactly one of three possible outcomes:

Partial Pivoting and Numerical Stability

When computing by hand you can choose any non-zero pivot, but computers use partial pivoting: before eliminating column j, swap rows to put the element with the largest absolute value in position (j, j). This prevents dividing by a very small number, which would amplify rounding errors and produce wildly inaccurate results.

Without pivoting, a system like the one below is numerically disastrous for small ε:

εx + y = 1 x + y = 2

Partial pivoting swaps the rows first, making the computation stable regardless of ε. All solutions produced by this solver use partial pivoting.

Frequently Asked Questions
Gaussian elimination is a systematic algorithm for solving systems of linear equations. It works in two phases: forward elimination transforms the augmented matrix [A|b] into upper triangular form by applying elementary row operations, then back substitution solves for each variable from the bottom row upward.
A system has no solution (is inconsistent) when Gaussian elimination produces a row of the form [0, 0, …, 0 | c] where c ≠ 0. This means one equation reduces to a contradiction such as "0 = 5". Geometrically, for two equations this means the lines are parallel; for three equations the planes may form a prism with no common intersection.
Write the augmented matrix [A|b]. Use the first pivot to eliminate the first variable from rows 2 and 3. Use the second pivot to eliminate the second variable from row 3. This gives upper triangular form. Then back-substitute: solve row 3 for x₃, substitute into row 2 to get x₂, and substitute both into row 1 to get x₁.
An augmented matrix combines the coefficient matrix A and the constant vector b side by side, written [A|b]. For a system a₁x + b₁y = c₁ and a₂x + b₂y = c₂, the augmented matrix is [[a₁, b₁ | c₁], [a₂, b₂ | c₂]]. It is a compact notation that keeps track of all the numbers in the system during row reduction.