The slope of a line is a single number that describes how steep the line is and whether it rises or falls. Every formula on this page comes from the same idea: divide the change in y by the change in x.
1. The Slope Formula (Rise over Run)
m = (y2 − y1) / (x2 − x1)
Example with points (1, 3) and (4, 11):
rise = 11 − 3 = 8
run = 4 − 1 = 3
m = 8 / 3 ≈ 2.6667
So the line rises 8 units for every 3 units it moves right.
Order matters only in that you must subtract the coordinates in the same order on top and bottom. (y2 − y1) / (x2 − x1) and (y1 − y2) / (x1 − x2) give the same answer because both the numerator and denominator flip sign.
2. Three Forms of a Line Equation
Slope-intercept form: y = mx + b
Point-slope form: y − y1 = m(x − x1)
Standard form: Ax + By = C
Example using slope m = 8/3 through point (1, 3):
Point-slope: y − 3 = (8/3)(x − 1)
Slope-intercept: y = (8/3)x + 1/3
Standard: 8x − 3y = −1
Slope-intercept form is the quickest read: m is the slope, b is the y-intercept. Point-slope form is easiest when you have a slope and one point but no y-intercept. Standard form is preferred for systems of equations and when A, B, and C are integers.
3. Parallel and Perpendicular Lines
Parallel lines: m1 = m2 (same slope)
Perpendicular lines: m1 × m2 = −1 (negative reciprocals)
m2 = −1 / m1
Example: a line with slope 2
Parallel line slope: 2
Perpendicular line slope: −1/2 = −0.5A line perpendicular to y = 3x + 4 has slope −1/3. A line perpendicular to y = −0.25x + 7 has slope 4. The only exception is horizontal and vertical lines: a horizontal line (slope 0) is perpendicular to a vertical line (slope undefined), even though the product rule does not apply because one slope is undefined.
4. Special Cases: Horizontal and Vertical Lines
Horizontal line: m = 0 y = c (example: y = 5)
Vertical line: m is undefined x = c (example: x = 2)
For a horizontal line the rise is 0, so 0 / run = 0.
For a vertical line the run is 0, so rise / 0 is undefined.
A horizontal line has every y-value equal to the same constant, so there is no rise anywhere along it. A vertical line has every x-value equal to the same constant, so you cannot divide by the run. The calculator above detects vertical lines automatically and labels the slope as undefined.
5. Distance, Midpoint, and Angle
Distance: d = √[(x2 − x1)² + (y2 − y1)²]
Midpoint: M = ((x1 + x2)/2, (y1 + y2)/2)
Angle: θ = arctan(m) (in degrees)
For points (0, 0) and (3, 6):
d = √(3² + 6²) = √45 ≈ 6.7082
M = (1.5, 3)
θ = arctan(2) ≈ 63.43°
6. Slope as Rise/Run, Rate of Change, Percent, and Degrees
The same slope can be written in four ways depending on the context. Engineers and builders often use percent grade or a 1 in X ratio. Scientists and economists usually state slope as a rate of change. Geometry problems use degrees. All of these are the same underlying number.
Decimal slope: m = rise / run
Percent grade: % = (rise / run) × 100
Degrees: θ = arctan(rise / run)
Ratio: 1 in X means rise of 1 per run of X, so m = 1/X
A 5% grade is a slope of 0.05, which is about 2.86 degrees. A wheelchair ramp at 1 in 12 is a slope of 0.0833, which is 8.33% or about 4.76 degrees. The quick-reference table below covers the values you are most likely to see.
| Slope (m) | Angle | Percent Grade | Ratio | Real-World Example |
|---|
| 0 | 0° | 0% | flat | horizontal floor, calm water |
| 0.05 | 2.86° | 5% | 1 in 20 | typical roof pitch, gentle road grade |
| 0.0833 | 4.76° | 8.33% | 1 in 12 | ADA max wheelchair ramp |
| 0.5 | 26.57° | 50% | 1 in 2 | steep hiking trail |
| 1 | 45° | 100% | 1 in 1 | diagonal, black diamond ski run |
| 2 | 63.43° | 200% | 2 in 1 | very steep staircase |
| −1 | −45° | −100% | −1 in 1 | downward diagonal |
| undefined | 90° | infinite | vertical | cliff face, wall |