Skip to main content
Online
Algebra · step-by-step

System of Linear Equations Solver

Type the coefficients of up to four equations. The solver performs Gaussian elimination with exact fractions and shows every row operation, including when a system has no solution or infinitely many.

Each row is one equation. Leave a box empty for 0. Fractions like -2/3 are fine.

Complete guide

Solving systems of linear equations: substitution, elimination and Gaussian elimination

3 min read Reviewed By the GetCalcMaster team · Editorial policy

A system of linear equations asks for values of several unknowns that satisfy every equation at once. Geometrically, two equations in x and y are two lines and the solution is where they cross; three equations in x, y and z are three planes. A system can have exactly one solution, no solution (parallel lines or planes) or infinitely many solutions (the same line or plane written twice).

This solver uses Gaussian elimination on the augmented matrix with exact fractions, the same algorithm taught in linear algebra courses and used inside most numerical software. Each column's row operations are listed, followed by a substitution check.

Key formulas

Matrix form
A x = b
A holds the coefficients, x the unknowns, b the right-hand sides.
Elementary row operations
swap two rows · multiply a row by a non-zero constant · add a multiple of one row to another
None of these changes the solution set.
Cramer's rule (2 × 2)
x = (b₁a₂₂ − a₁₂b₂)/det A, y = (a₁₁b₂ − b₁a₂₁)/det A
Useful for small systems; det A = a₁₁a₂₂ − a₁₂a₂₁ must be non-zero.
Rank test (Rouché–Capelli)
rank A = rank [A|b] = n → unique; rank A = rank [A|b] < n → infinite; rank A < rank [A|b] → none
The general rule for the number of solutions.

Worked examples

Example 1: A classic 3 × 3 system

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

  1. Write the augmented matrix and eliminate x from rows 2 and 3.
  2. Eliminate y from rows 1 and 3 using the new row 2.
  3. Back-substitute or continue to reduced row echelon form.
Answer: x = 2, y = 3, z = −1.
Example 2: Two equations by elimination

3x + 2y = 12 and x − y = −1.

  1. Multiply the second equation by 2: 2x − 2y = −2.
  2. Add to the first: 5x = 10, so x = 2.
  3. Substitute: 2 − y = −1, so y = 3.
Answer: (2, 3).
Example 3: No solution

x + 2y = 3 and 2x + 4y = 7.

  1. Subtract twice the first equation from the second: 0 = 1.
Answer: No solution — the lines are parallel.
Example 4: Mixture problem

A chemist needs 10 L of a 30% acid solution from 20% and 50% stock. How much of each?

  1. Let x = litres of 20%, y = litres of 50%.
  2. x + y = 10 and 0.2x + 0.5y = 3.
  3. From the first, x = 10 − y; then 2 − 0.2y + 0.5y = 3 → 0.3y = 1 → y = 10/3.
Answer: ≈ 6.67 L of 20% and 3.33 L of 50% stock.

Substitution vs elimination vs matrices

Substitution (solve one equation for a variable and plug it into the others) is natural for two equations, especially when one variable has coefficient 1. Elimination (add multiples of equations to cancel a variable) scales better. Gaussian elimination is just elimination organized in a matrix, which is why it is the method of choice for three or more unknowns and for computers.

Reading the reduced matrix

  • A row of zeros with a non-zero right-hand side (0 = c) means the system is inconsistent.
  • A column without a pivot corresponds to a free variable: infinitely many solutions.
  • A pivot in every variable column means a unique solution, read directly from the last column.

Common mistakes to avoid

  • Applying a row operation to only part of a row (including forgetting the right-hand side).
  • Sign errors when subtracting a negative multiple.
  • Dividing by a pivot that is zero — swap rows first.
  • Stopping at echelon form and misreading the values without back-substitution.

Frequently asked questions

How many equations do I need?
Generally as many independent equations as unknowns. Fewer equations usually give infinitely many solutions; more can be inconsistent.
Why does the solver use fractions?
Exact fractions avoid rounding errors that build up over many row operations, so you can see the textbook answer like 7/3 instead of 2.3333.
Can it solve nonlinear systems?
No — this tool is for linear equations. For nonlinear systems use the numerical methods lab or the CAS.

Related tools and guides

Educational content. Results are computed in your browser with standard double-precision arithmetic; double-check anything with legal, financial, medical, or safety consequences. Spotted an error? Tell us and we will correct it.