About the Slope Calculator
Enter two points and the calculator returns the slope, the equation of the line through them, the angle it makes with the x-axis, the distance between the points and their midpoint.
A vertical line has an undefined slope because the run is zero, and the calculator shows its equation as x = constant. Slope is used for road grades, roof pitch, rates of change in graphs and in the point-slope form of a line.
How to Use the Slope Calculator
- Enter the coordinates of both points.
- Read the slope and the line equation.
- Check the angle, distance and midpoint.
Formula and Method
Slope
m = (y₂ − y₁) ÷ (x₂ − x₁)
Intercept
b = y₁ − m x₁
Angle
θ = arctan(m)
Worked Example
Two points
Input: (1, 2) and (5, 10)
- Rise = 8, run = 4
- m = 2
- b = 2 − 2 × 1 = 0
Result: y = 2x.
Frequently Asked Questions
What does a negative slope mean?
The line falls from left to right.
What is the slope of a horizontal line?
Zero.
How do I convert slope to a percentage grade?
Multiply by 100. A slope of 0.08 is an 8% grade.
What are parallel and perpendicular slopes?
Parallel lines share a slope; perpendicular slopes multiply to −1.
Related Calculators
Sources and Further Reading
Accuracy and Scope
Results use standard IEEE-754 double-precision arithmetic and are rounded for display. For exam, engineering or research work, verify critical values with a second method. See our full disclaimer.