KitQuarter

Linear Equation Solver

Solve a linear equation in one step. Enter a and b to solve ax + b = 0, or switch to the system mode and solve two equations for x and y together, with every step shown. Free, no sign-up, everything runs in your browser.

Pick one equation for a single value of x, or a system for x and y together.

The number in front of x. It cannot be 0 for a single answer.

The number added to the x term.

Formula: for ax + b = 0, x = -b / a. For a system, Cramer's rule uses the determinant D = a1 x b2 - a2 x b1.

James Carter, Math and Tools Editor
Reviewed by James Carter, Math and Tools Editor · 59 calculator guides
Formulas verified against standard references. Calculator logic tested with verified worked examples. Published: November 9, 2026 | Last updated: November 9, 2026. Fact-checked: November 9, 2026. Our methodology

How to Use the Linear Equation Solver

Getting an answer takes three quick steps. The tool handles one equation or a system of two, and the fields change to match your choice.

  1. Pick what to solve in the first field. Choose one equation for ax + b = 0, or two equations for a system with x and y.
  2. Enter the numbers. For one equation, enter a and b. For a system, enter the six coefficients a1, b1, c1, a2, b2 and c2.
  3. Press Calculate, or press Enter. The answer appears first and large, with a check that plugs it back into the equation. Press Reset to clear the form and start over.

Watch the signs. In 2x - 10 = 0, b is -10, not 10. Entering the wrong sign is the most common way to get a wrong answer from a correct method.

Linear equation solver hero: a notebook with 2x - 10 = 0 solved step by step in blue pen
One equation gives one value of x. A system gives x and y together.

The Formula for ax + b = 0

A linear equation in one variable has the form ax + b = 0, where a and b are numbers and x is the unknown. The solution is x = -b / a, as long as a is not 0. You get it by moving b to the other side and then dividing by a.

The two steps are simple to follow. First subtract b from both sides, which gives ax = -b. Then divide both sides by a, which gives x = -b / a. For 2x - 10 = 0, that is x = 10 / 2 = 5. Plugging 5 back in gives 2 x 5 - 10 = 0, which confirms the answer.

The formula works for any numbers, including fractions and decimals. If the answer comes out as a fraction, keep it exact when you need it exact. Our fraction calculator helps when the arithmetic stays in fractions and you want to avoid rounding.

Worked Example: 2x - 10 = 0

Solve 2x - 10 = 0. Here is exactly what the calculator does.

  1. Move b to the other side: 2x = 10.
  2. Divide both sides by 2: x = 10 / 2 = 5.
  3. Check: 2 x 5 - 10 = 10 - 10 = 0, so x = 5 is correct.

As a second check, 3x + 9 = 0 gives x = -9 / 3 = -3, and 3 x (-3) + 9 = 0. The same two steps work for any a and b, as long as a is not 0.

A student solving algebra on a whiteboard with two straight lines crossing on a graph
The check step plugs the answer back into the equation.

Solving a System of Two Equations

A system has two equations and two unknowns, written a1x + b1y = c1 and a2x + b2y = c2. The solution is the one pair of x and y that makes both equations true at the same time, which is the point where the two lines cross on a graph.

This calculator uses Cramer's rule. First find the determinant D = a1 x b2 - a2 x b1. Then find Dx = c1 x b2 - c2 x b1 and Dy = a1 x c2 - a2 x c1. The answers are x = Dx / D and y = Dy / D. For the system 2x + y = 5 and 3x - 2y = 4, D = 2 x (-2) - 3 x 1 = -7, Dx = 5 x (-2) - 4 x 1 = -14, and Dy = 2 x 4 - 3 x 5 = -7, so x = -14 / -7 = 2 and y = -7 / -7 = 1.

Always check both equations. Here 2 x 2 + 1 = 5 and 3 x 2 - 2 x 1 = 4, so the pair works. If only one equation checks out, a sign slipped in somewhere.

When There Is No Single Answer

Sometimes there is no single answer, and the calculator tells you so instead of giving a wrong number. For one equation, that happens when a = 0. If b is also 0, the equation reads 0 = 0, which is true for every value of x, so there are infinitely many solutions. If b is not 0, the equation reads something like 5 = 0, which is never true, so there is no solution at all.

For a system, the same idea shows up in the determinant. When D = 0, the two lines are parallel or the same line. If they are the same line, every point on it is a solution, so there are infinitely many. If they are parallel but different, they never meet, so there is no solution. The system x + y = 2 and 2x + 2y = 5 has D = 0 and no solution, while x + y = 2 and 2x + 2y = 4 has D = 0 and infinitely many solutions, because the second equation is just the first one doubled.

Our decimal to fraction calculator is useful when a system gives decimal answers that you want to read as exact fractions instead.

Common Linear Equation Mistakes

Forgetting to flip the sign when moving b across is the most common error. In 2x - 10 = 0, moving -10 to the right gives 2x = 10, not 2x = -10. Think of it as adding 10 to both sides, which keeps the balance.

Dividing only one term by a is next. In 2x + 6 = 0, dividing by 2 means every term changes, so x + 3 = 0 and x = -3. Dividing only the 2x and leaving the 6 alone gives a wrong answer.

In a system, the most common error is mixing up which coefficient goes where in the determinant. D uses a1 with b2 and a2 with b1, and the minus sign between them matters. Write the two rows out as a small grid first, then read the determinant off the grid, and the signs take care of themselves.

A balance scale on a desk with small weights, symbolizing both sides of an equation
Whatever you do to one side, do to the other side too.

Frequently asked questions

How do I solve ax + b = 0?

Move b to the other side and divide by a. The answer is x = -b / a. For 2x - 10 = 0, x = 10 / 2 = 5.

What if a is 0?

Then there is no single answer. If b is also 0, every value of x works. If b is not 0, no value of x works, because the equation reads something like 5 = 0.

How do I solve two equations at once?

Use Cramer's rule. Find D = a1 x b2 - a2 x b1, then x = (c1 x b2 - c2 x b1) / D and y = (a1 x c2 - a2 x c1) / D. For 2x + y = 5 and 3x - 2y = 4, the answer is x = 2 and y = 1.

What is Cramer's rule?

It is a method for solving systems with determinants. Each unknown is a ratio of two determinants, one built from the constants and one built from the coefficients. It works whenever the main determinant is not 0.

Can a linear equation have more than one answer?

A single equation ax + b = 0 with a not equal to 0 has exactly one answer. It has infinitely many only when a = 0 and b = 0, which makes the equation 0 = 0.

What does it mean if the determinant is 0?

The two lines are parallel or the same line. If they are the same line, there are infinitely many solutions. If they are parallel and different, there is no solution.