Free calculator

System of Linear Equations Solver (2×2 and 3×3)

Two or three equations, solved by elimination, substitution or Cramer’s rule — in exact fractions, with every row operation shown.

To solve a system of linear equations, eliminate one unknown at a time until a single equation remains, then substitute back. For 2x + y − z = 8, −3x − y + 2z = −11 and −2x + y + 2z = −3, the solution is x = 2, y = 3, z = −1. Cramer’s rule gets the same answer using determinants.

Try it now

Updates as you type
Solution x = 2, y = 3, z = −1 One solution: the lines (or planes) meet at a single point.

Step by step

  1. The system
    2x + y − z = 8
    −3x − y + 2z = −11
    −2x + y + 2z = −3
  2. Write the augmented matrix [A | b]
    21−18−3−12−11−212−3
  3. Clear the entries below the pivot: R2 → R2 + 3/2·R1, R3 → R3 + R1
    21−180121210215
  4. Clear the entries below the pivot: R3 → R3 − 4·R2
    21−1801212100−11
  5. Back-substitute to find z
    −z = 1 ⇒ z = −1
  6. Back-substitute to find y
    12y + 12z = 1 ⇒ 12y + 12(−1) = 1 ⇒ y = 3
  7. Back-substitute to find x
    2x + y − z = 8 ⇒ 2x + (3) − (−1) = 8 ⇒ x = 2
  8. Check every equation
    2(2) + (3) − (−1) = 8 ✓
    −3(2) − (3) + 2(−1) = −11 ✓
    −2(2) + (3) + 2(−1) = −3 ✓

Also worth knowing

Determinant D
−1

Three methods, one answer

  • Elimination (Gaussian): add multiples of one equation to another to create zeros below each pivot, then back-substitute. It works for any size and tells you when there is no solution or infinitely many.
  • Substitution: solve one equation for one unknown and put that into the others. Quick for two equations, clumsy for three.
  • Cramer’s rule: each unknown is a ratio of two determinants, x = Dₓ ÷ D. It needs D ≠ 0 and is the natural partner of the rule of Sarrus for 3×3 systems.

Reading the three possible outcomes

One solution: the lines (or planes) meet at a single point, and D ≠ 0. No solution: the equations contradict each other, like x + 2y = 3 and 2x + 4y = 7, where doubling the first gives 2x + 4y = 6. Infinitely many: one equation is a multiple or combination of the others.

When D = 0, Cramer’s rule cannot tell the last two apart; elimination can, which is why the solver falls back to it and says which case you have.

Exact answers

All the arithmetic is done in fractions, so a system whose solution is x = 1/2 shows 1/2 rather than 0.5 or 0.499999. Decimals are accepted as input and converted exactly. Every solution is substituted back into each original equation at the end, so you can see the check rather than take it on trust.

Worked examples

Worked examples

Each one is computed by the calculator above, so the answers are the real output.

Two equations by substitution

2x + 3y = 7 and 4x − y = 0. The second equation isolates y = 4x immediately.

Solution x = 12, y = 2 One solution: the lines (or planes) meet at a single point.

Step by step

  1. The system
    2x + 3y = 7
    4x − y = 0
  2. Isolate y in equation 2
    y = 4x
  3. Substitute that into equation 1
    2x + 3(4x) = 7
  4. Collect the terms
    14x = 7
  5. Solve for x
    x = 12
  6. Put it back to find y
    y = 4(12) = 2
  7. Check every equation
    2(12) + 3(2) = 7 ✓
    4(12) − (2) = 0 ✓

Also worth knowing

Determinant D
−14

Three equations by Cramer’s rule

2x − y + 3z = 9, x + 2y − z = 2, 3x + y + z = 8. Four determinants, one division each.

Solution x = 1, y = 2, z = 3 One solution: the lines (or planes) meet at a single point.

Step by step

  1. The system
    2x − y + 3z = 9
    x + 2y − z = 2
    3x + y + z = 8
  2. Work out the determinant of the coefficient matrix
    D = 2−1312−1311 = −5
  3. Replace the x column with the constants and take that determinant
    Dx = 9−1322−1811 = −5
  4. Replace the y column with the constants and take that determinant
    Dy = 29312−1381 = −10
  5. Replace the z column with the constants and take that determinant
    Dz = 2−19122318 = −15
  6. Divide each determinant by D
    x = DxD = −5−5 = 1
    y = DyD = −10−5 = 2
    z = DzD = −15−5 = 3
  7. Check every equation
    2(1) − (2) + 3(3) = 9 ✓
    (1) + 2(2) − (3) = 2 ✓
    3(1) + (2) + (3) = 8 ✓

Also worth knowing

Determinant D
−5

A system with no solution

x + 2y = 3 and 2x + 4y = 7: the left sides are proportional but the right sides are not.

Solution No solution A row reduced to 0 = a non-zero number, so the equations contradict each other — the lines are parallel and never meet.

Step by step

  1. The system
    x + 2y = 3
    2x + 4y = 7
  2. Write the augmented matrix [A | b]
    123247
  3. Clear the entries below the pivot: R2 → R2 − 2·R1
    123001

Also worth knowing

Determinant D
0

FAQ

Questions people ask

How do you solve a system of three equations?

Use elimination: clear the first unknown from equations 2 and 3, clear the second from equation 3, then back-substitute from the bottom up. Or use Cramer’s rule with four 3×3 determinants.

What does it mean when the determinant is zero?

The equations are dependent, so there is either no solution or infinitely many. Elimination shows which: a row 0 = 5 means none, a row 0 = 0 means infinitely many.

Which method is best?

Elimination is the most reliable for any size. Substitution suits two simple equations, and Cramer’s rule suits small systems when you already have determinant tools.

Can it solve systems with fractions or decimals?

Yes, and it keeps the arithmetic exact.

Related app: Sarrus Rule Calculator

This one lives on the website. The related app below covers the surrounding topic.

Free to download. AI explanations and dark mode are part of the optional PRO subscription.