System of Linear Equations Solver using Gaussian Elimination

Solve 2–8 equations in 2–8 unknowns. See every pivot, row swap, elimination, and back-substitution step; coefficients stay in your browser.

Enter the Augmented System

Standard suits most decimal data. A coefficient at or below the selected size relative to its row is not used as a pivot.

Each row is an equation. Enter integers, decimals, or scientific notation; the final column is the right-hand-side constant.

Put equations on separate lines and separate values with spaces, commas, or tabs. Each row must contain all coefficients followed by one constant.

Solution

Enter a valid system to calculate its solution set.
rank(A)
rank([A | b])
Pivot / free variables
Row operations
Solution classification and numerical checks appear after a successful calculation.

Advertisement

Gaussian-Elimination Steps

Rows are numbered from 1. The vertical divider separates coefficients from constants.

Solve a valid system to see its augmented matrix after every row operation.

Gaussian Elimination Formula and Method

Augmented matrix

Ax = b  →  [A | b]

Place each equation’s coefficients in a row and its constant in the final column.

Forward elimination

Rᵢ ← Rᵢ − (aᵢₖ/aₖₖ)Rₖ

Clear entries below each pivot to produce row echelon form.

Back-substitution

xₖ = (bₖ − Σ aₖⱼxⱼ) / aₖₖ

Start at the last pivot equation and work upward to recover the variables.

Numerical method: The solver uses scaled partial pivoting and JavaScript double-precision arithmetic. It accepts zero or finite nonzero inputs from 10⁻⁴⁰ through 10⁴⁰ in magnitude. The selected relative tolerance controls numerical rank decisions; use exact rational or arbitrary-precision software when exact symbolic results are required.

How to Solve a Linear System

  1. Choose the equation and variable counts. They do not need to match.
  2. Enter the coefficient of each variable and the right-hand-side constant, or paste the complete augmented matrix.
  3. Select Solve system. The solver chooses scaled partial pivots and eliminates coefficients below them.
  4. Read the unique values, parameterized family, or contradiction; then expand the row-operation stages to inspect the work.

Worked 3-Equation Example

System

x + 2y − z = −4
2x + 3y − z = −11
−2x − 3z = 22

Solution

x = −8,   y = 1,   z = −2

All three variable columns contain pivots, so the solution is unique.

Unique, Infinite, and Inconsistent Systems

A consistent system has a unique solution when every variable column contains a pivot. When one or more variable columns are free, the solver writes the infinitely many solutions using parameters such as t₁ and t₂.

A row [0 0 … 0 | c] with nonzero c is a contradiction, so no solution exists. Equivalently, the system is consistent exactly when rank(A) = rank([A | b]).

Linear Equations Solver FAQs

What is Gaussian elimination?

It applies reversible row swaps and row replacements to turn an augmented matrix into row echelon form. A triangular system can then be solved from the bottom upward.

Why does the solver swap equations?

Scaled partial pivoting selects a strong available coefficient and moves its row into the pivot position. This avoids zero pivots and usually improves numerical stability.

Can there be more equations than variables?

Yes. An overdetermined system may still be consistent and have one solution, or it may contain a contradiction. Redundant equations do not change the solution set.

What causes infinitely many solutions?

A consistent system has infinitely many solutions when its coefficient rank is smaller than its number of variables. Each non-pivot variable becomes a free parameter.

How is no solution detected?

Elimination exposes a contradictory row whose coefficients are all zero but whose constant is nonzero. This makes the coefficient rank smaller than the augmented-matrix rank.

Why can decimal results show small errors?

Most decimal fractions cannot be represented exactly in binary floating point. Poor scaling or nearly dependent equations can amplify that rounding, so interpret sensitive systems with care.

Are my coefficients private?

Yes. The page parses and solves the system locally, and creates copied text and downloads in your browser. The solver code does not transmit or save entered coefficients.

Calculation Notes

Last reviewed: August 5, 2026 by the Starlight Tools editorial team.

Scaled partial pivoting compares each candidate coefficient with the largest coefficient in its row. The reported residual for a unique solution is max |Ax − b| using the original inputs. Near-singular systems may change classification when the pivot tolerance changes.

Explore more tools