How to use the slope calculator
- Enter the coordinates of the first point, (x₁, y₁).
- Enter the coordinates of the second point, (x₂, y₂).
- See the slope, the equation of the line, the distance between the points, the midpoint and the angle.
Slope formula
The slope tells you how steep a line is and in which direction it goes: how much y changes for each 1-unit increase in x.
- Positive slope: the line rises from left to right.
- Negative slope: the line falls from left to right.
- Zero slope: a horizontal line (y = constant).
- Undefined slope: a vertical line (x = constant).
Worked example
Find the line through (1, 2) and (3, 8).
- Slope: m = (8 − 2) ÷ (3 − 1) = 6 ÷ 2 = 3.
- Intercept: b = y₁ − m × x₁ = 2 − 3 × 1 = −1.
- Equation: y = 3x − 1.
- Distance: √(2² + 6²) = √40 ≈ 6.3246. Midpoint: (2, 5). Angle: arctan(3) ≈ 71.57°.
Other formulas for two points
Slope in real life
Slope is often written as a grade (percent): rise ÷ run × 100. A road that climbs 6 feet over 100 feet has a 6% grade. Roof pitch is written as rise per 12 inches of run — a 6/12 roof has a slope of 0.5 (about 26.6°). Wheelchair ramps in the US are limited to a 1:12 slope (about 8.3%).
Frequently asked questions
How do I find the slope between two points?
Subtract the y-values and divide by the difference of the x-values: m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (3, 8), m = 6 ÷ 2 = 3.
What is slope-intercept form?
It is the line equation y = mx + b, where m is the slope and b is the y-intercept — the y-value where the line crosses the y-axis.
What does an undefined slope mean?
The line is vertical: both points have the same x-value, so the run is zero and the slope formula would divide by zero.
How do I convert slope to an angle?
Take the arctangent of the slope. A slope of 1 is 45°, a slope of 0.5 is about 26.57° and a slope of 2 is about 63.43°.
Does it matter which point I call the first point?
No. Swapping the points changes the sign of both the rise and the run, so the slope stays the same.
Results are rounded for display. For academic or professional work, double-check critical calculations and follow the rounding rules your teacher, school or organization requires.
Last updated: