Slope
calculator.
Two points, or a rise and a run, give a line's steepness, equation, grade and angle.
- Angle with x-axis
- 33.6901°
- Grade
- 66.6667%
- Distance between points
- 7.2111
For each 1 you move right, y rises by 0.6667. Between your two points that adds up to a change of 4 over a run of 6.
The line on a grid
Drag a point to move itThe line y = 0.666667x + 2.333333 through (−2, 1) and (4, 5), with a run of 6 and a rise of 4 drawn as a right triangle. It crosses the y-axis at 2.3333. It crosses the x-axis at −3.5.
Working
- 1Rise: the change in y. Run: the change in xrise = 5 − 1 = 4, run = 4 − (−2) = 6
- 2Slope: rise over runm =46=23=0.6667
- 3Where it crosses the y-axisb = 1 −23× (−2) =73
- 4The equationy =23x+73
- 5Check: put the second point’s x into the equation0.6667 × 4 + 2.3333 = 5, which is y₂ = 5
Work it out for a job
At this slope, a rise of 24 takes a run of 36, in the same unit. The sloped surface itself is 43.2666 long.
Against the ramp limits
Steeper than the 1:12 limit. This running slope is 66.67%. The ADA Standards let a ramp rise at most 1 in 12 (8.33%), 30 in per run, with a cross slope of at most 1:48. A walking surface steeper than 1:20 counts as a ramp.
From the U.S. Access Board guide to ramps. Local codes may be stricter.
Points on the line
| x | y |
|---|---|
| −20 | −11 |
| −14 | −7 |
| −8 | −3 |
| −2 | 1 |
| 4 | 5 |
| 10 | 9 |
| 16 | 13 |
How it's worked out
Slope is the ratio of the rise to the run: how far a line goes up for each step across. With two points, the rise is the change in y and the run is the change in x. You can call either point the first one, as long as you subtract in the same order on the top and the bottom.
A positive slope climbs to the right, and a negative one falls. A horizontal line has a slope of 0. A vertical line has a run of 0, and since nothing can be divided by 0, its slope is not defined.
The slope-intercept form writes the same line using b, the point where it crosses the y-axis. Point-slope and standard form describe the identical line in other ways.
Builders write the same number differently. A percent grade multiplies the ratio by 100, so 1:12 is about 8.33%. The angle from level is the one whose tangent equals the slope.
Worked examples
Aisha finds a line through two points
Aisha has (−2, 1) and (4, 5). The rise is 4 and the run is 6, which reduces to a slope of . Put one point into the equation, and b comes to .
In standard form that is 2x − 3y = −7. The line sits 33.69° above level, and a line square to it has a slope of . To check, put in x = 4, and the equation gives 5, her second point.
Ben checks how long a 24 inch ramp must run
Ben has a 24 in step up to a porch. The ADA limit of 1:12 is a 8.33% grade, or 4.76° from level. At that slope, a 24 in rise takes a run of 288 in, which is 24 ft, and the sloped deck itself is 289 in long. The rise is under the 30 in limit for one run, so it needs no landing partway up.
Nora reads a shop's sales trend as a slope
A shop sold $41,000 in 2019 and $58,500 in 2024. The slope between those points is $3,500 per year. It is the average climb across five years, not a claim that each year rose by that much.
Reading your result
Fractions first. With whole numbers or short decimals, the slope reads as a reduced fraction, because that is the exact answer. The decimal next to it is rounded. A line through (2, 3) with a slope of −4 is y = −4x + 11.
Grade and angle do not move in step. Grade is a tangent, not an angle. A 100% grade is 45°, not 90°, and a true wall has no finite grade. A 6% road is only 3.43°.
| Grade | Angle | Ratio |
|---|---|---|
| 1% | 0.57° | 1:100 |
| 2% | 1.15° | 1:50 |
| 5% | 2.86° | 1:20 |
| 8.33% | 4.76° | 1:12 |
| 10% | 5.71° | 1:10 |
| 25% | 14.04° | 1:4 |
| 50% | 26.57° | 1:2 |
| 100% | 45° | 1:1 |
Ramp limits. The Access Board guide to the ADA Standards sets a ramp's running slope at 1:12 at most, with no more than 30 in of rise per run and a cross slope of 1:48 at most. A walking surface steeper than 1:20 counts as a ramp. The guide also recommends the least slope you can manage, since a gentler ramp is easier to use. Local codes may ask for more, so check yours before you build.
Straight lines only. Here, one slope holds along the whole line. For the slope of a curve at one point, use the tangent line calculator.
Common mistakes
- Mixing the order of the points. Taking y₂ − y₁ on top and x₁ − x₂ below flips the sign, which turns a climb into a fall. Keep the same point first in both.
- Calling a vertical line zero slope. Zero on top means a flat line with slope 0. Zero on the bottom means a vertical line, whose slope is undefined.
- Measuring a ramp along its surface. Run is measured level, across the ground. Using the sloped length as the run makes the slope look gentler than it is.
- Treating percent as degrees. A 45° roof is a 100% grade. A 45% grade is only 24.23°, so reading it as 45° nearly doubles the true steepness in your head.
Questions people ask
Sources
- OpenStax, Elementary Algebra, section 4.4, Understand Slope of a Line
- OpenStax, Elementary Algebra, section 4.5, Use the Slope-Intercept Form
- Weisstein, E. W., Slope, MathWorld
- U.S. Access Board, Guide to the ADA Accessibility Standards, Chapter 4: Ramps and Curb Ramps
- U.S. Access Board, ADA Accessibility Standards, section 106.5 definitions