By Tim King · Updated
Slope Calculator
Rise Over Run, Slope-Intercept Form and Percent Grade From Two Points
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Slope Calculator works
This slope calculator takes two points and finds the slope of the line through them, as a decimal and a fraction. It then writes the equation in slope-intercept and point-slope form, and gives the angle, the percent grade and the slope of a perpendicular line, all with the working shown.
Slope measures how steep a line is: how far it rises for each step to the right. A positive slope climbs, a negative slope falls, zero is flat and a vertical line has no slope at all because the run is zero. Engineers write the same number as a percent grade or as an angle.
How the slope calculator works
The formula is m = (y₂ − y₁) ÷ (x₂ − x₁), rise over run. With m known, the intercept is b = y₁ − m x₁, giving y = mx + b. The angle is arctan(m), the grade is m × 100 and the perpendicular slope is −1 ÷ m.
First example. Through (2, 3) and (8, 11) the rise is 8 and the run is 6, so m = 8/6 = 4/3. Then b = 3 − (4/3) × 2 = 1/3, so y = 1.333x + 0.333, at an angle of 53.13°.
Second example. Through (−1, 4) and (3, −2), m = −6 ÷ 4 = −1.5 and b = 2.5, so y = −1.5x + 2.5. The perpendicular slope is 2/3.
How many degrees is a 1 in 12 wheelchair ramp? A slope of 1/12 is 0.0833, a grade of 8.3% and an angle of arctan(0.0833) ≈ 4.76°.
Slope as rise over run, decimal, percent grade and angle for 24 common slopes
| Rise : run | Slope m | Grade | Angle |
|---|---|---|---|
| 1 : 20 | 0.0500 | 5.0% | 2.86° |
| 1 : 12 | 0.0833 | 8.3% | 4.76° |
| 1 : 10 | 0.1000 | 10.0% | 5.71° |
| 1 : 8 | 0.1250 | 12.5% | 7.13° |
| 1 : 6 | 0.1667 | 16.7% | 9.46° |
| 1 : 5 | 0.2000 | 20.0% | 11.31° |
| 1 : 4 | 0.2500 | 25.0% | 14.04° |
| 1 : 3 | 0.3333 | 33.3% | 18.43° |
| 1 : 2 | 0.5000 | 50.0% | 26.57° |
| 2 : 3 | 0.6667 | 66.7% | 33.69° |
| 3 : 4 | 0.7500 | 75.0% | 36.87° |
| 1 : 1 | 1.0000 | 100.0% | 45.00° |
| 4 : 3 | 1.3333 | 133.3% | 53.13° |
| 3 : 2 | 1.5000 | 150.0% | 56.31° |
| 2 : 1 | 2.0000 | 200.0% | 63.43° |
| 5 : 2 | 2.5000 | 250.0% | 68.20° |
| 3 : 1 | 3.0000 | 300.0% | 71.57° |
| 4 : 1 | 4.0000 | 400.0% | 75.96° |
| 5 : 1 | 5.0000 | 500.0% | 78.69° |
| 6 : 1 | 6.0000 | 600.0% | 80.54° |
| 8 : 1 | 8.0000 | 800.0% | 82.87° |
| 10 : 1 | 10.0000 | 1000.0% | 84.29° |
| -1 : 2 | -0.5000 | -50.0% | -26.57° |
| -1 : 1 | -1.0000 | -100.0% | -45.00° |
Tips
- Grade is not angle. A 100% grade is 45°, not vertical.
- Order of points does not matter, as long as you subtract both coordinates in the same order.
- Parallel lines share a slope; perpendicular slopes multiply to −1.
FAQ
How do you find the slope from two points?
Subtract the y values to get the rise and the x values to get the run, then divide rise by run. For (1, 2) and (4, 11), the rise is 9 and the run is 3, so the slope is 3. Keep the same order in both subtractions or the sign will come out wrong.
What does an undefined slope mean?
It means the line is vertical. Both points share the same x value, so the run is zero, and dividing by zero has no answer. The equation of such a line is x = a constant, and the calculator reports it that way, with an angle of 90°.
How do you convert slope to percent grade?
Multiply the slope by 100. A slope of 0.06 is a 6% grade, meaning the ground rises 6 units for every 100 units across. Road signs and accessibility rules usually quote grade, while maths classes tend to use the slope as a fraction or decimal.
What is the slope of a perpendicular line?
It is the negative reciprocal: flip the fraction and change the sign. A line with slope 2/3 has a perpendicular slope of −3/2. Multiply the two and you always get −1, which is a quick check. A horizontal line's perpendicular is vertical, with an undefined slope.
See also: all Algebra and Geometry tools, Arithmetic, Number Theory, Statistics, Trigonometry and Calculus.
Related tools
Distance Formula Calculator
Distance between two points, with the exact root and working.
Midpoint Calculator
Midpoint of a segment, or the missing endpoint from the midpoint.
Right Triangle Calculator
Every side and angle of a right triangle from any two values.
Triangle Calculator
Every side, angle and the area of a triangle from three known parts.
Linear Regression Calculator
Least-squares line of best fit, R² and predictions.