Slope Formula in Geometry
The slope formula measures how steep a line is as the ratio of vertical change to horizontal change between two points. It is — often read as “rise over run.” A positive slope rises from left to right, a negative slope falls, a horizontal line has slope 0, and a vertical line has an undefined slope (division by zero).
Interactive slope explorer
Drag point A or B (or click a point and use the arrow keys). The green “rise” and amber “run” overlay the right triangle whose ratio is the slope.
Drag a point, or click it and use the arrow keys. Coordinates snap to the grid.
Step-by-step substitution
- m = (y₂−y₁)/(x₂−x₁) = (4−-2)/(3−-3) = 6/6 = 1
Rise over run
Between two points, the rise is the change in y, , and the run is the change in x, . Slope is their ratio:
Swapping the order of the points flips the sign of both the rise and the run, so the slope is unchanged — just be consistent about which point is first in the numerator and denominator.
Worked examples
- (0, 0) to (2, 4): m = (4−0)/(2−0) = 4/2 = 2 (rises steeply).
- (−3, −2) to (3, 4): m = (4−(−2))/(3−(−3)) = 6/6 = 1.
- (1, 5) to (6, 5): m = (5−5)/(6−1) = 0/5 = 0 (horizontal line).
Practice problems
- (0, 0) and (5, 10)
Answer
10/5 = 2
- (1, 2) and (4, 8)
Answer
6/3 = 2
- (−2, 3) and (2, −5)
Answer
−8/4 = −2
- (4, 1) and (4, 9)
Answer
8/0 = undefined (vertical)
- (−1, −1) and (5, 2)
Answer
3/6 = 0.5
Related
Classroom use: slope formula formulas
Learning objectives
After using this page, students will be able to:
- Compute slope as rise over run from two points.
- Interpret positive, negative, zero, and undefined slope geometrically.
- Use slopes to decide whether two lines are parallel or perpendicular.
Suggested classroom activity
Drag the two points into a vertical line and let the explorer report an undefined slope. Asking why division by zero happens here — and what that means about the line — turns a memorised exception into an understood one.
Standards alignment
| Code | Standard |
|---|---|
8.EE.B.6 | Use similar triangles to explain why slope is the same between any two points on a line. |
HSG.GPE.B.5 | Prove the slope criteria for parallel and perpendicular lines. |
Free to use and adapt in class under the terms on our license page — no account, no sign-up, no ads. Content last reviewed August 2026.
Frequently asked questions
What is the slope formula?
Slope is m = (y₂ − y₁)/(x₂ − x₁), the change in y divided by the change in x between two points — “rise over run.” For (0, 0) and (2, 4), the slope is 4/2 = 2.
What does slope tell you?
Slope measures a line’s steepness and direction. A positive slope rises left to right, a negative slope falls, a slope of 0 is horizontal, and a vertical line has an undefined slope.
Why is the slope of a vertical line undefined?
A vertical line has the same x-value at both points, so x₂ − x₁ = 0. The slope formula would divide by zero, which is undefined — the line has no finite “run.”