Slope measures how steep a straight line is and which way it tilts: the change in y for every one-unit change in x. A slope of 3 climbs 3 units for each unit to the right, a slope of −1/2 drops half a unit, and a vertical line has no defined slope at all. This calculator finds the slope from two points, or starts from one point and a known slope, then describes the whole line: intercepts, angle, percent grade, perpendicular slope and the equation in slope-intercept, point-slope and standard form.
How to use the slope calculator
- Under I know, choose Two points or A point and the slope.
- Under Point 1, enter x₁ and y₁.
- For two points, enter x₂ and y₂ under Point 2. Otherwise type the slope into Slope (m) as a decimal, such as 0.75 or −2.
- The slope appears at the top, as an exact fraction when possible with the decimal beneath it. Below are the Rise (Δy) and Run (Δx) in two-point mode, the Slope-intercept form, Point-slope form and Standard form, the y-intercept and x-intercept, the Angle of inclination, the Grade, the Perpendicular slope and, in two-point mode, the Distance between points. The graph draws the line with its rise-and-run triangle.
Slope formula
The angle of inclination is measured counterclockwise from the positive x-axis, so it runs from 0° up to, but not including, 180°. A negative slope gives an angle between 90° and 180°: a slope of −2/3 is inclined at 146.31°.
| Slope | Reading left to right | Example | Angle of inclination |
|---|---|---|---|
| Positive | Line rises | m = 2 | between 0° and 90° |
| Negative | Line falls | m = −2/3 | between 90° and 180° |
| Zero | Horizontal line | y = 4 | 0° |
| Undefined | Vertical line | x = 3 | 90° |
Worked example: a wheelchair ramp
A porch is 30 inches above the sidewalk. Put the bottom of the ramp at (0, 0) and the top at (360, 30), in inches, and choose Two points.
- Rise 30 in, run 360 in, so m = 30 ÷ 360 = 1/12 ≈ 0.083333.
- Grade: 8.3333%, exactly the 1:12 maximum running slope in the 2010 ADA Standards.
- Angle of inclination: 4.7636°.
- Ramp surface length (distance between the points): 361.25 in, just over 30 ft.
- If the yard allows only 240 in (20 ft) of run, the slope becomes 1/8, a 12.5% grade at 7.125°, too steep for an accessible ramp.
Grade, pitch and angle
Different trades express the same rise-over-run ratio in different ways. Road and ramp grades are percentages, roof pitch is the rise in inches per 12 inches of run, and stair steepness is the riser height over the tread depth.
| Description | Slope | Grade | Angle |
|---|---|---|---|
| 1:20 walk (steeper counts as a ramp under ADA) | 1/20 | 5% | 2.86° |
| 6% road grade | 3/50 | 6% | 3.43° |
| ADA ramp maximum, 1:12 | 1/12 | 8.33% | 4.76° |
| 4/12 roof pitch | 1/3 | 33.33% | 18.43° |
| 6/12 roof pitch | 1/2 | 50% | 26.57° |
| 7¾ in riser on a 10 in tread | 31/40 | 77.5% | 37.78° |
| 12/12 roof pitch | 1 | 100% | 45° |
The most common mistake is treating grade as an angle. A 10% grade is only 5.71°, and the angle reaches 45° when the grade hits 100%. The last stair row is the steepest combination the International Residential Code allows for most home stairs; the stair calculator works out a full flight.
Converting between line forms
Take the line through (−2, 5) and (4, 1). Its slope is −4 ÷ 6 = −2/3.
- Point-slope form, y − y₁ = m(x − x₁): y − 5 = −(2/3)(x + 2).
- Slope-intercept form, y = mx + b: distribute and add 5 to get y = −(2/3)x + 11/3, so the y-intercept is 11/3.
- Standard form, Ax + By = C: multiply by 3 and gather x and y on the left to get 2x + 3y = 11, with whole-number coefficients and A positive.
Setting y = 0 gives the x-intercept, 11/2. A line parallel to this one has the same slope, −2/3; a perpendicular line has slope 3/2. To find where two lines cross, solve their equations together with the system of linear equations calculator. For the length and midpoint of the segment between your points, see the distance calculator and the midpoint calculator.
Frequently asked questions
How do you find slope from two points?
Subtract the y-coordinates to get the rise and the x-coordinates, in the same order, to get the run, then divide: m = (y₂ − y₁) ÷ (x₂ − x₁). From (−2, 5) to (4, 1) the rise is −4 and the run is 6, so m = −2/3.
What does an undefined slope mean?
The line is vertical. Both points share the same x-coordinate, so the run is zero and rise ÷ run would divide by zero. Its equation is x = c, it has no y-intercept, and any line perpendicular to it is horizontal with slope 0.
How do I convert slope to percent grade or degrees?
Multiply the slope by 100 for percent grade, and take its arctangent for the angle. A slope of 1/12 is an 8.33% grade and an angle of about 4.76°. Grade and angle are different numbers: a 100% grade is 45°, not 90°.
What is the slope of a perpendicular line?
The negative reciprocal: flip the fraction and change its sign. A line with slope 2/3 is perpendicular to one with slope −3/2, and the two slopes multiply to −1. Horizontal and vertical lines are the exception, since one has slope 0 and the other has no defined slope.
What is the maximum slope for a wheelchair ramp?
The 2010 ADA Standards for Accessible Design limit a ramp's running slope to 1:12, which is an 8.33% grade or about 4.76°, with at most 30 inches of rise per run. Gentler ramps are easier to use, and local codes may add their own requirements.
Why is the slope shown as a fraction?
When the slope is a simple ratio, the calculator shows it exactly, such as 1/12 instead of 0.083333, with the decimal underneath. Exact fractions keep the rest of the answer exact too, so you see 2x + 3y = 11 rather than a rounded decimal equation.