How to Find Slope Intercept Form From 2 Points (With Examples)

To find the slope intercept form from 2 points, first calculate the slope using m = (y₂ − y₁)/(x₂ − x₁), then substitute that slope and one of the points into y = mx + b and solve for b. For example, through (1, 2) and (3, 8): m = (8 − 2)/(3 − 1) = 3, and 2 = 3(1) + b gives b = −1, so the line is y = 3x − 1. That’s the whole process — two clean steps, and you have the equation written in the standard format.
What Is Slope Intercept Form
Slope intercept form is the equation y = mx + b, where m is the slope (how steeply the line rises or falls) and b is the y-intercept (the y-value where the line crosses the y-axis). This format is popular because you can read both key features of a line directly off the equation — the steepness and where it starts.
Here’s what each piece means:
- y and x are variables representing any point on the line.
- m is the slope, calculated as rise over run.
- b is the constant that positions the line vertically.
Every non-vertical straight line has exactly one slope intercept equation. Vertical lines (like x = 4) are the exception — they have undefined slope and can’t be written in this form. When you’re given two points, your job is to recover m and b so the equation describes the same line those points sit on.
The 2-Point Formula Method
Any two distinct points determine a unique line, so two points are always enough. The strategy is: find the slope first, then use a point to pin down the intercept.
Step 1: Find the slope
Label your points (x₁, y₁) and (x₂, y₂), then apply the slope formula:
m = (y₂ − y₁) / (x₂ − x₁)
Subtract carefully — the order matters in both the numerator and denominator as long as you’re consistent. Khan Academy covers this formula in detail if you want extra practice with the mechanics of finding slope from two points.
Step 2: Solve for the y-intercept
Plug your slope and either point into y = mx + b. You’ll have one unknown left (b), so solve the resulting one-step or two-step equation.
Step 3: Write the final equation
Substitute m and b back into y = mx + b. Use the other original point as a quick check: its coordinates should satisfy the finished equation. If they don’t, you have an arithmetic slip somewhere.
Worked Example
Find the equation of the line through (2, 5) and (6, 13).
Slope: m = (13 − 5)/(6 − 2) = 8/4 = 2.
Now use the point (2, 5): 5 = 2(2) + b → 5 = 4 + b → b = 1.
Answer: y = 2x + 1. Check with (6, 13): 2(6) + 1 = 13. ✓
Fractions are common when you work these problems, and they’re perfectly fine — don’t round them, since that changes the line. Purplemath has more worked examples of this exact routine if you want to drill additional problems.
| Points | Slope (m) | y-intercept (b) | Equation |
|---|---|---|---|
| (1, 2) and (3, 8) | 3 | −1 | y = 3x − 1 |
| (2, 5) and (6, 13) | 2 | 1 | y = 2x + 1 |
Common Mistakes to Avoid
Most wrong answers come from a handful of predictable slips. Watch for these:
- Sign errors in the slope. Subtracting a negative is the classic trap: (3 − (−1)) equals 4, not 2. Rewrite every subtraction as addition of the opposite before you compute.
- Mixing up x and y. The slope formula puts y-values on top and x-values on the bottom. Flipping them gives the reciprocal, which describes a different line entirely.
- Keeping points in inconsistent order. If you use (y₂ − y₁) on top, you must use (x₂ − x₁) on the bottom — same first point in both. Swapping only one creates a wrong sign.
- Forgetting to solve for b. Finding the slope is only half the job. An answer like y = 3x is incomplete unless the line genuinely passes through the origin.
- Skipping the check. Plug both original points into your final equation. If either fails, redo the slope calculation first, since that’s where errors usually start.
- Rounding fractions too early. Keep exact fractions throughout and only convert to decimals at the very end, if at all. Math is Fun’s overview of linear equations reinforces why exact forms matter.
With a bit of practice, this two-step routine becomes automatic, and you can move in either direction — from two points to an equation, or from an equation back to its graph.
Special Cases Worth Recognizing
When one point is the y-intercept
Given (0, 6) and (2, 10): the slope is (10 − 6)/(2 − 0) = 2, and because (0, 6) already sits on the y-axis, b = 6 immediately. The equation is y = 2x + 6. Spotting a zero x-coordinate saves a full solve-for-b step.
When the slope comes out as zero
Given (1, 4) and (5, 4): m = (4 − 4)/(5 − 1) = 0. A zero slope means a horizontal line, so the equation collapses to y = 4. There’s no x term at all, but y = 0x + 4 still fits the slope intercept structure with b = 4.
When two points share an x-value
Two points with the same x-coordinate, such as (3, 2) and (3, 9), describe a vertical line with undefined slope. That case cannot be expressed as y = mx + b and instead is written x = 3. Recognizing when the formula breaks down is part of using it well.
Key Takeaways
- To get slope intercept form from two points, use m = (y₂ − y₁)/(x₂ − x₁), then substitute m and one point into y = mx + b to solve for b.
- The final equation is always written as y = mx + b, with m the slope and b the y-intercept.
- Label your points consistently and rewrite subtractions of negatives as additions to avoid sign errors.
- Keep fractions exact rather than rounding, since rounding shifts the line.
- Always verify by plugging both original points into your finished equation.