Slope Calculator
By using our calculators, you agree to our Terms of Use.
Slope and y-intercept of the line through two points: m = (y₂ − y₁) / (x₂ − x₁).
Two points
Slope (m)
2
y-intercept (b): 1
- Line equation
- y = 2x + 1
Related calculators
Slope between two points
Slope measures how steep a line is — the change in y divided by the change in x between two points: m = (y₂ − y₁) / (x₂ − x₁). A positive slope rises left to right, a negative slope falls, a slope of 0 is a flat horizontal line, and a vertical line has an undefined slope (division by zero).
Once you know the slope, the y-intercept (b) comes from the point-slope relationship: b = y₁ − m·x₁. Together, m and b describe the full line in slope-intercept form, y = mx + b.
Example: for the points (0, 1) and (2, 5), the slope is (5 − 1) / (2 − 0) = 4/2 = 2, and the y-intercept is 1 − 2×0 = 1 — so the line is y = 2x + 1.
Common questions
What does an undefined slope mean?
It means the two points share the same x-coordinate, forming a vertical line. Vertical lines have no defined slope because the change in x is zero, which would require dividing by zero.
How do I get the full equation of the line?
Combine the slope (m) and y-intercept (b) shown here into slope-intercept form: y = mx + b.