Method · Graphing
How to Find Slope-Intercept Form From Two Points
y = mx + b is the form that tells you what the line looks like. Two numbers, and each one is visible on the graph.
What m and b mean
Slope-intercept form is y = mx + b. Knowing how to find slope-intercept form is worth the effort because both numbers in it are things you can point at on the graph.
- m is the slope: how far the line rises for every one step to the right.
- b is the y-intercept: the value of y when x is zero, so the point where the line crosses the vertical axis.
Between them they pin the line down completely. Any other form of a linear equation carries the same information in a less readable arrangement.
Finding it from two points
Two distinct points determine exactly one line. Find the slope from the difference between them, then substitute either point back to recover the intercept.
- m = (0 − 2) ÷ (4 − 0)slope is rise over run
- m = −2⁄4 = −0.5evaluate and simplify
- 2 = −0.5(0) + bsubstitute the point (0, 2)
- y = −0.5x + 2so b = 2
The order of subtraction has to be consistent. If y₂ − y₁ is on top, then x₂ − x₁ must be on the bottom. Mixing the order flips the sign and tilts the line the wrong way.
Converting from standard form
Standard form, Ax + By = C, hides both numbers. Solving for y exposes them.
- 2x + 4y = 8standard form
- 4y = −2x + 8subtract 2x from both sides
- y = −0.5x + 2divide every term by 4
Dividing every term is the step to be careful with. The 8 has to be divided as well as the x term, and forgetting it moves the line without changing its direction.
Reading the slope
The sign and size of m describe the line at a glance.
| Slope | The line |
|---|---|
| positive | rises from left to right |
| negative | falls from left to right |
| zero | horizontal |
| undefined | vertical — no slope-intercept form exists |
| large in size | steep |
Two lines are parallel when their slopes are equal, and perpendicular when the slopes multiply to −1. A line of slope 2 is perpendicular to one of slope −1/2.
Vertical lines are the exception
If both points share the same x value, the run is zero and the slope calculation divides by zero. The line is vertical, its slope is undefined, and it cannot be written as y = mx + b at all.
The correct answer in that case is x = a, where a is the shared x value. This is a genuine special case rather than an error, and a calculator that returns infinity here is giving you a wrong answer rather than a useful one.
Finding the x-intercept too
The y-intercept is already visible in the form. For the x-intercept — where the line crosses the horizontal axis — set y to zero and solve for x.
For y = −0.5x + 2 that gives 0 = −0.5x + 2, so x = 4. The line crosses the axes at (0, 2) and (4, 0), which are the two points it was built from.
Questions about how to find slope intercept form
How do you find the slope from two points?
Subtract the y values and divide by the difference in the x values: (y₂ − y₁)/(x₂ − x₁). Keep the subtraction in the same order on top and bottom.
What is the y-intercept in y = mx + b?
It is b — the value of y when x is zero, and therefore the point (0, b) where the line crosses the vertical axis.
How do I convert standard form to slope-intercept form?
Solve for y. Move the x term to the other side, then divide every term by the coefficient of y. The number multiplying x is then the slope.
What is the slope of a vertical line?
Undefined. The run between any two points on it is zero, and division by zero has no value. Such a line is written x = a instead.