Slope Calculator

Find a line’s slope from two points.

Reset

Understanding slope

Slope is one of those ideas that sounds abstract in a maths class and turns out to be everywhere. It is the steepness of a hill, the rate at which a bill grows, the speed of a car on a distance-time graph, and the trend of a sales chart — all the same idea wearing different clothes. The slope of a line answers one question: for every step you take sideways, how far do you go up or down?

Formula and method

Slope (m): m = (y₂ − y₁) ÷ (x₂ − x₁) — rise over run
Slope-intercept form: y = mx + b
Finding b: b = y₁ − m × x₁ (using either point)
Point-slope form: y − y₁ = m(x − x₁)
X-intercept: set y = 0 and solve for x: x = −b ÷ m
Special cases: if y₂ = y₁, the slope is 0 and the line is horizontal (y = a constant)

For two points (x₁, y₁) and (x₂, y₂): where b is the y-intercept (the value of y when x = 0). Parallel lines have equal slopes. Perpendicular lines have slopes that are negative reciprocals: m₁ × m₂ = −1, so if one slope is 3/4, a perpendicular slope is −4/3. Special cases: If x₂ = x₁, the slope is undefined — division by zero — and the line is vertical (x = a constant).

Worked example

Example 1 — Two points with a clean slope Find the slope of the line through (2, 3) and (8, 15). Rise: 15 − 3 = 12 Run: 8 − 2 = 6 Slope: m = 12 ÷ 6 = 2 Y-intercept: b = 3 − 2 × 2 = 3 − 4 = −1 Equation: y = 2x − 1 X-intercept: set y = 0, so 0 = 2x − 1, giving x = 0.5 Check with the second point: at x = 8, y = 2 × 8 − 1 = 15. Correct. A slope of 2 means the line rises two units for every one unit it runs — a steep climb, and the negative intercept tells you it crosses the y-axis below the origin, at −1.