Slope calculator
Find a line’s slope and y-intercept from two points.
Formula
m = (y₂ − y₁) / (x₂ − x₁); b = y₁ − mx₁
Slope m ≈ ((6)-(2))÷((3)-(1)) · Y-intercept b ≈ (2)-(2)×(1)
How to use
- Enter the first point.
- Enter the second point with a different x.
- Read m and b for y=mx+b.
Examples
- (1,2) and (3,6): m=2, b=0.
- (0,5) and (2,1): m=−2, b=5.
Frequently asked questions
What if both x coordinates match?
The line is vertical, or the points coincide; this slope formula is undefined.
What does a negative slope mean?
The line falls as x increases.
Does swapping the points change the result?
No. Both the rise and run change signs, so their ratio stays the same.
Sources
Updated: