How to find the slope of a line
- Enter the coordinates of the first point (x₁, y₁).
- Enter the coordinates of the second point (x₂, y₂).
- Read the slope, the y-intercept, the angle and the line's equation.
Rise over run
Slope m = (y₂ − y₁) ÷ (x₂ − x₁): the change in y (rise) divided by the change in x (run). A positive slope rises from left to right, a negative slope falls, 0 is horizontal, and a vertical line (x₂ = x₁) has an undefined slope.
The y-intercept is b = y₁ − m × x₁, giving the slope-intercept form y = mx + b. The angle with the x-axis is arctan(m).
Worked examples
(1, 2) and (4, 8)
Rise 6, run 3, so m = 2; b = 2 − 2 × 1 = 0; the line is y = 2x.
(−2, 5) and (2, −3)
Rise −8, run 4, so m = −2; b = 5 − (−2)(−2) = 1; the line is y = −2x + 1.
Frequently asked questions
Does it matter which point is first?
No. Swapping the points changes the sign of both the rise and the run, so the slope is the same.
What does a slope of 0.5 mean?
The line goes up 1 unit for every 2 units to the right. As a grade it is 50%.
Why is a vertical line's slope undefined?
The run is 0, and division by zero is undefined.