Audited ·Last updated 27 Jul 2026·5 citations·Tier 2·0 uses

Linear Equation Calculator

Solve ax + b = c for x instantly. Free linear equation calculator with step-by-step math, slope-intercept form, and a built-in answer check.

Linear Equation Calculator

The number multiplying x. Any nonzero real number works, including negatives and decimals. Entering 0 is allowed here, but the calculator will explain why it cannot return a single solution in that case.
The constant added on the same side as ax. Any real number, positive, negative, or zero.
The value on the other side of the equals sign. Any real number.
Solution (x)
5
The solution to ax + b = c, computed as x = (c − b) / a.
Slope of y = ax + b
2
y-intercept of y = ax + b
5
Check: a·x + b
15

Background.

A linear equation calculator solves the single most common algebraic sentence there is: a coefficient times an unknown, plus a constant, set equal to some target value — ax + b = c. Enter 2x + 5 = 15 and the calculator returns x = 5 in a single step, along with a check value (2·5 + 5 = 15) so you can confirm the arithmetic without picking up a pencil. The method behind it is the same balancing technique taught in every introductory algebra course and, in essence, the same technique al-Khwarizmi formalized in ninth-century Baghdad in the book whose title gave us the word "algebra" in the first place: move every x-term to one side, move every constant to the other, and divide.

What makes a dedicated linear equation calculator worth having, rather than just doing the two-line rearrangement by hand, is the trap most homemade solvers fall into: the coefficient a is allowed to be zero, and zero is not just another number here — it breaks the formula. Dividing (c − b) by a zero coefficient does not describe a real solution; it describes one of two genuinely different situations. If b happens to equal c when a is zero, the equation reads 0 = 0, which is true no matter what x is, so there are infinitely many solutions and no single number to report. If b does not equal c, the equation reads something like 0 = 4, which is false no matter what x is, so there is no solution at all. A calculator that quietly returns Infinity, NaN, or a blank field in either case is giving you a wrong answer dressed up as a number. This one raises a clear, specific error instead, and the content below walks through both cases so you can recognize them the next time you see one by hand.

Beyond the single number x, this calculator does something a plain solve-for-x tool does not: it reads the same two coefficients, a and b, as the slope and y-intercept of the function y = ax + b. That is not a coincidence or a bonus feature bolted on for fun — the left-hand side of the equation you are solving is, structurally, already a linear function. Setting ax + b equal to a target value c and asking "which x achieves that?" is exactly the same question as asking "at what x does the line y = ax + b cross the horizontal line y = c?" Seeing both readings side by side is genuinely useful the first time a student meets the connection between solving equations and graphing lines, and it is a fast sanity check for anyone who already knows the connection and just wants the number.

Negative and fractional coefficients are completely ordinary inputs here — a slope of −3, a constant of −2, decimal coefficients like 0.5 — none of that is an edge case, and the calculator handles all of it with full-precision decimal arithmetic rather than floating-point shortcuts that can drift on repeated operations. The only inputs that are genuinely rejected are non-finite values and the a = 0 degenerate cases described above. Everything else, including a solution x that itself comes out negative, zero, or fractional, is simply the answer.

What is linear equation calculator?

A linear equation in one variable is any equation that can be written in the form ax + b = c, where a, b, and c are known real numbers and x is the unknown. The word "linear" refers to the fact that x appears only to the first power — no x², no √x, no 1/x — which is exactly what makes the equation graphable as a straight line and solvable by simple rearrangement rather than a more elaborate formula. Provided a is not zero, every linear equation in this form has exactly one solution: x = (c − b) / a. When a is zero, the equation stops being genuinely linear in x (the x term has vanished entirely) and instead reduces to a bare statement about the constants b and c, which is either always true (infinitely many solutions) or always false (no solution), never a single specific x.

How to use this calculator.

  1. Write your equation in the form ax + b = c. If it looks different — for example 3x = 2x + 7 — rearrange it first so every x-term is combined on the left and every constant is combined on the right.
  2. Enter the coefficient a, the constant b, and the right-hand side c into the three fields.
  3. Read the solution x at the top of the results. The calculator updates as you type.
  4. Use the check value to confirm the answer: a·x + b should equal c exactly. If it does not, double-check that you entered the equation in the intended form.
  5. Read the slope and y-intercept outputs if you also want the same coefficients as the line y = ax + b, useful for graphing or for connecting this problem to slope-intercept form.
  6. If you enter a = 0, read the error message carefully — it tells you whether your equation has infinitely many solutions or none, rather than silently failing.

The formula.

x = (c − b) ⁄ a

Solving ax + b = c for x is a two-step balancing process. First, subtract b from both sides to isolate the term containing x: ax = c − b. This is valid for any b because subtracting the same quantity from both sides of an equation never changes which values of x satisfy it — it is the modern, symbolic version of the "balancing" (al-muqabala) step in al-Khwarizmi's ninth-century algebra. Second, divide both sides by a to isolate x itself: x = (c − b) / a. This step requires a ≠ 0, because division by zero is undefined; that single requirement is the entire reason the a = 0 case needs special handling rather than just falling out of the formula naturally.

