When you know two points on a line, the slope formula gives you its slope without drawing anything. If the points are (x₁, y₁) and (x₂, y₂):
m = (y₂ − y₁) ÷ (x₂ − x₁)
The top of the fraction is the change in y, which is the rise. The bottom is the change in x, which is the run. It is the same rise over run you would count on a graph.
Worked examples
Example 1: positive numbers
Find the slope through (2, 3) and (6, 11).
m = (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2
Example 2: negative numbers
Find the slope through (−3, 4) and (5, −2).
m = (−2 − 4) ÷ (5 − (−3)) = −6 ÷ 8 = −3/4
Notice that 5 − (−3) becomes 5 + 3 = 8. Subtracting a negative is the step people most often get wrong.
See Example 2 in Slope Finder →
Example 3: the order of the points doesn’t matter
Do Example 2 again, but start with (5, −2):
m = (4 − (−2)) ÷ (−3 − 5) = 6 ÷ (−8) = −3/4
You get the same answer, as long as you use the same point first on the top and the bottom.
Example 4: decimals
Find the slope through (0.5, 1) and (2, 4).
m = (4 − 1) ÷ (2 − 0.5) = 3 ÷ 1.5 = 2
Common mistakes
- Mixing the order. If you do y₂ − y₁ on top, you must do x₂ − x₁ on the bottom, not x₁ − x₂. Mixing them flips the sign of your answer.
- Putting x on top. Slope is the change in y over the change in x: rise over run, not run over rise.
- Losing a minus sign. Write negative numbers in brackets when you substitute, such as 5 − (−3). It makes the double negative easy to see.
- Not simplifying. 6/8 is correct but most teachers expect 3/4.
When the bottom is zero
If both points have the same x value, the bottom of the formula is 0. For (2, −1) and (2, 5), m = 6 ÷ 0, which has no value. The line is vertical and its slope is undefined. See Zero and undefined slope.
Check your answer
A quick sketch catches most errors. If the line goes up from left to right, the slope must be positive. If it goes down, the slope must be negative. You can also type your two points into the Slope Finder to see the line and the full working.