Part 5 of 10 · LinesSee the whole course
How to find the slope from two points
To find the slope from two points, subtract the y-values, subtract the x-values in the same order, and divide: slope = (y₂ − y₁) ÷ (x₂ − x₁). It is “rise over run”: how far the line goes up for every step it goes across.
The slope formula, one step at a time
Take any two points on a line and call them (x₁, y₁) and (x₂, y₂). Then:
- Rise. Subtract the heights: y₂ − y₁. This is how far you go up (or down).
- Run. Subtract the x-values in the same order: x₂ − x₁. This is how far you go across.
- Divide. Slope = rise ÷ run.
Try it. Point A stays at (1, 2). Slide point B around and watch the rise, the run and the slope change.
- rise = y₂ − y₁ = 8 − 2 = 6
- run = x₂ − x₁ = 3 − 1 = 2
- slope = rise ÷ run = 6 ÷ 2 = 3
Dividing the change in height by the change across between any two points gives you the slope.
Example 1: a line that goes up
Find the slope of the line through (1, 2) and (3, 8).
Rise: 8 − 2 = 6
Run: 3 − 1 = 2
Slope: 6 ÷ 2 = 3
For every step across, the line goes up 3. That is the picture above, in its starting position.
Example 2: a line that goes down
Find the slope of the line through (−1, 5) and (3, 1).
Rise: 1 − 5 = −4
Run: 3 − (−1) = 4
Slope: −4 ÷ 4 = −1
A negative slope means the line goes downhill as you move to the right. Keep the minus sign, and keep the brackets: subtracting a negative number, as in 3 − (−1), is where most slips happen.
Does the order of the points matter?
No, as long as you use the same order on the top and the bottom. Swap the points from example 2:
Rise: 5 − 1 = 4
Run: −1 − 3 = −4
Slope: 4 ÷ (−4) = −1
The answer is the same. The mistake is mixing the orders: if the top is 1 − 5 = −4 but the bottom is −1 − 3 = −4, you get −4 ÷ −4 = +1. That has the wrong sign, because this line goes down.
Flat lines and straight-up lines
- A horizontal line has a rise of 0, so its slope is 0 ÷ run = 0.
- A vertical line has a run of 0, and you cannot divide by 0, so its slope is undefined. It is not 0.
For example, the points (3, 2) and (3, 7) have the same x-value: the run is 3 − 3 = 0. They sit on a straight-up line, so there is no slope to find.
Watch it explained in under a minute
The five mistakes to avoid
- Dividing the run by the rise. “Across over up” is backwards: the rise goes on top.
- Subtracting in a different order on the top and the bottom.
- Dropping a minus sign, especially when you subtract a negative number.
- Saying a vertical line has slope 0. A horizontal line has slope 0. A vertical line has no slope at all.
- Calling any rising graph a line. Slope only means something steady: the same rise for every run, all along the line.
Try it yourself
Find the slope through each pair of points. Tap a question to see the answer.
1. (2, 3) and (6, 11)
Rise: 11 − 3 = 8. Run: 6 − 2 = 4. Slope: 8 ÷ 4 = 2.
2. (0, 5) and (4, 1)
Rise: 1 − 5 = −4. Run: 4 − 0 = 4. Slope: −4 ÷ 4 = −1.
3. (3, 2) and (3, 7)
Run: 3 − 3 = 0, so the line is vertical and the slope is undefined.
Where slope fits in
Slope is one of the two numbers that describe any straight line. In y = mx + b, the number m is the slope and b is where the line starts on the y-axis (the Pip app writes a instead of m, which is the same thing). If slope is new to you, start with what slope is. Next in this course: slope-intercept form, explained. Our guide Learn algebra visually shows both numbers with a live graph you can drag.