Slope Calculator
Slope, angle and line equation from two points
Slope
Working
- m = (y₂ − y₁) ÷ (x₂ − x₁) = (5 − 2) ÷ (5 − 1) = 3 ÷ 4 = 0.75
- b = y₁ − m·x₁ = 2 − 0.75 × 1 = 1.25
- d = √(Δx² + Δy²) = √(16 + 9) = 5
- 1Enter two points(x₁, y₁) and (x₂, y₂)
- 2Get the slopeAs a decimal and a fraction
- 3Plus the lineEquation, angle, distance, midpoint
How is slope calculated?
Slope is rise over run: how much y changes for every 1 unit that x changes.
m = (y₂ − y₁) ÷ (x₂ − x₁)
y = mx + b, with b = y₁ − m·x₁
Angle = tan⁻¹(m)
Distance = √((x₂ − x₁)² + (y₂ − y₁)²)
Positive, negative, zero and undefined
A positive slope rises to the right; a negative slope falls. A slope of 0 is a flat (horizontal) line, and a vertical line has an undefined slope because the run is zero.
Slope as a percentage
Road and ramp gradients are often given as a percentage: slope × 100. A 1 in 12 wheelchair ramp has a slope of 0.0833, or 8.33%.
Related calculators
Frequently asked questions
What is the slope formula?
m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (5, 5), m = 3 ÷ 4 = 0.75.
How do I find the equation of the line?
Work out the slope m, then b = y₁ − m × x₁. The line is y = mx + b.
How do I convert a slope to an angle?
Take the inverse tangent: angle = tan⁻¹(m). A slope of 1 is 45°.
Last reviewed: October 2026
