Slope Calculator
Enter two points to get the slope, the equation of the line, the y-intercept, its angle and the distance between points.
Updated November 2026 · How we build calculators
Result
Your result will appear here
Enter your numbers, then press Calculate.
How the Slope Calculator works
Slope is the change in y divided by the change in x. The intercept comes from b = y₁ − m × x₁. A vertical line has an undefined slope.
Formula used
m = (y₂ − y₁) ÷ (x₂ − x₁)
y = mx + b
Angle = arctan(m)
Step-by-step example
Using the default values in the calculator above:
- x₁: 1
- y₁: 2
- x₂: 5
- y₂: 10
The calculator then applies the formula above and returns:
- Slope (m): 2 (y = 2x + 0)
- Rise (Δy) / Run (Δx): 8 / 4
- y-intercept (b): 0
- Angle of incline: 63.4349°
- Distance between points: 8.9442719
- Midpoint: (3, 6)
What-if scenarios
Each table changes one input and keeps everything else at the calculator's default values.
| x₁ | Slope (m) |
|---|---|
| 0.5 | 1.7777778 |
| 0.75 | 1.8823529 |
| 1 (default) | 2 |
| 1.5 | 2.2857143 |
| 2 | 2.6666667 |
| y₁ | Slope (m) |
|---|---|
| 1 | 2.25 |
| 1.5 | 2.125 |
| 2 (default) | 2 |
| 3 | 1.75 |
| 4 | 1.5 |
Slope (m) for different x₁ and y₁
Every other input is left at its default value.
| x₁ | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| 0.5 | 2 | 1.7777778 | 1.5555556 | 1.3333333 |
| 0.75 | 2.1176471 | 1.8823529 | 1.6470588 | 1.4117647 |
| 1 | 2.25 | 2 | 1.75 | 1.5 |
| 1.5 | 2.5714286 | 2.2857143 | 2 | 1.7142857 |
| 2 | 3 | 2.6666667 | 2.3333333 | 2 |
Tips and background
A roof pitch of 6/12 has a slope of 0.5. Slope as a percentage is slope × 100, used for roads and wheelchair ramps.
Slope = rise over run
Slope m = (y₂ − y₁) ÷ (x₂ − x₁). Between (1, 2) and (5, 10) the rise is 8 and the run is 4, so m = 2. The line is y = 2x, with intercept 0. A horizontal line has slope 0 and a vertical line has an undefined slope.
Slope in everyday life
Roads and ramps use slope as a percentage (slope × 100); roofs use pitch such as 6/12 (slope 0.5). In the US, an ADA ramp is limited to a 1:12 slope. See the stair calculator and roofing calculator for construction uses, or find lengths with the distance calculator.
What do positive, negative and zero slopes look like?
| Points | Slope | Line |
|---|---|---|
| (0, 0) and (12, 1) | about 0.0833 | Rises gently |
| (2, 5) and (6, 5) | 0 | Flat |
| (1, 7) and (3, 1) | -3 | Falls steeply |
| (3, 1) and (3, 9) | undefined | Vertical, x = 3 |
The first line rises 1 unit over 12, an angle of about 4.76 degrees.
How do slope, grade and angle differ?
Slope is rise divided by run. Grade writes the same number as a percentage, so a slope of 0.0833 is about an 8.3% grade. The angle is a third measure and is not proportional to either: a slope of 1, or 100% grade, is 45 degrees. Use the same units for rise and run. For ramps, roofs and stairs, local building and accessibility rules set the limits, so check them before building.
Common mistakes to avoid with the Slope Calculator
- Subtracting the coordinates in different orders for rise and run.
- Treating a vertical line's slope as zero.
- Mixing up slope with the angle in degrees.
Frequently asked questions
What does slope mean?
How steeply a line rises or falls: rise over run.
What is the slope of a horizontal line?
Zero.
How do I find a perpendicular slope?
Take the negative reciprocal: −1/m.
How do I find the equation of a line from two points?
Find the slope, then use y = mx + b, solving b with one of the points.
What is a perpendicular slope?
The negative reciprocal: if m = 2, the perpendicular slope is −1/2.