How it works
- Slope m = (y₂ − y₁) ÷ (x₂ − x₁): the rise divided by the run.
- The y-intercept is b = y₁ − m × x₁, giving the equation y = mx + b.
- If x₁ = x₂ the line is vertical and its slope is undefined; if y₁ = y₂ the line is horizontal and its slope is 0.
- Whole-number points give exact fractions such as 2/3; decimal points give decimal answers.
Frequently asked questions
Is slope the same as gradient?
Yes. “Gradient” is common in the UK and “slope” in the US. Both mean rise over run.
Does it matter which point is first?
No. Swapping the points flips the sign of both the rise and the run, so the slope stays the same.
Results are estimates for general information and are not financial, medical or professional advice.