Use this free slope calculator to get an instant answer in your browser — no sign-up needed. Answer: Slope = (y₂ − y₁) ÷ (x₂ − x₁), rise over run. For (2, 3) and (6, 11) that's 8 ÷ 4 = 2, so the line is y = 2x − 1. If x₁ = x₂ the line is vertical and the slope is undefined.
Slope from two points, slope-intercept form, angle, distance, and midpoint
Slope is rise over run: m = (y₂ − y₁) / (x₂ − x₁). For the points (2, 3) and (6, 11), that's (11 − 3) / (6 − 2) = 2, and the y-intercept works out to b = 3 − 2(2) = −1, so the line is y = 2x − 1. A perpendicular line would have slope −1/2, and the angle of the line is arctan(2) ≈ 63.4°. Vertical lines have undefined slope; horizontal lines have slope 0.
| Slope (m) | Common Name | Angle | Percent Grade |
|---|---|---|---|
| 1/12 (0.083) | ADA ramp maximum | 4.8° | 8.3% |
| 1/4 (0.25) | Steep residential street | 14.0° | 25% |
| 1/3 (0.333) | — | 18.4° | 33.3% |
| 1/2 (0.5) | 6/12 roof pitch | 26.6° | 50% |
| 1 | 45° line | 45.0° | 100% |
| 2 | — | 63.4° | 200% |
| 3 | — | 71.6° | 300% |
Angle = arctan(m) and percent grade = m × 100, so the two columns are just different lenses on the same number. Roofers quote rise per 12 inches of run; road engineers quote percent grade; math class uses plain m.
Slope measures how fast a line climbs: how much y changes for each unit x moves. Enter any two points on the line and this calculator returns the slope, the full equation in slope-intercept form, and everything else the line determines: its angle, its y-intercept, the distance and midpoint between your two points, and the slope any perpendicular line would need.
Slope: m = (y₂ − y₁) / (x₂ − x₁). Y-intercept: b = y₁ − m·x₁ (plug in either point). Slope-intercept form: y = mx + b. Point-slope form: y − y₁ = m(x − x₁). Distance: √((x₂ − x₁)² + (y₂ − y₁)²). Midpoint: ((x₁ + x₂)/2, (y₁ + y₂)/2). Perpendicular slope: −1/m, and parallel lines keep the same m.
Type the coordinates of your two points. Everything updates live, including the graph. The order of the points doesn't matter, but keep the pairs intact: point 1 is (x₁, y₁), point 2 is (x₂, y₂). If both x-values are equal you'll get "undefined" — that's a vertical line, x = that value, and it genuinely has no slope-intercept form.
Take (2, 3) and (6, 11). Rise = 11 − 3 = 8. Run = 6 − 2 = 4. Slope = 8/4 = 2, a positive slope: the line climbs 2 units for every 1 unit it runs right. The y-intercept: b = 3 − 2(2) = −1, so y = 2x − 1. The distance between the points is √(4² + 8²) = √80 ≈ 8.94, the midpoint is (4, 7), the angle is arctan(2) ≈ 63.4°, and any perpendicular line has slope −1/2.
One more with a negative slope: (−1, 7) and (4, −8). Rise = −8 − 7 = −15, run = 4 − (−1) = 5, slope = −3. Then b = 7 − (−3)(−1) = 4, giving y = −3x + 4. Negative slopes always fall as x increases, and this one is steep: 71.6° below horizontal.
Building codes and trades rarely say "slope." They quote a ratio, inches per foot, or a pitch, but every one of them is the same rise-over-run number this calculator returns. Here are some common specs converted to slope, percent grade and angle:
| What it is | How it's quoted | Slope (m) | Percent grade | Angle |
|---|---|---|---|---|
| ADA ramp, steepest allowed | 1:12 | 0.0833 | 8.33% | 4.76° |
| Sidewalk cross slope, ADA maximum | 1:48 | 0.0208 | 2.08% | 1.19° |
| Drain pipe 2½ in and smaller | ¼ in per foot | 0.0208 | 2.08% | 1.19° |
| Drain pipe 3 to 6 in | ⅛ in per foot | 0.0104 | 1.04% | 0.60° |
| 4/12 roof pitch | 4 in per foot | 0.3333 | 33.33% | 18.43° |
| Stairs at the IRC limit (7¾ in riser, 10 in tread) | 7¾ : 10 | 0.775 | 77.50% | 37.78° |
| 12/12 roof pitch | 12 in per foot | 1 | 100% | 45.00° |
The small numbers are the ones people get wrong. A drain pipe at ¼ inch per foot is a 2.08% grade, barely more than a degree, and the same slope as the steepest cross slope the ADA allows on a sidewalk. To check a pipe run or a patio with this tool, put the low end at (0, 0) and the high end at (run, rise) in the same units: 20 feet of pipe that drops 5 inches is (0, 0) to (240, 5), a slope of about 0.02.
Going the other way, from an angle to a slope, is m = tan(angle). This table also gives the rise over a 12-inch run, which is how roof pitch and stair geometry are usually measured:
| Angle | Slope (m) | Percent grade | Rise per 12 in of run |
|---|---|---|---|
| 1° | 0.0175 | 1.7% | 0.21 in |
| 2° | 0.0349 | 3.5% | 0.42 in |
| 5° | 0.0875 | 8.7% | 1.05 in |
| 10° | 0.1763 | 17.6% | 2.12 in |
| 15° | 0.2679 | 26.8% | 3.22 in |
| 20° | 0.3640 | 36.4% | 4.37 in |
| 30° | 0.5774 | 57.7% | 6.93 in |
| 45° | 1.0000 | 100.0% | 12.00 in |
| 60° | 1.7321 | 173.2% | 20.78 in |
For small angles, each degree is worth about 1.75% of grade, which is a handy mental check. That breaks down quickly: 30° is a 57.7% grade, not 52.5%, and 60° is 173%. Slope runs off to infinity as the angle approaches 90°, which is why a vertical line has an undefined slope rather than a very large one.
Most wrong answers come from one of four slips. The first is mixing the order: if you subtract y₁ from y₂, you have to subtract x₁ from x₂, not the other way round, or the sign flips. The second is putting run on top. Slope is always change in y over change in x, so a ramp that rises 2 feet over 24 is 2/24, not 24/2. The third is treating percent grade like an angle. A 100% grade is 45°, not a vertical wall. The last is mixing units: a rise in inches over a run in feet gives a number twelve times too big, so convert first.
Slope is rise over run: m = (y₂ − y₁) / (x₂ − x₁). Subtract the y-coordinates, subtract the x-coordinates in the same order, and divide. For (2, 3) and (6, 11), that's (11 − 3) / (6 − 2) = 8 / 4 = 2. The order of the two points doesn't matter as long as you stay consistent.
First find the slope m, then plug either point into b = y − mx. With slope 2 and the point (2, 3): b = 3 − 2(2) = −1. The full line is y = 2x − 1, which crosses the y-axis at (0, −1).
A horizontal line has slope 0 (the y-values never change, so the numerator is 0). A vertical line has an undefined slope: the x-values are equal, the denominator is 0, and dividing by zero has no meaning. A vertical line's equation is x = a, which can't be written in y = mx + b form.
Flip the slope and change its sign: the perpendicular slope is −1/m. A line with slope 2 has perpendicular slope −1/2, and a line with slope −3 has perpendicular slope 1/3. Horizontal and vertical lines are perpendicular to each other, which is why the rule breaks down at m = 0 (there is no −1/0).
Angle = arctan(m). A slope of 1 is 45 degrees, slope 2 is 63.4 degrees, and slope 0.5 is 26.6 degrees. Percent grade is just m × 100, so slope 0.08 is an 8% grade, the steep end of a highway descent. Roofs and ramps usually quote rise per 12 inches of run: 6/12 pitch means m = 6/12 = 0.5.
Yes. Parallel lines (that aren't the same line) always have identical slopes and different y-intercepts: y = 2x − 1 and y = 2x + 5 never meet. Perpendicular lines, by contrast, have slopes that multiply to −1: 2 × (−1/2) = −1.
No. A 100% grade means the rise equals the run, a slope of 1, which is a 45-degree angle. A vertical line has an undefined slope and no percent grade at all.
One unit of rise for every 12 units of horizontal run, a slope of 0.0833. That's an 8.33% grade or about 4.76 degrees, and it's the steepest the ADA allows for most wheelchair ramps. A 30-inch rise needs at least 30 feet of ramp at 1:12.