GuideMeasure & Convert

How to Calculate Slope

The slope formula for two points, what positive, negative, zero and undefined slopes mean, and how to measure and express the slope of a yard, path or ramp as a percent, a ratio or an angle.

Updated 7 min read

Short answer

Slope is rise divided by run. Between two points, slope = (y₂ − y₁) ÷ (x₂ − x₁): from (1, 2) to (4, 8) it is 6 ÷ 3 = 2. On the ground, divide the change in height by the level distance and multiply by 100 for a percent grade: 6 inches of fall over 25 feet is 0.5 ÷ 25 × 100 = 2%.

Do the math for your project

Slope Calculator

Slope percent, ratio and angle from rise and run, plus the drop you need for drainage.

Open the Slope Calculator

The slope formula for two points

Slope tells you how much a line goes up or down for each step sideways. Pick any two points on the line, (x₁, y₁) and (x₂, y₂). The rise is the change in y, the run is the change in x, and the slope, usually written m, is one divided by the other.

m = (y₂ − y₁) ÷ (x₂ − x₁)

  1. Label the points. Take (1, 2) as point 1 and (4, 8) as point 2.
  2. Subtract the y values: 8 − 2 = 6. That is the rise.
  3. Subtract the x values in the same order: 4 − 1 = 3. That is the run.
  4. Divide: 6 ÷ 3 = 2. The line climbs 2 units for every 1 unit to the right.

The order of the points does not matter as long as you use the same order on top and bottom: (2 − 8) ÷ (1 − 4) also gives 2. Mixing the order is the most common slip, and it flips the sign.

Positive, negative, zero and undefined slope

The sign of the slope tells you the direction of the line. Purdue University's mathematics department sums it up in four rules: a line with a positive slope rises from left to right, a line with a negative slope falls from left to right, a line with a slope of zero is horizontal, and a line with an undefined slope is vertical.

Example of a negative slope: from (2, 5) to (6, −1), the rise is −1 − 5 = −6 and the run is 6 − 2 = 4, so m = −6 ÷ 4 = -1.5. A vertical line, such as through (3, 1) and (3, 7), has a run of 0, and dividing by zero has no answer, which is why its slope is undefined rather than zero.

Slopes also compare lines. Two non-vertical lines with the same slope never meet: they are parallel. Two lines whose slopes multiply to −1 cross at a right angle, so a line with slope 2 is perpendicular to one with slope −1/2. That check is handy when you lay out a square corner on a graph.

If the line is written as y = mx + b, the slope-intercept form, the slope is simply the number in front of x. In y = 3x − 4 the slope is 3. On a graph, find two points where the line crosses grid corners, count the squares up or down, then the squares across, and divide.

Slope on the ground: percent, ratio and angle

Outside a math class, slope is the same rise over run, but it is written in other ways. Builders and landscapers use a percent grade, a ratio, the inches of drop per foot, or an angle in degrees. All four come from the same division.

Percent grade = rise ÷ run × 100
Ratio = 1 : (run ÷ rise)
Drop per foot = rise ÷ run × 12 inches
Angle = arctan(rise ÷ run)

Rise and run must be in the same unit before you divide. The run is measured level, not along the sloping surface.

Percent grade converted to angle, drop per foot and ratio
Percent gradeAngleDrop per footRatio (rise : run)
1%0.57°0.12 in1 : 100
2%1.15°0.24 in1 : 50
5%2.86°0.6 in1 : 20
8.33%4.76°1 in1 : 12
10%5.71°1.2 in1 : 10
15%8.53°1.8 in1 : 6.7
25%14.04°3 in1 : 4
50%26.57°6 in1 : 2
100%45°12 in1 : 1

Percent and degrees are not the same scale. A 100% grade is a rise equal to the run, which is 45 degrees, and an angle near 90 degrees runs toward an infinite percent. The second table goes the other way, from an angle to a percent.

Angle converted to percent grade
AnglePercent grade
1°1.7%
5°8.7%
10°17.6%
15°26.8%
30°57.7%
45°100%
60°173.2%

How to measure rise and run in a yard

