169 TOOLS · 0 SIGN-UP
TallyBench / Slope Calculator
// SLOPE CALCULATOR

Two points in, the whole line out.

Slope, angle, intercept, equation and distance — everything determined by a pair of coordinates.

Slope (m)
Angle from horizontal
y-intercept (b)
Line equation
Distance between points

Rise over run

Slope is the change in y divided by the change in x: m = (y₂ − y₁) / (x₂ − x₁). From (1, 2) to (4, 11) the rise is 9 and the run is 3, so the slope is 3 — the line climbs three units for every one it moves right.

Once you have m, the intercept follows from either point: b = y − mx. Here that is 2 − 3(1) = −1, giving y = 3x − 1.

Vertical lines have no slope — not zero slope

A horizontal line has slope zero: it rises not at all. A vertical line has undefined slope, because the run is zero and you cannot divide by it. The two get confused constantly, and the distinction matters: a vertical line cannot be written as y = mx + b at all, only as x = constant.

Slope as an angle, and as a percentage

The angle from horizontal is arctan(m). A slope of 1 is 45°, a slope of 3 is 71.57°. Road gradients are usually quoted as percentages instead, where the percentage is the slope times 100 — a 10% gradient means a slope of 0.1, rising 1 metre over 10.

Parallel lines share a slope. Perpendicular lines have slopes whose product is −1, so the perpendicular to a slope of 3 has slope −⅓.

What does a negative slope mean?

The line falls from left to right — y decreases as x increases. The steepness is given by the absolute value, so a slope of −3 is exactly as steep as +3, just descending.

Why is the slope of a vertical line undefined rather than infinite?

Because the run is zero and division by zero has no value. Saying "infinite" is a loose description of the limit as a line approaches vertical, not a definition. A vertical line simply cannot be expressed in y = mx + b form.

How do I find the slope perpendicular to a line?

Take the negative reciprocal. A slope of 3 gives a perpendicular of −1/3, and their product is −1. Horizontal and vertical are the exception, since one has slope 0 and the other is undefined.

Is a 10% gradient the same as a 10° slope?

No, and confusing them understates steep hills. A 10% gradient is a slope of 0.1, which is about 5.71°. They only converge for very shallow angles.

For the straight-line distance alone, including in three dimensions, use the Coordinate Distance Calculator — the underlying step is the Pythagorean theorem. For solving the resulting equations, see the Quadratic Formula Calculator and the Scientific Calculator.