This slope calculator finds the slope of a line through two points, along with the y-intercept, the equation of the line, its angle and the distance between the points.
Slope formula
m = (y₂ − y₁) ÷ (x₂ − x₁)
Slope is “rise over run”: how much y changes for each step in x. Once you know m, the y-intercept is b = y₁ − m × x₁, and the line is y = mx + b.
Worked example
For the points (1, 2) and (4, 8), the rise is 6 and the run is 3, so the slope is 2. The intercept is 2 − 2 × 1 = 0, giving y = 2x. The line rises at about 63.43° and the points are about 6.708 units apart.
Frequently asked questions
What does a negative slope mean?
The line goes down from left to right: y falls as x increases.
Why is the slope of a vertical line undefined?
On a vertical line x does not change, so the run is zero, and dividing by zero is undefined. A horizontal line has a slope of 0.