Linear Equation Solver: Solve for x Step by Step
Type an equation with one unknown, or fill in its four numbers. The solver collects the terms, divides, and checks the answer on both sides while you watch.
This tool runs in your browser. Nothing you type is uploaded or saved, and there is nothing to install or sign up for.
What counts as a linear equation here
A linear equation in one variable has an unknown, usually x, that is only ever multiplied or divided by plain numbers. There is no x², no x under a root and no x in a denominator. 3x + 5 = 2x - 7 is linear. So is x/2 + 1 = 4. Every equation of this kind can be tidied into the same shape, ax + b = cx + d, and that shape is what the solver works on.
Such an equation ends in one of three ways: exactly one answer, no answer at all, or every number being an answer. The solver tells you which, and shows the algebra that proves it.
Entering your equation
- Leave How to enter it on Type the equation and write it in the Equation box the way it looks in your book.
- Use any single letter for the unknown. Terms can be whole numbers, decimals or a division by a number, such as
x/4or3x/2. - If the same kind of term appears more than once on a side, such as
2x + 3 + x, type it as it is. Like terms are combined for you. - Prefer boxes? Choose Fill in four numbers and enter a, b, c and d from
ax + b = cx + d, with 0 for anything missing. - Read the answer in the navy panel and the working in the lines under it. Copy solution copies the equation with its answer, and Reset restores the opening example.
Worked example: 3x + 5 = 2x − 7
This is the equation on screen when the page loads.
- Gather. Subtract 2x from both sides and subtract 5 from both sides:
3x - 2x = -7 - 5. - Simplify. The left side is 1x and the right side is −12.
- Divide. The number in front of x is already 1, so x = −12.
- Check. Left side: 3 × (−12) + 5 = −31. Right side: 2 × (−12) − 7 = −31. Both match, so the answer is right.
A second one with a fraction answer: 4x - 7 = 2x + 6. Gathering gives 2x = 13, and dividing by 2 gives x = 6.5. Because the inputs are whole numbers, an extra line shows the exact fraction, 13/2.
The method in one line
Start from ax + b = cx + d. Moving the x terms to the left and the plain numbers to the right gives (a - c)x = d - b, so
x = (d - b) / (a - c)
That division is only possible when a and c are different. What happens when they are equal is the interesting part.
| After simplifying | Result | Example |
|---|---|---|
| A number times x equals a number | One solution | 2x + 3 = 11 gives x = 4 |
| 0 equals a number that is not 0 | No solution | 2x + 3 = 2x + 5 leaves 0 = 2 |
| 0 equals 0 | Infinitely many solutions | 2x + 3 = 2x + 3 |
No solution
In 2x + 3 = 2x + 5 both sides grow at the same rate but start 2 apart, so they can never meet. On a graph these would be two parallel lines. The solver shows the leftover statement 0 = 2 so you can see the contradiction for yourself.
Infinitely many solutions
In 2x + 3 = 2x + 3 the two sides are identical. Whatever you substitute, the equation holds. Teachers call this an identity. It often appears after you expand brackets and find that both sides were the same expression in disguise.
What the solver does not read
- Brackets. Expand
2(x + 3)to2x + 6before typing. If you are unsure about the order of steps in an expansion, the order of operations calculator walks through one. - Two unknowns. An equation with both x and y has a whole line of answers, not one. To study that line, use the slope calculator.
- Powers of x. Anything with x² belongs in the quadratic formula calculator.
- Fractions with x underneath. A term like 3/x is not linear, so it is not accepted.
- Typed fractions as coefficients. Write (3/4)x as
3x/4or as0.75x.
Answers are rounded to 10 significant digits. A repeating decimal such as 0.3333333333 is shown with its exact fraction next to it when your numbers allow, so copy the fraction if your teacher wants an exact answer.
Habits that prevent wrong answers
Most errors in this topic are sign errors. When a term crosses the equals sign it changes sign, because you are really adding or subtracting the same thing on both sides. The first step line prints every moved term in brackets if it is negative, so you can compare signs with your own page one by one.
The second habit is the check. Put your answer back into the original equation, not a line from halfway through your working, and work out each side separately. If the two sides disagree, the mistake is somewhere above. The two check lines here do the same thing, which makes them a quick way to mark a full worksheet.
When the answer is a fraction, keep it as a fraction until the end. Rounding 13/2 is harmless, but rounding 1/3 to 0.33 and reusing it will throw off later steps. The fraction calculator can help when the coefficients themselves are fractions and need a common denominator first.
Using it for class and revision
Students can cover the working lines, solve on paper, and then reveal one step at a time to find the first line that differs. Teachers building a quiz can use the four-number mode to produce equations with a chosen answer: pick x, pick a, c and b, then set d so both sides agree. Setting a equal to c on purpose creates a no-solution or identity question, which is a good test of whether a class understands the idea or is only following a recipe.
Other algebra and arithmetic helpers sit with the math calculators, and the full list of free tools for students and teachers covers timers, pickers and converters too.
Frequently asked questions
How do you solve a linear equation with x on both sides?
Move the x terms to one side and the plain numbers to the other, simplify, then divide by the number in front of x. For 3x + 5 = 2x – 7 that gives x = -12.
How do I know if a linear equation has no solution?
After you collect terms the x terms cancel and you are left with a false statement such as 0 = 2. For example, 2x + 3 = 2x + 5 has no solution.
What does infinitely many solutions mean?
Both sides of the equation are the same expression, so every value of x makes it true. After collecting terms you are left with 0 = 0, as in 2x + 3 = 2x + 3.
How do I check my answer to a linear equation?
Substitute the answer into both sides of the original equation and work each side out. With x = -12 in 3x + 5 = 2x – 7, both sides come to -31, so the answer is correct.
Can this solver handle fractions and decimals?
Yes. Type decimals directly, or write a division by a number such as x/2 or 3x/4. For example, x/2 + 1 = 4 gives x = 6.
Can I use a letter other than x?
Yes. Any single letter works, as long as it is the only letter in the equation. Typing 2y = 10 gives y = 5.
