How it works
Slope is "rise over run" — how much y changes for each step in x — measured between two points on a line. Once you have the slope, the y-intercept and the full equation follow directly.
m = (y₂ − y₁) ÷ (x₂ − x₁)
b = y₁ − m × x₁
y = mx + b
Worked example
The line through (1, 2) and (4, 11).
- Rise over run: (11 − 2) ÷ (4 − 1) = 9 ÷ 3.
- That gives a slope of 3.
- y-intercept: 2 − 3 × 1 = −1.
The equation of the line is y = 3x − 1.
Common questions
What does a slope of zero mean?
The line is perfectly horizontal — y stays the same no matter what x is. Enter two points with the same y-value to see it.
What if both points have the same x-value?
The line is vertical, and slope is undefined — you'd be dividing by zero. A vertical line's equation is simply x = (that shared x-value), which the calculator shows instead of a slope.
What does a negative slope mean?
The line runs downhill left to right — y decreases as x increases. The steeper the negative number, the sharper the downward angle.