Skip to content
Calc.

Linear Equation Solver

Solve a linear equation in one variable of the form ax + b = c for x, including the cases with no solution or infinitely many.

Last updated: October 2026

Solution x

-3

Formula below · 3 sources (khanacademy.org, mathsisfun.com, mathworld.wolfram.com) · Updated Oct 2026

Compare with similar

About this calculator

A linear equation in one variable can always be rearranged into the form

ax + b = c

Subtract b from both sides and divide by a:

x = (c − b) ÷ a

With the defaults, 2x + 6 = 0 gives x = (0 − 6) ÷ 2 = −3. Check: 2 × (−3) + 6 = 0.

Getting an equation into this form

Expand brackets, then collect the x terms on the left and the numbers on the right. For 3x + 5 = 2x − 4: subtract 2x from both sides to get x + 5 = −4, so a = 1, b = 5, c = −4 and x = −9. For 4(x − 2) = 10: expand to 4x − 8 = 10, so a = 4, b = −8, c = 10 and x = 4.5.

Special cases

If a = 0 the x disappears. When b = c every number is a solution (an identity such as 5 = 5); otherwise there is no solution (a contradiction such as 6 = 0). Graphically, x is where the line y = ax + b meets the horizontal line y = c; when a = 0 the two lines are parallel or the same.

How to use

Rearrange your equation to ax + b = c, then enter a, b and c (leave c blank if the right side is 0). Example 1 (defaults): 2x + 6 = 0 → x = −3. Example 2: 3x − 7 = 11 → a = 3, b = −7, c = 11 → x = 18 ÷ 3 = 6. Example 3: 0.5x + 1.25 = 4 → x = 2.75 ÷ 0.5 = 5.5. Example 4: 3x = 1 → a = 3, b = 0, c = 1 → x = 0.33333333 (one third).

Frequently asked questions

How do you solve a linear equation?

Get the x terms on one side and the numbers on the other, then divide by the coefficient of x. For 3x − 7 = 11: add 7 to get 3x = 18, then divide by 3 to get x = 6.

What if the equation has x on both sides?

Subtract one x term from both sides first. 5x + 2 = 3x + 10 becomes 2x + 2 = 10, so a = 2, b = 2, c = 10 and x = 4.

What happens when a = 0?

The equation no longer contains x. If the two sides are equal (for example 4 = 4) every x is a solution; if they differ (4 = 7) there is no solution.

Can a linear equation have more than one solution?

Not unless it is an identity. A linear equation in one variable has exactly one solution when a ≠ 0, none when it reduces to a false statement, and infinitely many when it reduces to a true one.

Related calculators

Sources & references

How we check our calculators

Think a result is wrong? Report a problem with this calculator.