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
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.
- 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.
- Enter the coefficient a, the constant b, and the right-hand side c into the three fields.
- Read the solution x at the top of the results. The calculator updates as you type.
- 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.
- 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.
- 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.
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.
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.
Frequently asked questions.
What is a linear equation?
How do you solve ax + b = c for x?
What happens if a is 0 and b equals c?
What happens if a is 0 and b does not equal c?
Why does the calculator also show a slope and y-intercept?
Can a, b, or c be negative or a decimal?
How do I rearrange an equation that isn't already in ax + b = c form?
References& sources.
- [1]Dawkins, Paul. "1.2 Linear Equations." Paul's Online Math Notes, Lamar University Department of Mathematics.
- [2]Dawkins, Paul. "3.2 Lines." Paul's Online Math Notes, Lamar University Department of Mathematics — slope-intercept form y = mx + b.
- [3]al-Khwarizmi, Muhammad ibn Musa. Al-Kitab al-mukhtasar fi hisab al-jabr wa'l-muqabala ("The Compendious Book on Calculation by Completion and Balancing"), Baghdad, c. 820 CE — the founding text of algebraic equation-solving by restoration (al-jabr) and balancing (al-muqabala). (Rosen translation, 1831.)
- [4]Weisstein, Eric W. "Linear Equation." MathWorld — Wolfram Research.
- [5]Sullivan, Michael. Algebra & Trigonometry, 10th edition. Pearson, 2018 — standard reference treatment of linear equations in one variable and their connection to linear functions.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled