Two Points

Ad
Slope (m)
—
Slope-Intercept Form
—
Y-Intercept (b)
—
Point-Slope Form
—
Angle from X-Axis
—
Distance Between Points
—
Midpoint
—
Perpendicular Slope
—
Percent Grade
—
Ad

Slope, Angle, and Percent Grade Reference

Slope (m)Common NameAnglePercent Grade
1/12 (0.083)ADA ramp maximum4.8°8.3%
1/4 (0.25)Steep residential street14.0°25%
1/3 (0.333)—18.4°33.3%
1/2 (0.5)6/12 roof pitch26.6°50%
145° line45.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.

How the Slope Calculator Works

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.

The formulas

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.

How to use it

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.

A worked example

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.

Slope in Real Life: Ramps, Pipes, Stairs and Roofs

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 isHow it's quotedSlope (m)Percent gradeAngle
ADA ramp, steepest allowed1:120.08338.33%4.76°
Sidewalk cross slope, ADA maximum1:480.02082.08%1.19°
Drain pipe 2½ in and smaller¼ in per foot0.02082.08%1.19°
Drain pipe 3 to 6 in⅛ in per foot0.01041.04%0.60°
4/12 roof pitch4 in per foot0.333333.33%18.43°
Stairs at the IRC limit (7¾ in riser, 10 in tread)7¾ : 100.77577.50%37.78°
12/12 roof pitch12 in per foot1100%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.

Degrees to Slope Conversion

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:

AngleSlope (m)Percent gradeRise per 12 in of run
1°0.01751.7%0.21 in
2°0.03493.5%0.42 in
5°0.08758.7%1.05 in
10°0.176317.6%2.12 in
15°0.267926.8%3.22 in
20°0.364036.4%4.37 in
30°0.577457.7%6.93 in
45°1.0000100.0%12.00 in
60°1.7321173.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.

Common Slope Mistakes

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.

Frequently Asked Questions

How do you find the slope between two points?

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.

How do you find the y-intercept from two points?

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).

What is the slope of a vertical or horizontal line?

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.

What is the slope of a line perpendicular to another line?

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).

How do you convert slope to an angle or a percent grade?

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.

Do parallel lines have the same slope?

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.

Is a 100% grade vertical?

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.

What does a 1:12 slope mean?

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.