Slope-Intercept Form Calculator
This slope-intercept form calculator writes a line as y = mx + b from two points, or from a point and a slope — and works the intercept out from every point you gave, so the two have to agree before anything is shown.
Give it (1, 3) and (4, 9) and you get y = 2x + 1, with the line drawn and the crossing marked.
How to Find the Equation of a Line in Slope-Intercept Form
1. Find the slope. From two points: m = (y₂ − y₁) ÷ (x₂ − x₁). If you were handed the slope, skip this.
2. Find b. Put a point back into y = mx + b and see what is left over.
3. Write it. Slope in front of the x, intercept behind it.
With (1, 3) and (4, 9):
m = (9 − 3) ÷ (4 − 1) = 2
3 = 2 × 1 + b, so b = 3 − 2 = 1
y = 2x + 1
The second step is where marks go. It is y minus mx, not the other way round — and getting that backwards flips the sign of b while leaving the slope looking perfectly right, which makes it hard to spot.
What m and b Actually Tell You
This form is popular because it hands you the two facts you most often want, with no rearranging at all.
m is the steepness. Positive climbs from left to right, negative falls, and 0 is flat.
b is the height at which the line crosses the vertical axis — the y value when x is 0.
That makes graphing quick: mark (0, b), then step across and up by the slope. Keeping m as a fraction helps here, because 1/2 tells you to go 2 across and 1 up while 0.5 tells you nothing you can draw.
The other crossing follows from the same two numbers. Setting y to 0 gives x = −b ÷ m, so y = 2x + 1 meets the horizontal axis at −1/2, and y = −2x + 4 meets it at 2. A flat line is the exception: it either runs parallel to that axis and never arrives, or sits on it the whole way. This calculator gives both crossings, because between them they pin the line down without any drawing at all.
When b Costs You Nothing
Here is a shortcut almost nobody mentions. Since b is the y value at x = 0, a point that already has an x of 0 is the intercept.
Take (0, 3) and (2, 7). The slope is 2 as usual — but b = 3 outright. Nothing to substitute, nothing to rearrange.
Most people put the point into y = mx + b anyway and arrive at the same answer the long way, because the m × 0 term simply disappears. It is worth a glance at your coordinates before you start: if either one has a zero for x, half the work is already done.
The Check Almost Nobody Uses
When you have two points, work b out from the second one as well.
From (1, 3): b = 3 − (2 × 1) = 1
From (4, 9): b = 9 − (2 × 4) = 1
Both points are on the same line, so both must give the same intercept. It costs one subtraction, and unlike re-reading your own working it uses a number you have not looked at yet — which is exactly why it catches slips that checking twice does not. This calculator runs it on every answer before showing anything.
The One Line That Cannot Be Written This Way
A vertical line has no slope-intercept form at all. Its slope is undefined, so there is no m to put in — and more than that, it has no single y for a given x, which is the one thing an equation beginning y = has to provide. The points (4, 1) and (4, 9) give x = 4 instead.
A horizontal line is fine. Its slope is 0, the x term disappears, and (4, 7) with slope 0 gives simply y = 7 — every point on it shares that same y, which is the intercept.
How to Use This Slope-Intercept Calculator
A point is always needed. After that give either the slope or a second point, whichever the question handed you.
| x₁, y₁ | A point on the line. Always needed |
| m | The slope, if you were given it |
| x₂, y₂ | Or a second point, and the slope is worked out |
| ± ⁄ . | Sign, fraction bar, decimal point |
| ⌫ / AC | Delete one character, or clear everything |
| = | Works it out |
The route you are not using fades as soon as you start the other. Fractions like 1/2 and decimals both work, and the answer stays exact either way: (5, 6) with slope 1/2 gives y = 1/2x + 7/2, not a rounded decimal.
Open the working and you get the line drawn from your own coordinates with the intercept marked, every sum written out, b from both points, and where the line crosses each axis. If the question asks for the same line in point-slope form instead, that is given for reference too.
Slope-Intercept Form FAQ
What is slope-intercept form?
How do you find the equation of a line from two points?
How do you find b?
Is there a shortcut for finding b?
How can I check my answer?
Can a vertical line be written as y = mx + b?
Slope first, then the intercept — and then the second point, which is the cheapest check in the subject.