You need two stakes, a mason's string, a line level and a tape measure.

  1. Drive one stake at the high point and one at the low point.
  2. Tie the string to the high stake at ground level, or a set height above it.
  3. Pull the string to the low stake, hang the line level in the middle, and slide the string up or down the low stake until the bubble is centered.
  4. Measure the length of the level string between the stakes. That is the run.
  5. At each stake, measure from the string down to the ground. The difference between the two measurements is the rise.

On a long or uneven slope, measure in sections and add them up, or use a laser level. A long straight board with a carpenter's level on top does the same job over short distances.

Worked example: a backyard that drops 16 inches

The level string between two stakes is 20 feet long. At the high stake the string is 10 inches above the ground, and at the low stake it is 26 inches above the ground, so the yard falls 26 − 10 = 16 inches.

  • Rise in feet: 16 ÷ 12 = 1.333 ft
  • Percent grade: 1.333 ÷ 20 × 100 = 6.67%
  • Ratio: 20 ÷ 1.333 = 15, so the slope is 1 : 15
  • Drop per foot: 16 ÷ 20 = 0.8 inches
  • Angle: arctan(0.0667) = 3.81 degrees

The slope calculator gives all five at once from a rise and a run in any units. If you plan to regrade, the fill dirt calculator estimates the soil to move, and a change of level that is too steep for a path may need steps from the stair calculator.

Open this example in the slope calculator

Slope limits you may need to meet

For accessible routes, the 2010 ADA Standards set clear numbers. The U.S. Access Board's guide to ramps gives a maximum running slope of 1:12, which it states as 8.33%, and a maximum cross slope of 1:48. Each ramp run may rise 30 inches at most, though a ramp can have any number of runs. The Standards define a ramp as a walking surface with a running slope steeper than 1:20, which is 5%.

Roofs use their own notation, the rise in inches per 12 inches of run, so a 6/12 roof has a slope of 50%. Our guide on how to calculate roof pitch covers it, and the roof pitch calculator converts between the forms.

Local rules: drainage, driveway and ramp slopes on a real project are set by your building department and, for public or commercial work, by accessibility law. Check them before you build.

Common mistakes

  • Swapping the order of subtraction between the top and the bottom of the fraction. Keep point 1 first in both.
  • Mixing units. 16 inches over 20 feet is not 16 ÷ 20 × 100 = 80%. Convert the rise to feet first.
  • Measuring the run along the slope. The run is horizontal. On steep ground the sloped length is noticeably longer.
  • Reading percent as degrees. A 10% driveway is less than 6 degrees, not 10.
  • Calling a vertical line's slope zero. Zero is flat; vertical is undefined.

Frequently asked questions

How do you find the slope between two points?

Subtract the y values, subtract the x values in the same order, and divide: m = (y₂ − y₁) ÷ (x₂ − x₁). From (1, 2) to (4, 8) the slope is 6 ÷ 3 = 2.

What does an undefined slope mean?

The line is vertical. Its run is zero, and you cannot divide by zero, so the slope has no value. A horizontal line is different: its slope is zero.

How do you convert a percent slope to degrees?

Divide the percent by 100 and take the arctangent. A 10% grade is arctan(0.10) = 5.71 degrees, and a 50% grade is 26.57 degrees.

Is a 100 percent slope vertical?

No. A 100% slope rises 1 foot for every foot of run, which is 45 degrees. A vertical wall has no percent value at all.

At what slope does a walkway count as a ramp under the ADA?

The 2010 ADA Standards define a ramp as a walking surface with a running slope steeper than 1:20, which is 5%. The steepest ramp allowed is 1:12, or 8.33%.

Sources

  1. U.S. Access Board: Guide to the ADA Accessibility Standards, Chapter 4, Ramps and Curb Rampsaccess-board.gov
  2. U.S. Access Board: 2010 ADA Standards for Accessible Design (106.5 Defined terms)access-board.gov
  3. Purdue University Department of Mathematics: Slope and Line Information (MA 15910)math.purdue.edu

Last updated . Free to read, no sign-up. How we check our numbers.