Formula
Slope formula
Also written: gradient formula · rise over run · slope between two points
The slope formula gives the steepness of the line through two points: the change in y divided by the change in x.
What each part means
- the slope
- the first point
- the second point
When to use it
You know two points on a line and need its steepness, or a rate of change from two readings of the same quantity.
Reading it
The -values go on top and the -values on the bottom — rise over run, in that order.
Either point can be first, as long as you are consistent. Both differences must start from the same point, or the sign comes out backwards.
Both give the same slope. Mixing them does not.
Why the formula does not depend on which two points you pick
Take any two points on the same straight line. The right triangles formed by their rise and run are similar, because the line makes the same angle with the horizontal everywhere along its length.
Similar triangles have proportional sides, so the ratio of rise to run is the same for every pair of points. That constant ratio is what the number names — see rate of change for the algebra.
Worked examples
Find the slope through and .
Find the slope through and .
Negative, so the line falls left to right.
Two special cases
| Situation | Denominator | Slope |
|---|---|---|
| horizontal line | non-zero | |
| vertical line | zero | undefined |
A vertical line has no slope at all, because dividing by zero is not defined. That is the one line slope-intercept form cannot describe.
Lessons that teach this
- What Slope Is, and Why It Never Changes on a Line
Learn what slope measures, how to find it with rise over run and the slope formula, and why similar triangles guarantee it is the same everywhere on a line.
- How to Write the Equation of a Line from Two Points
Find a line's equation from any two points: compute the slope, substitute into point-slope form, then simplify — with worked examples and full solutions.
- Rate of Change: Slope With Units Attached
What average rate of change means, how it relates to slope, how to compute it from a table or a function, and how to read its units and sign.
- Parallel and Perpendicular Lines: The Slope Rules
Parallel lines have equal slopes and perpendicular lines have negative reciprocal slopes — why both rules are true, and how to write equations using them.