Slope formula
The steepness of the line through two points: rise over run.
Calculator
The live calculator needs JavaScript. The worked example below shows the same steps it would.
See it move
- Distance AB = √(16 + 64) ≈ 8.9443
- Midpoint M = (0, 1)
- Slope = Δy/Δx = 2
What the symbols mean
- the slope (gradient): how much y changes for each 1 that x increases
- x-coordinate of the first point
- y-coordinate of the first point
- x-coordinate of the second point
- y-coordinate of the second point
When to use it
Use it to find the gradient of a line through two known points, the first step to writing its equation. It also tells you the direction: positive slopes rise to the right, negative slopes fall, zero is horizontal, and a vertical line has no slope at all because the run is 0. Equal slopes mean parallel lines. In real data the slope is a rate: metres per second, pounds per item.
Worked example
Find the slope of the line through (−2, −3) and (2, 5).
Start from the formula.
Substitute = , = , = , = and work it out.
m > 0: the line rises from left to right; y goes up 2 for every 1 across.
Answer m = 2
Why it works
The slope of a straight line is the same everywhere along it, so any two points give the same ratio of vertical change to horizontal change. Swapping the two points flips the sign of both differences, which leaves the ratio unchanged.
Common mistakes
- Putting run over rise: the y difference goes on top.
- Subtracting in a different order on top and bottom, , which flips the sign.
- Calling a vertical line's slope 0. A horizontal line has slope 0; a vertical line's slope is undefined.