Linear Equation Calculator
Solve ax + b = c (or ax + b = cx + d) for x, step by step
๐ Enter your equation
Last updated June 2026
Method: Each equation is reduced to the standard form Ax = B by collecting the x-terms and the constants, then solved as x = B / A. Exact answers are shown as reduced fractions, and the solution is verified by back-substitution.
Included: The forms ax + b = c and ax + b = cx + d, decimals and negative coefficients, step-by-step working, an exact-fraction result, and the special no-solution and infinite-solution cases.
Not included: Quadratic or higher-degree equations, systems of equations, inequalities, and equations with x in a denominator or under a root. Results are educational, not a substitute for showing your own working.
Linear equation calculator: everything you need to know
A linear equation is one where the unknown appears only to the first power, so its graph is a straight line. Take 2x + 3 = 11: subtract 3 from both sides to get 2x = 8, then divide by 2 to find x = 4. That two-step routine - undo the addition, then undo the multiplication - solves every equation of the form ax + b = c. This linear equation calculator walks through those steps for you, shows the exact fraction when the answer is not a whole number, and handles the trickier cases where the equation has no solution or infinitely many.
The formula for solving ax + b = c
To solve for x in the basic form, isolate x with two inverse operations:
ax + b = c → x = (c − b) ÷ a where a is the coefficient of x, b is the constant added to it, and c is the value on the right. You first subtract b from both sides, then divide both sides by a. The only thing that can go wrong is a = 0, because you cannot divide by zero - and that is exactly the case the calculator flags as no-solution or infinite-solution.
The general form: variables on both sides
Many equations have x on both sides, like ax + b = cx + d. The trick is to collect all the x-terms on one side and the constants on the other:
ax + b = cx + d → (a − c)x = d − b → x = (d − b) ÷ (a − c) For example, 2x + 3 = x + 8 becomes x = 5: move the x to get x + 3 = 8, then subtract 3. Use the ax + b = cx + d tab in the calculator for this form. Internally both forms reduce to Ax = B, where A is the combined x-coefficient and B is the combined constant.
How to use this linear equation calculator
You only need to read the coefficients off your equation. Work through it like this:
- Pick the form: choose ax + b = c if x is only on the left, or ax + b = cx + d if x appears on both sides.
- Enter the coefficients: type a, b and c (and d in the general form). Use negative numbers and decimals freely; a missing term just means that coefficient is 0.
- Check the preview: the blue box rebuilds your equation so you can confirm you entered it correctly before solving.
- Solve for x: press the button. The big number at the top is your answer, with an exact fraction shown when one exists.
- Read the steps: the step table shows the subtraction, the division, and the simplified result, and the check card substitutes x back in to prove both sides match.
If your equation is messier - terms scattered on both sides, parentheses, like terms not combined - simplify it onto one of the two supported forms first, then enter the coefficients.
Who this calculator is for
Solving for x is one of the first skills in algebra, so this tool fits a wide range of users:
- Students checking homework on one- and two-step equations and equations with variables on both sides.
- Parents and tutors who want to confirm an answer and see clean step-by-step working to explain.
- Test-prep candidates (SAT, ACT, GED, placement tests) drilling fast, reliable solving.
- Anyone doing everyday math - converting a formula, splitting a bill, or back-solving a simple rate problem that boils down to a single linear equation.
Worked example: a two-step equation
Solve 5x − 4 = 16. Here a = 5, b = −4 and c = 16. Add 4 to both sides to get 5x = 20, then divide by 5 to find x = 4. Check it: 5 × 4 − 4 = 20 − 4 = 16, which matches the right side. Whenever the numbers divide evenly you get a whole number; when they do not, the calculator keeps the exact fraction so you do not lose precision.
Worked example: a fractional answer
Solve 3x + 1 = 8. Subtract 1 to get 3x = 7, then divide by 3: x = 7/3 ≈ 2.333333. The exact answer is the fraction 7/3, and the decimal repeats, so for graded work you would write 7/3 rather than a rounded decimal. The calculator shows both - the reduced fraction for accuracy and the decimal for a quick sense of size.
Three outcomes: one, none, or infinitely many
Every linear equation lands in one of three buckets, and which one depends on the combined x-coefficient A after you collect terms:
- One solution (A ≠ 0): the usual case. Dividing B by A gives a single value, like x = 4. Graphically, two lines with different slopes cross at exactly one point.
- No solution (A = 0, B ≠ 0): the x-terms cancel but you are left with a false statement such as 5 = 0. The equation is inconsistent - parallel lines that never meet, like x + 2 = x − 4.
- Infinitely many (A = 0, B = 0): everything cancels to 0 = 0, true for any x. The equation is an identity, such as 3x + 5 = 3x + 5 - the same line drawn twice.
Key terms explained
- Coefficient: the number multiplying x. In 7x the coefficient is 7; in −x it is −1.
- Constant: a plain number with no variable, like the +3 in 2x + 3.
- Like terms: terms with the same variable part, such as 2x and 5x, which can be combined into 7x.
- Isolating the variable: using inverse operations to get x alone on one side of the equals sign.
- Identity: an equation true for every value of x, which produces infinitely many solutions.
- Inconsistent equation: one that simplifies to a false statement and therefore has no solution.
Why "do the same thing to both sides" works
An equation is a balance: the two sides are equal, so any operation you apply to one side you must apply to the other to keep it balanced. Subtracting the same number from both sides, or dividing both sides by the same non-zero number, preserves equality while gradually peeling away everything around x. That is the entire logic behind the steps in this calculator - each row keeps both sides equal until x stands alone.
Tips for solving by hand
- Simplify first: expand any parentheses and combine like terms before you start isolating x.
- Move x to one side: with variables on both sides, subtract the smaller x-term so the remaining coefficient stays positive when you can.
- Undo in reverse order: deal with addition and subtraction before multiplication and division.
- Keep fractions exact: a fraction like 7/3 is more precise than a rounded 2.33; convert to a decimal only at the end if asked.
- Always check: plug your answer back into the original equation - it is the fastest way to catch a sign error.
Worked example: variables on both sides, step by step
The general form is where most algebra students lose marks, so it is worth walking through slowly. Solve 4x + 7 = 2x − 5. Here a = 4, b = 7, c = 2 and d = −5. The goal is to gather every x-term on one side and every constant on the other:
- Subtract 2x from both sides to remove x from the right: 4x − 2x + 7 = −5, which simplifies to 2x + 7 = −5.
- Subtract 7 from both sides to isolate the x-term: 2x = −12.
- Divide both sides by 2: x = −6.
- Check: left side 4 × (−6) + 7 = −24 + 7 = −17; right side 2 × (−6) − 5 = −12 − 5 = −17. Both sides equal −17, so x = −6 is correct.
Notice that the combined x-coefficient here is A = a − c = 4 − 2 = 2 and the combined constant is B = d − b = −5 − 7 = −12, giving x = B ÷ A = −12 ÷ 2 = −6 directly. The step-by-step view and the single-formula view always agree, which is exactly what the calculator demonstrates.
A real-world scenario: when does the cost break even?
Linear equations are not just textbook exercises - they answer "at what point are two options equal?" Suppose Gym A charges a $40 sign-up fee plus $25 a month, while Gym B charges no sign-up fee but $35 a month. After how many months m do they cost the same? Set the two total costs equal:
40 + 25m = 35m Subtract 25m from both sides to get 40 = 10m, then divide by 10 to find m = 4 months. Before month 4, Gym A is cheaper because of its lower monthly rate; after month 4, Gym B pulls ahead. The same single-variable setup solves break-even comparisons for phone plans, streaming bundles, rental versus buy decisions, and simple distance-rate-time problems. If your comparison involves percentages rather than flat fees, the Percentage Calculator pairs well with this one.
Where linear equations show up in everyday math
Once you recognise the pattern, single-variable linear equations turn up everywhere a quantity changes at a steady rate. A few common settings:
- Unit conversion: converting Celsius to Fahrenheit, F = 1.8C + 32, is a linear equation - set F to a target and solve for C.
- Pricing and discounts: "what was the original price if 15% off gives $68?" reduces to 0.85p = 68, a one-step linear equation.
- Distance, rate and time: with a constant speed, d = rt is linear in whichever quantity you solve for.
- Splitting costs: dividing a bill with a fixed fee plus a per-person charge is a linear equation in the number of people.
- Simple budgeting: "how many weeks of saving $50 reach a $600 goal?" is 50w = 600, so w = 12 weeks.
In every case the structure is the same: an unknown multiplied by a rate, plus or minus a constant, equal to a target. Rearrange it into ax + b = c, read off the coefficients, and the answer falls out.
Linear equations and straight-line graphs
The word "linear" comes from the line you get when you graph each side. Writing y = ax + b draws a straight line whose slope is a and whose y-intercept is b. Solving ax + b = cx + d is the same as asking where the lines y = ax + b and y = cx + d intersect - the x-coordinate of the crossing point is your solution. Two lines with different slopes cross exactly once (one solution); two parallel lines with the same slope never cross (no solution); and two identical lines overlap entirely (infinitely many solutions). If you want to build the line itself from two points, the Slope Calculator finds the slope and equation, and a single linear equation then tells you where that line hits any target value.
Limitations and assumptions
This is a tool for genuinely linear equations in a single variable. Keep these boundaries in mind:
- It does not solve quadratic or higher-degree equations - for xยฒ use the Quadratic Formula Calculator.
- It handles one equation, not a system of two or more equations in several unknowns.
- It solves equations, not inequalities, and does not handle x in a denominator or under a square root.
- Your equation must already be in, or simplified to, the form ax + b = c or ax + b = cx + d; expand parentheses and combine like terms first.
- Decimals are rounded for display, but exact rational answers are also shown as fractions to avoid rounding error.
How it compares to related calculators
This page answers "what value of x solves this linear equation?" If your question is different, a sister tool fits better:
- For equations with an xยฒ term, use the Quadratic Formula Calculator.
- To find the slope and equation of a line from two points, use the Slope Calculator.
- For percentage problems that reduce to a single equation, use the Percentage Calculator.
- For powers and roots, see the Exponent Calculator or the full Scientific Calculator.
- To average a list of numbers, use the Average Calculator.
โ ๏ธ Common mistakes & edge cases
Forgetting to do the same thing to both sides
If you subtract b from the left, you must subtract it from the right too. Changing only one side breaks the balance and gives a wrong value for x. Every step in this calculator is applied to both sides.
Sign errors when moving terms
Moving +3 across the equals sign makes it −3, not +3. Dropping or flipping a sign is the most common slip in two-step equations - always re-check the sign of each term you move.
Treating no-solution as x = 0
When the x-terms cancel and you are left with something like 5 = 0, the answer is "no solution," not x = 0. Likewise 0 = 0 means infinitely many solutions, not zero. The calculator labels these cases explicitly.
Rounding a fraction too early
Answers like 7/3 are exact; writing 2.33 loses precision and can fail a grader. Keep the exact fraction shown in the result and convert to a decimal only at the very end, and only if asked.
❓ Frequently asked questions
What is a linear equation?
A linear equation is an equation in which the variable appears only to the first power - no xยฒ, no square roots, no x in a denominator. The simplest form is ax + b = c, and a slightly more general form is ax + b = cx + d, where a, b, c and d are numbers. Its graph is always a straight line, which is where the name 'linear' comes from. Because the highest power of x is 1, a linear equation has exactly one solution unless the x-terms cancel out.
How do I solve a linear equation for x?
Isolate x by undoing the operations around it. For ax + b = c: subtract b from both sides to get ax = c - b, then divide both sides by a to get x = (c - b) / a. For ax + b = cx + d, first move the x-terms to one side and the constants to the other, giving (a - c)x = d - b, then divide by (a - c). This calculator does both and shows each step.
What is the formula this calculator uses?
For the form ax + b = c the solution is x = (c - b) / a. For the general form ax + b = cx + d it is x = (d - b) / (a - c). In both cases you are combining the x-terms into a single coefficient A and the constants into a single number B, reducing the equation to Ax = B and then dividing: x = B / A.
What does it mean when there is no solution?
If, after collecting terms, the x-coefficient becomes zero but the constants do not match (for example you end up with 5 = 0), there is no value of x that can balance the equation. This is called an inconsistent equation - the two sides describe parallel lines that never meet, so there is no solution.
When does a linear equation have infinitely many solutions?
When both the x-coefficient and the constant cancel to zero - you end up with 0 = 0, which is always true. This happens when the two sides are really the same expression, such as 2x + 4 = 2x + 4. The equation is an identity, true for every real number, so it has infinitely many solutions.
Can a be zero in ax + b = c?
If a = 0 the x-term disappears and the equation is no longer linear in x - it becomes b = c, a statement that is either always true (infinitely many solutions, if b equals c) or never true (no solution, if they differ). The calculator detects this and reports the no-solution or infinite-solution result instead of dividing by zero.
Does the calculator give exact fractions?
Yes. When the coefficients are whole numbers and the answer is a rational number, the calculator shows the exact reduced fraction (for example x = 7/3) alongside the rounded decimal. That keeps your answer precise for homework, where a fraction is often preferred over a long decimal.
How do I check that my solution is correct?
Substitute the value you found back into the original equation and simplify both sides. If the left side equals the right side, your solution is correct. This calculator does the substitution for you in the 'Check the answer' card, showing both sides land on the same number.
What is the difference between an equation and an expression?
An expression, like 3x + 2, is just a phrase with no equals sign - you can simplify or evaluate it but not 'solve' it. An equation, like 3x + 2 = 11, sets two expressions equal and asks which value of x makes them balance. You solve equations; you simplify expressions.
How do I rearrange an equation into ax + b = c form first?
Move every x-term to one side and every constant to the other using addition and subtraction, then combine like terms. For example, 4x + 5 - x = 2x + 11 becomes 3x + 5 = 2x + 11, then x + 5 = 11, then x = 6. Once everything is in ax + b = c or ax + b = cx + d form you can read off the coefficients and enter them here.
Why does the graph of a linear equation matter?
Each side of ax + b = cx + d can be drawn as a straight line. The solution is the x-value where the two lines cross. One crossing point means one solution; parallel lines (same slope, different intercept) never cross, giving no solution; and identical lines overlap everywhere, giving infinitely many solutions. The algebra and the geometry tell the same story.
Can I use this for two-step and multi-step equations?
Yes. A two-step equation such as 2x + 3 = 11 fits the ax + b = c form directly. For multi-step equations with variables on both sides, combine like terms until the equation looks like ax + b = cx + d, then use the general mode. The calculator handles negative numbers and decimals, so most school-level linear equations work once they are simplified into one of these two forms.
Can a linear equation have a negative or fractional answer?
Absolutely. There is nothing special about negative or fractional solutions - they are just as valid as whole numbers. For example, 2x + 7 = 1 gives x = -3, and 3x = 7 gives x = 7/3. The calculator accepts negative and decimal coefficients on input and returns negative answers and exact reduced fractions on output, so you never have to round a clean fraction into a messy decimal.
How do I solve an equation with parentheses, like 3(x + 2) = 15?
First remove the parentheses by distributing, then simplify into ax + b = c form. For 3(x + 2) = 15, multiply out to get 3x + 6 = 15, subtract 6 to get 3x = 9, and divide by 3 to find x = 3. The calculator works on the simplified coefficients, so expand any brackets and combine like terms by hand first, then enter a, b and c.
What is the difference between a linear equation and a quadratic equation?
A linear equation has x only to the first power and graphs as a straight line, so it has at most one solution. A quadratic equation contains an x-squared term, graphs as a parabola, and can have zero, one, or two solutions. If your equation has an x-squared (or higher) term it is not linear - use a quadratic formula calculator instead, because the method of dividing Ax = B does not apply.
๐ก Good to know
A linear equation has exactly one solution - unless the x-terms cancel
Because the highest power of x is 1, a true linear equation crosses zero at a single point. The only exceptions are when the x-terms cancel: you then get no solution (a false statement) or infinitely many (an identity).
Keep your answer as a fraction
If the division does not come out even, the exact answer is a fraction like 7/3. That is more precise than a rounded decimal and is usually the preferred form in algebra. The calculator shows the reduced fraction next to the decimal.
Always substitute to check
Plugging your value of x back into the original equation is the simplest way to confirm it. If both sides come out equal, your answer is right - which is exactly what the "Check the answer" card does for you.
Related Calculators
Percentage Calculator
Solve any percentage problem - what is X% of Y and more
Quadratic Formula Calculator
Solve quadratic equations with the quadratic formula
Scientific Calculator
A full scientific calculator with trig, logs and more
Average Calculator
Calculate the mean, median and mode of numbers
Slope Calculator
Find the slope and equation of a line from two points
Exponent Calculator
Raise numbers to any power