On This Page
- What slope means
- Slope from two points
- Slope-intercept form and y-intercept
- Point-slope form
- Standard form to slope-intercept form
- Percent slope and slope angle in degrees
- Roof slope
- Ramp slope, ADA and wheelchair ramps
- Driveway, pipe, gutter, and grading slope
- Slope in Excel
- Worked examples
- Frequently asked questions
What Is Slope?
A positive slope rises from left to right. A negative slope falls from left to right. A slope of zero is horizontal, and a vertical line has an undefined slope because its run is zero.
In plain language, slope answers this question: “For every 1 unit I move sideways, how much does the line move up or down?” That is why slope is often described as rise over run.
Slope From Two Points
The main slope formula from two points is:
- Rise is y2 - y1.
- Run is x2 - x1.
- Slope is rise divided by run.
Enter both coordinate pairs exactly as they appear in the problem. The order of the points does not change the slope, reversing P1 and P2 flips the sign of both rise and run, and the negatives cancel. What does matter is using the same point order in both numerator and denominator: if you use y2 − y1 on top, use x2 − x1 on the bottom. Switching halfway gives the wrong sign. If the x-values are equal, run = 0, and the slope is undefined, the line is vertical.
When reading slope from a graph, use the coordinate values, not the visual steepness, a stretched or compressed axis makes a shallow line look steep. The calculator already returns the straight-line distance between your two points alongside the slope, if 2D, 3D, or latitude-longitude distance is the primary goal, the Distance Calculator offers those additional modes from the same coordinate inputs.
Slope-Intercept Form and Y-Intercept
After finding slope from two points, the calculator writes the line in slope-intercept form:
Here m is the slope and b is the y-intercept, where the line crosses the y-axis. The calculator substitutes one of your entered points into y = mx + b and solves for b automatically.
If the line is vertical (both x-values are the same), slope-intercept form does not apply and the equation is written as x = constant instead.
Point-Slope Form
Point-slope form describes a line using a known point and the slope. It is useful when you already know the slope and one point, but do not yet know the y-intercept.
Where (x1, y1) is any known point on the line and m is the slope. To convert point-slope form to slope-intercept form, expand the right side and solve for y.
Point-Slope Form Example
Problem: A line has slope 3 and passes through (2, 5). Write the equation in point-slope form, then convert to slope-intercept form.
- Point-slope form: y − 5 = 3(x − 2)
- Expand: y − 5 = 3x − 6
- Solve for y: y = 3x − 1
Answer: Point-slope form is y − 5 = 3(x − 2). Slope-intercept form is y = 3x − 1.
To use this calculator for a point-slope problem: enter the known point as (x1, y1) and any second point, or enter two points on the line if both are given, and read the line equation from the result panel.
Standard Form to Slope-Intercept Form
Standard form is written as Ax + By = C. To convert to slope-intercept form, solve for y:
The slope is −A/B and the y-intercept is C/B.
Example: Convert 3x + 2y = 10 to slope-intercept form.
- Subtract 3x from both sides: 2y = −3x + 10
- Divide by 2: y = −1.5x + 5
Answer: Slope = −1.5, y-intercept = 5. To verify, pick any two points that satisfy the equation and enter them in the calculator above.
Percent Slope and Slope Angle in Degrees
Percent slope and slope angle are two ways to express the same steepness, they are just different formats of rise over run.
For example: rise = 2, run = 10 → slope = 0.2 → percent slope = 20% → angle = arctan(0.2) ≈ 11.3°. The arctan function is the same one used to find angles in a right triangle, if you need the full set of sides, angles, and area for a right triangle rather than just the angle of a line, the Triangle Calculator solves those from any valid combination of three values.
| Slope (decimal) | Percent slope | Angle (°) | Common use |
|---|---|---|---|
| 0.01 | 1% | 0.57° | Minimum drain/gutter slope |
| 0.02 | 2% | 1.15° | Recommended driveway drainage |
| 0.083 | 8.3% | 4.76° | ADA maximum ramp slope (1:12) |
| 0.125 | 12.5% | 7.13° | Gentle roof pitch (1.5:12) |
| 0.25 | 25% | 14.04° | Typical residential roof (3:12) |
| 0.5 | 50% | 26.57° | Steep roof (6:12) |
| 1.0 | 100% | 45° | Equal rise and run |
The angle and percent slope results appear automatically in the calculator's result panel when you enter two points.
Roof Slope
Roof slope in North America is expressed as a ratio of rise to 12 inches of horizontal run, called roof pitch. A 6:12 pitch means the roof rises 6 inches for every 12 inches of run, giving a slope of 6/12 = 0.5 (50%).
How to Calculate Roof Slope
To use this calculator for roof slope: enter (0, 0) as point 1 and (12, rise) as point 2, where rise is the vertical height in the same unit as the run. The slope result is the pitch expressed as a decimal; multiply by 12 to get the standard X:12 pitch notation.
| Pitch (X:12) | Slope | Percent | Angle |
|---|---|---|---|
| 3:12 | 0.25 | 25% | 14.0° |
| 4:12 | 0.333 | 33.3% | 18.4° |
| 6:12 | 0.5 | 50% | 26.6° |
| 8:12 | 0.667 | 66.7% | 33.7° |
| 12:12 | 1.0 | 100% | 45.0° |
How to calculate roof slope in degrees: use the angle result from this calculator, or apply arctan(rise/run) directly. A 6:12 pitch converts to arctan(0.5) ≈ 26.57°.
Ramp Slope, ADA and Wheelchair Ramps
Ramp slope is rise divided by horizontal run. In the US, ADA guidelines require a maximum ramp slope of 1:12 (1 inch of rise per 12 inches of run), which equals a slope of 0.0833 or 8.33%.
To calculate ramp slope: enter the rise (vertical height) and run (horizontal length) in matching units. The slope result is the gradient; percent slope is that number times 100.
Example: A ramp rises 6 inches over 72 inches of horizontal run. Slope = 6/72 = 0.0833. Percent slope = 8.33%. This meets the ADA 1:12 maximum exactly.
Driveway, Pipe, Gutter, and Grading Slope
The same slope formula applies across every practical application. Enter horizontal run and vertical rise to get the gradient; multiply by 100 for percent slope.
Driveway Slope
Typical residential driveway slope is 1–5%. Less than 1% risks pooling water at the garage; more than 15% is generally considered too steep for safe vehicle access in wet conditions. To calculate: enter 0 and your horizontal driveway length as x-values, and 0 and the height change as y-values.
Pipe and drain slope
Drain pipes and sewer lines need enough slope to maintain self-cleaning flow velocity. A common rule of thumb for 4-inch pipe is a minimum slope of 1/8 inch per foot (about 1%). For 4-inch pipe the standard is 1/4 inch per foot (about 2%). Enter pipe length as run and vertical drop as rise, the slope result times 100 gives the percent grade.
Gutter slope
Gutters typically drain at 1/4 to 1/2 inch of drop per 10 feet of run (0.2–0.4%). Too little slope causes standing water and overflow; too much makes the gutter visually uneven. Use horizontal gutter length as run and intended drop as rise.
Grading and Grade Slope
Site grading slopes are specified as percentages. A common minimum for landscaped areas is 2% away from a building foundation. Steeper grades (5–10%) are used for berms and swales. Use horizontal distance as run and height change as rise, then multiply slope by 100 for the grade percentage.
How to Calculate Slope in Excel
In Excel or Google Sheets, use the built-in SLOPE function when you have y-values and x-values in ranges.
For only two points, you can also use the same formula as this calculator. If x1 is in A1, y1 is in B1, x2 is in A2, and y2 is in B2, use:
Worked Examples
Example 1: Find Slope From Two Points
Problem: A line passes through (1, 2) and (7, 6). Find the slope, rise, and run.
- Rise = 6 - 2 = 4.
- Run = 7 - 1 = 6.
- Slope = 4 ÷ 6 = 0.6667.
Answer: The slope is about 0.6667.
Example 2: Negative Slope
Problem: A line passes through (-2, 8) and (4, 2). Find the slope.
- Rise = 2 - 8 = -6.
- Run = 4 - (-2) = 6.
- Slope = -6 ÷ 6 = -1.
Answer: The slope is -1, so the line falls from left to right.
Example 3: Slope-Intercept Form
Problem: A line passes through (2, 5) and (6, 13). Find the slope and equation in slope-intercept form.
- Rise = 13 - 5 = 8.
- Run = 6 - 2 = 4.
- Slope = 8 / 4 = 2.
- Use y = mx + b with point (2, 5): 5 = 2(2) + b.
- b = 1, so the equation is y = 2x + 1.
Answer: The slope is 2, and the line equation is y = 2x + 1.
Example 4: Vertical Line
Problem: Find the slope through (3, 1) and (3, 9).
- Rise = 9 - 1 = 8.
- Run = 3 - 3 = 0.
- Division by zero is undefined.
Answer: The line is vertical, so the slope is undefined.
Example 5: Percent Slope for a Ramp
Problem: A ramp rises 1.5 ft over a horizontal run of 12 ft. Find the slope and percent slope.
- Slope = rise / run = 1.5 / 12 = 0.125.
- Percent slope = 0.125 × 100 = 12.5%.
Answer: The ramp has a 0.125 slope, or 12.5% slope.
Frequently Asked Questions
How do you calculate slope from two points?
m = (y2 − y1) ÷ (x2 − x1). Subtract y-coordinates for rise, subtract x-coordinates for run, divide. Points (1, 2) and (7, 6): rise = 4, run = 6, slope = 4/6 ≈ 0.667. If the line is given in slope-intercept form y = mx + b, the slope is the coefficient m directly, no calculation needed.
How do you calculate percent slope and grade?
Multiply decimal slope by 100: slope 0.08 = 8% grade. A road sign reading "8% grade" means the road rises (or falls) 8 meters for every 100 meters of horizontal distance. To convert percent back to decimal, divide by 100.
How do you calculate slope angle in degrees?
Angle = arctan(rise ÷ run). A slope of 0.5 gives arctan(0.5) ≈ 26.57°. The calculator returns this automatically in the result panel.
How do you calculate roof slope?
Rise divided by horizontal run. A roof rising 6 inches over 12 inches of run has slope = 0.5, written as 6:12 pitch. In degrees: arctan(0.5) ≈ 26.6°. To get X:12 notation from a decimal slope, multiply slope × 12.
How do you calculate ramp slope?
Rise divided by horizontal run. ADA guidelines cap wheelchair ramp slope at 1:12 (8.33%). For a ramp that rises 6 inches over 72 inches: slope = 6/72 = 0.0833, or 8.33%. Always verify against local building codes, ADA specifies additional requirements beyond the slope ratio, including landing dimensions and handrail height.
How do you calculate slope in Excel?
Use =SLOPE(known_y_values, known_x_values) for a range of data points. For just two points with x-values in column A and y-values in column B: =(B2−B1)/(A2−A1). For the y-intercept: =INTERCEPT(known_y_values, known_x_values).
What does undefined slope mean, and how is it different from zero slope?
A vertical line has undefined slope because both x-values are equal, making the run zero, division by zero is undefined. A horizontal line has zero slope because the rise is zero while run is nonzero: 0 ÷ run = 0. Horizontal = zero slope; vertical = undefined slope.
References
- Slope, Wolfram MathWorld: formal mathematical definition of slope, rise-over-run formula, and relationship to the derivative.
- Slope of a Straight Line, Math is Fun: visual explanation of positive, negative, zero, and undefined slope with worked examples.
- ADA Standards for Accessible Design, US Access Board: official source for wheelchair ramp slope requirements (1:12 maximum) and related accessibility standards.