Slope Calculator
Type two points to find the slope of the line through them, its equation in slope-intercept, point-slope and standard form, the angle of inclination, intercepts, percent grade and the distance between the points, all shown on a graph.
How to use the Slope Calculator
- Enter point 1 (x₁, y₁).
- Enter point 2 (x₂, y₂). Negative numbers and decimals are fine.
- Read the slope and the line equation instantly.
- Look at the graph to see the rise, run and y-intercept.
- Copy the results or download more points on the line as CSV.
Slope and line formulas
| What | Formula | Example: (1, 2) and (5, 8) |
|---|---|---|
| Slope | m = (y₂ − y₁) ÷ (x₂ − x₁) | 6 ÷ 4 = 1.5 |
| y-intercept | b = y₁ − m·x₁ | 2 − 1.5 × 1 = 0.5 |
| Slope-intercept form | y = mx + b | y = 1.5x + 0.5 |
| Point-slope form | y − y₁ = m(x − x₁) | y − 2 = 1.5(x − 1) |
| Standard form | Ax + By = C | 3x − 2y = −1 |
| Angle of inclination | θ = arctan(m) | arctan(1.5) ≈ 56.31° |
| Distance | d = √((x₂ − x₁)² + (y₂ − y₁)²) | √52 = 2√13 ≈ 7.2111 |
Slope, angle and grade
| Slope (m) | Angle | Grade | Ratio (rise : run) |
|---|---|---|---|
| 0.01 | 0.57° | 1% | 1 : 100 |
| 0.0833 | 4.76° | 8.33% | 1 : 12 |
| 0.1 | 5.71° | 10% | 1 : 10 |
| 0.25 | 14.04° | 25% | 1 : 4 |
| 0.5 | 26.57° | 50% | 1 : 2 |
| 0.5774 | 30° | 57.74% | 1 : 1.732 |
| 1 | 45° | 100% | 1 : 1 |
| 1.7321 | 60° | 173.21% | 1.732 : 1 |
A 1 : 12 slope (about 8.33%) is the maximum running slope commonly specified for wheelchair ramps; road grades are usually given in percent and roof pitch as rise per 12 units of run.
Frequently asked questions
What is the slope formula?
Slope m = (y₂ − y₁) ÷ (x₂ − x₁), often called rise over run. For the points (1, 2) and (5, 8) the rise is 6, the run is 4 and the slope is 6 ÷ 4 = 1.5.
How do I find the equation of a line from two points?
Find the slope m, then the y-intercept b = y₁ − m·x₁ and write y = mx + b. For (1, 2) and (5, 8): m = 1.5, b = 2 − 1.5 = 0.5, so the line is y = 1.5x + 0.5.
What does a negative, zero or undefined slope mean?
A positive slope rises from left to right, a negative slope falls, a zero slope is a horizontal line (y = constant) and an undefined slope is a vertical line (x = constant), because the run is zero and you cannot divide by zero.
How do I convert slope to an angle or percent grade?
The angle of inclination is arctan(m): a slope of 1 is 45°. Percent grade is the slope × 100: a slope of 0.05 is a 5% grade, which rises 5 units for every 100 units of horizontal distance.
What is the slope of a perpendicular line?
It is the negative reciprocal, −1 ÷ m. Two non-vertical lines are perpendicular when their slopes multiply to −1, e.g. 2 and −0.5. Parallel lines have equal slopes.
Does it matter which point is first?
No. Swapping the points changes the sign of both the rise and the run, so their ratio, the slope, stays the same. The distance and the equation are also unchanged.