Skip to content

Linear equation calculator

Enter the two numbers in the equation and solve for x.

Standard form

ax + b = 0

Why does the equation end with 0?

It is a convenient standard form. Move everything to the left side first. For example, 2x + 3 = 7 becomes 2x − 4 = 0. Both equations have the same answer.

Fill in the equation

Your data stays in this browser.

Replace a and b with the numbers from your equation.

Enter b with its sign. Example: for 2x − 8 = 0, enter a = 2 and b = −8.

Answer

Your answer will appear here

Enter a and b, then press Calculate.

How to use this linear equation calculator

What a and b mean

In ax + b = 0, a is the number multiplying x and b is the constant number. The unknown is x. Enter only the two real coefficients, not the letter x or a full equation.

How the answer is found

The calculator moves b to the other side and divides by a: ax = −b, so x = −b/a. The displayed answer uses at most two ordinary decimal places, while very small nonzero answers use scientific notation.

What happens when a is zero

If a = 0 and b = 0, the statement is 0 = 0, so every real number works. If a = 0 and b is not zero, the statement cannot be true and there is no solution.

Examples

2x − 8 = 0

Enter a = 2 and b = −8. The answer is x = 4.

−3x + 6 = 0

Enter a = −3 and b = 6. The answer is x = 2.

0x + 5 = 0

Enter a = 0 and b = 5. There is no solution.

Frequently asked questions

Do I type the x?

No. Type only the number in front of x into a and the constant number into b.

How do I enter subtraction?

Put the minus sign in the coefficient. For x − 5 = 0, enter a = 1 and b = −5.

Can I paste a full equation?

No. This focused calculator accepts coefficients only. Rearrange the equation so the right side is zero first.

Are decimals allowed?

Yes. Use a decimal point, such as 2.5, in every language version.