How to use the slope calculator
Type the coordinates of any two points on the line; negative numbers and decimals are fine. The cards show the slope m, the angle the line makes with the horizontal, the distance between the points, and the changes Δx and Δy. The rows give the y-intercept, the equation y = mx + b with a copy button, the percent grade, the perpendicular slope and the midpoint.
The slope formula
Slope is the change in y divided by the change in x — rise over run:
m = (y₂ − y₁) ÷ (x₂ − x₁)
A positive slope rises from left to right, a negative slope falls, zero means a horizontal line, and when x₁ = x₂ the run is zero and the slope is undefined: the line is vertical. The order of the points does not matter as long as you subtract in the same order on top and bottom.
Worked example
For the points (2, 3) and (5, 11): Δx = 5 − 2 = 3 and Δy = 11 − 3 = 8, so m = 8 ÷ 3 = 2.667. The angle is atan(2.667) = 69.44°. Distance = √(3² + 8²) = √73 = 8.544. The y-intercept is b = y₁ − m x₁ = 3 − 2.667 × 2 = −2.333, giving the equation y = 2.667x − 2.333. The midpoint is ((2 + 5) ÷ 2, (3 + 11) ÷ 2) = (3.5, 7). Any line perpendicular to this one has slope −1 ÷ 2.667 = −0.375.
Angle, percent grade and ratio
The same steepness can be written three ways:
- Angle: θ = atan(m), in degrees. A 45° line has slope 1.
- Percent grade: m × 100 — the rise per 100 units of run. Highway signs use it: an 8% grade climbs 8 ft for every 100 ft of horizontal distance, which is only 4.57°. Percent grade is not capped at 100%: a 45° slope is a 100% grade, and steeper slopes go beyond it.
- Ratio (pitch): rise per fixed run. US roof pitch is inches of rise per 12 inches of run, so a 4:12 roof has slope 0.333, a 33.3% grade and an angle of 18.43°. ADA wheelchair ramps use a 1:12 maximum: 8.33% or 4.76°.
| Slope m | Percent grade | Angle | Typical use |
|---|---|---|---|
| 0.05 | 5% | 2.86° | Steep stretch of interstate |
| 0.0833 | 8.33% | 4.76° | 1:12 accessibility ramp |
| 0.333 | 33.3% | 18.43° | 4:12 roof, a common low pitch |
| 0.5 | 50% | 26.57° | 6:12 roof |
| 1 | 100% | 45° | 12:12 roof |
| 2 | 200% | 63.43° | Steep staircase stringer |
Forms of a line equation
Slope-intercept form y = mx + b is what the calculator returns: m is the slope and b is where the line crosses the y-axis (y when x = 0). Point-slope form y − y₁ = m(x − x₁) is handy when you know the slope and one point; expanding it gives the slope-intercept form. Parallel lines share a slope; perpendicular lines have slopes whose product is −1, so the perpendicular to m is −1 ÷ m.
Where slope shows up
Slope is a rate of change: on a distance-time graph it is speed. Builders use it to set drainage (a patio should fall about 2%, or ¼ inch per foot, away from the house). For the angle alone, the scientific calculator evaluates atan and tan in degrees or radians.
Frequently asked questions
What is the slope of a vertical line?
Undefined. Both points have the same x, so the run x₂ − x₁ is zero and the formula divides by zero. The line is written as x = c (for example x = 1), has no y-intercept unless it is the y-axis itself, and its angle is 90°.
How do I find the slope from an equation?
Rearrange it into y = mx + b; the coefficient of x is the slope. From 3x + 2y = 12: 2y = −3x + 12, so y = −1.5x + 6 and the slope is −1.5. From point-slope form y − y₁ = m(x − x₁), m is already visible.
How do I convert a slope to an angle?
Take the inverse tangent: angle = atan(m) in degrees. A slope of 0.5 is atan(0.5) = 26.57°; a slope of 2 is 63.43°. Going the other way, m = tan(angle): a 30° slope is tan(30°) = 0.577, or a 57.7% grade.
What is the difference between slope and percent grade?
Percent grade is the slope multiplied by 100. A slope of 0.06 is a 6% grade: 6 units of rise for every 100 units of run. Roads and ramps are labeled in percent, roofs in rise-per-12 pitch, and math classes use the plain decimal or fraction.
How do I find the midpoint and distance between two points?
The midpoint averages the coordinates: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2). The distance uses the Pythagorean theorem on Δx and Δy: d = √(Δx² + Δy²). For (1, 2) and (3, 6), the midpoint is (2, 4) and the distance is √(4 + 16) = 4.472.
Last updated: October 9, 2026