The check value a·x + b is the formula run in reverse: plug the solved x back into the left-hand side and confirm it reproduces c. Because x was derived algebraically from c, b, and a, this should always hold exactly (up to floating-point rounding, which the calculator avoids by doing every step in arbitrary-precision decimal arithmetic rather than native floating point).

The slope-intercept reading follows from noticing that ax + b, considered as a function of x rather than as one side of an equation, is already in the canonical form y = mx + b with m = a. The value c you supplied is simply the specific y-value (or, equivalently, the specific output) whose corresponding x you solved for. This is why linear-equation solving and line-graphing are taught as two views of the same underlying object rather than as unrelated topics.

When a = 0, the equation ax + b = c becomes 0·x + b = c, i.e., b = c — a statement with no x in it at all. There are exactly two possibilities. If b and c are numerically equal, the statement 0 = 0 is unconditionally true, so every real number x satisfies the original equation; there is no unique answer to report, so the calculator raises an error rather than picking an arbitrary x or returning a sentinel value. If b and c differ, the statement is unconditionally false, so no real number x satisfies the equation, and the calculator raises a different, equally explicit error. Both behaviors match how the equation is actually treated in algebra textbooks — as "infinitely many solutions" and "no solution" respectively — rather than as an arithmetic failure.

A worked example.

Example

Solve 2x + 5 = 15. Here a = 2, b = 5, and c = 15. Subtracting b from both sides gives 2x = 15 − 5 = 10. Dividing both sides by a = 2 gives x = 10 / 2 = 5. The check value confirms this: a·x + b = 2·5 + 5 = 10 + 5 = 15, which matches c exactly. Reading the same coefficients as a line, y = 2x + 5 has slope 2 and y-intercept 5 — the equation 2x + 5 = 15 was really asking "at what x does this line reach a height of 15?", and the answer is x = 5. Now suppose a had been 0 instead — say 0x + 5 = 15. Because 5 does not equal 15, this equation is false for every x, and the calculator reports that no solution exists rather than returning an undefined division. If the right-hand side had instead been 0x + 5 = 5, the statement 5 = 5 would be true for every x, and the calculator would report infinitely many solutions instead.

a2
b5
c15

Frequently asked questions.

What is a linear equation?
A linear equation in one variable is any equation that can be written as ax + b = c, where a, b, and c are known numbers and x is the unknown you are solving for. The defining feature is that x appears only to the first power — there is no x², no square root of x, and no x in a denominator. That single property is what makes the equation graph as a straight line (hence "linear") and what makes it solvable by the simple two-step process of subtracting and dividing, rather than requiring a more elaborate formula like the ones needed for quadratic or higher-degree equations.
How do you solve ax + b = c for x?
Isolate x in two steps. First subtract b from both sides: ax = c − b. This works no matter what b is, because subtracting the same amount from both sides of an equation never changes its solution. Second, divide both sides by a: x = (c − b) / a. This step requires a to be nonzero, since dividing by zero is undefined. Once you have x, you can check your work by substituting it back into the original left-hand side, a·x + b, and confirming the result equals c.
What happens if a is 0 and b equals c?
The equation collapses to 0 = 0 (since the x-term disappears entirely and the two sides happen to already be equal), and 0 = 0 is true regardless of what x is. That means every real number satisfies the original equation, so there are infinitely many solutions rather than one specific answer. Because a calculator cannot list every real number, this calculator raises an explicit error explaining that the equation has infinitely many solutions instead of silently returning zero, an arbitrary number, or a blank result.
What happens if a is 0 and b does not equal c?
The equation collapses to a false statement about two different constants — for example 0x + 5 = 15 reduces to 5 = 15, which is never true, no matter what x is. Since no real number can make a false statement true, the equation has no solution at all. This calculator raises an explicit error describing exactly this case, rather than returning Infinity, NaN, or an empty field, both of which are easy to mistake for a valid (if unusual) numeric answer.
Why does the calculator also show a slope and y-intercept?
Because the left-hand side of ax + b = c, read as a function of x instead of as one side of an equation to solve, is already in slope-intercept form y = ax + b with slope a and y-intercept b. Solving the equation for a specific c is the same operation as asking at what x-value the line y = ax + b reaches the height c. Showing both readings side by side connects equation-solving to line-graphing, which are often taught as separate topics even though they describe the same underlying algebra.
Can a, b, or c be negative or a decimal?
Yes, all three are ordinary real-number inputs. A negative coefficient a simply means a decreasing line; a negative constant b or target c is no different from a positive one algebraically. Decimal coefficients — 0.5, −2.75, and so on — are handled with full-precision decimal arithmetic rather than native floating-point math, so results stay accurate even after several arithmetic steps. The only inputs the calculator rejects are non-finite values and the specific a = 0 degenerate cases described above; a negative or fractional solution x is simply the correct answer, not an error.
How do I rearrange an equation that isn't already in ax + b = c form?
Combine like terms on each side first. If your equation is 3x + 2 = x + 10, subtract x from both sides to get 2x + 2 = 10, which is now in ax + b = c form with a = 2, b = 2, c = 10. If it is 5(x − 1) = 20, distribute first to get 5x − 5 = 20, giving a = 5, b = −5, c = 20. Any one-variable equation with x appearing only to the first power can be reduced to ax + b = c through combining like terms and distributing, after which this calculator handles the rest.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon