A linear equation is the foundation of algebra: it describes a straight relationship between two quantities, usually written as y = mx + b. This calculator solves that equation for you. Type in the slope (m), the y-intercept (b), and the target y-value you want to reach, and the page instantly tells you what x has to be, where the line crosses the x-axis, and the full equation of the line in both slope-intercept and standard form.
Whether you are a student checking homework, a tutor walking a class through slope, or an analyst modeling cost-versus-volume relationships, this tool removes the arithmetic so you can focus on what the line means.
How to Use
- Enter the Slope (m). This is the number multiplied by x — the 2 in y = 2x + 3. A positive slope rises from left to right; a negative slope falls. Slope cannot be 0 here, because a flat horizontal line has either no solution or infinitely many solutions depending on your target.
- Enter the Y-Intercept (b). This is the value of y when x = 0 — the +3 in y = 2x + 3. It is where the line crosses the vertical axis on a graph.
- Enter the Target y (c). This is the y-value you want the line to reach. In the classic problem "2x + 3 = 7", the target y is 7.
- Read the result card. The highlighted Value of x is your answer. Below it you will see the slope, the y-intercept, the x-intercept (where the line crosses the horizontal axis), and the equation written in both slope-intercept and standard form.
- Verify by substituting. The page shows the full equation, so you can plug x back into m·x + b and confirm it equals c.
The Slope-Intercept Equation
Every straight line can be written in the form y = m·x + b:
- y is the dependent variable — the output you are measuring (cost, distance, temperature, anything).
- x is the independent variable — the input you control (time, units, hours, distance).
- m is the slope, or rate of change: how much y moves for each one-unit move in x.
- b is the y-intercept: the value of y when x = 0, often a fixed starting cost or baseline.
To solve m·x + b = c for x, follow three steps: subtract b from both sides, then divide by m. Algebraically:
x = (c − b) / m
The x-intercept — the point where the line crosses the x-axis (where y = 0) — is found by setting y = 0:
x-intercept = −b / m
A quick sanity check on the classic example y = 2x + 3 with a target of y = 7 gives x = (7 − 3) / 2 = 2. Plugging 2 back in: 2·2 + 3 = 7. Correct.
Examples
Example 1 — The textbook case. A student is asked to solve 2x + 3 = 7. Enter slope = 2, y-intercept = 3, target y = 7. The calculator returns x = 2, the x-intercept at −1.5, and the equation y = 2x + 3 (or 2x − y = −1 in standard form). This is the most common problem on middle-school algebra worksheets.
Example 2 — A plumber's bill. A plumber charges a $75 service fee plus $95 per hour. The cost equation is y = 95x + 75, where x is hours and y is total bill in dollars. If your budget is $450, what is the longest job you can afford? Enter slope = 95, y-intercept = 75, target y = 450. The calculator returns x ≈ 3.95 hours — you can afford just under four hours of work. The x-intercept (−75/95 ≈ −0.79) is negative because no hour of work still costs the $75 call-out fee.
Example 3 — A phone plan. Plan A costs $30 per month plus $0.10 per text. That is y = 0.10x + 30. If you sent 1,200 texts last month, what was your bill? The calculator can also run backwards: enter slope = 0.10, y-intercept = 30, target y = 150 (the bill you want to investigate). It returns x = 1,200 texts as the break-even point. Sending fewer texts would have dropped the bill below $150.
Example 4 — A negative slope. A tank holds 500 gallons and drains at 40 gallons per minute. The equation is y = −40x + 500. How long until the tank reaches 100 gallons? Enter slope = −40, y-intercept = 500, target y = 100. The calculator returns x = 10 minutes. The slope is negative because the volume is decreasing over time.
Example 5 — Large commercial values. A factory leases a machine for $1,000,000 up front and runs a part that costs $1 per unit. The cost equation is y = 1x + 1,000,000. At what unit volume does total cost reach $2,000,000? Enter slope = 1, y-intercept = 1,000,000, target y = 2,000,000. The calculator returns x = 1,000,000 units — one million parts is the break-even volume between the lease cost and the target budget.
FAQ
What is a linear equation?
A linear equation is an algebraic statement that describes a straight line when graphed. In two variables x and y, the most common form is y = m·x + b, where m is the slope and b is the y-intercept. Solving it means finding the x-value that produces a given y-value.
How do I solve y = mx + b for x?
Isolate x by subtracting b from both sides of the equation and then dividing by m. The result is x = (c − b) / m, where c is the target y-value. This calculator performs that arithmetic for any non-zero slope.
What is the y-intercept?
The y-intercept is the value of y when x = 0. On a graph, it is the point where the line crosses the vertical axis. In real-world problems it often represents a fixed starting cost or baseline value — for example, a flat service fee that is charged even before any work begins.
What is the x-intercept?
The x-intercept is the value of x when y = 0. It is found by solving 0 = m·x + b, which gives x = −b / m. On a graph, it is where the line crosses the horizontal axis. A negative x-intercept means the baseline value (b) is positive; a positive x-intercept means the line crosses the axis in positive territory.
Why is a slope of zero not allowed?
If m = 0, the equation becomes y = b, a horizontal line. If your target y equals b, every x works (infinitely many solutions). If your target y does not equal b, no x works (no solution). Because there is no single answer, this calculator rejects m = 0 and asks you to pick a non-zero slope.
What is standard form?
Standard form of a line writes the equation as Ax + By = C, where A, B, and C are integers. Starting from y = m·x + b, rearrange to m·x − y = −b. For example, y = 2x + 3 becomes 2x − y = −3. Standard form is useful in word problems where both quantities are listed on the left side.
How do I know my answer is correct?
Substitute the solved x back into m·x + b. The result should equal your target y. The calculator displays the full equation and the solved x so you can perform this check in one step. For y = 2x + 3 with x = 2, you get 2·2 + 3 = 7, which matches.
Disclaimer
This linear equation calculator is provided for informational purposes only and is intended for educational use. It applies the standard algebraic rearrangement x = (c − b) / m and x-intercept = −b / m to the inputs you enter. The tool is not a substitute for a teacher, tutor, or textbook, and results should be verified by hand when used for graded work, engineering design, or financial decisions. Always confirm your final solution independently before relying on it.