Slope Calculator
Type two points, or drag them on the grid…
Type two points, or drag them on the grid, to get the slope as a fraction and a decimal, the equation of the line through them and its angle.
ExampleSlope (m)
3/4
That is 0.75: up 3 for every 4 across. The line is y = (3/4)x + 5/4.
Type your own points, or drag them.
Drag either point; it snaps to the grid every half unit.
- Line
- y = (3/4)x + 5/4
- Angle with the x-axis
- 36.87°
- Perpendicular slope
- −4/3
How this works: 5 sources,
How this works
Method
Slope measures steepness as rise over run: how far a line goes up for each step to the right. Between (x₁, y₁) and (x₂, y₂) it is m = (y₂ − y₁) ÷ (x₂ − x₁). From (−2, 1) to (4, 4) the rise is 3 and the run is 6, so the slope is 3/6 = 1/2: up one for every two across. Full method
Sources
How it’s tested
2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Privacy
On your device. Nothing you enter or open leaves this browser. About privacy labels
Changes
- First published: 13 shapes drawn to scale with handles, exact answers in π, litres and gallons, and slope, distance, midpoint, arc and polygon pages.
How to find the slope between two points
Slope measures steepness as rise over run: how far a line goes up for each step to the right. Between (x₁, y₁) and (x₂, y₂) it is m = (y₂ − y₁) ÷ (x₂ − x₁). From (−2, 1) to (4, 4) the rise is 3 and the run is 6, so the slope is 3/6 = 1/2: up one for every two across.
With the slope, the equation of the line follows from y = mx + b: put in one point and solve for b. Here 1 = ½ × (−2) + b gives b = 2, so the line is y = (1/2)x + 2. A positive slope climbs to the right, a negative one falls, 0 is flat and a vertical line has no slope at all, because the run is 0.
In everyday life slope is often a percentage or a ratio. A road grade of 8% rises 8 m for every 100 m, a slope of 0.08. US accessibility rules limit a wheelchair ramp to 1:12, one unit of rise for every 12 of run: a slope of about 0.083, or 8.3%, at an angle of about 4.8°.
m = (y₂ − y₁) ÷ (x₂ − x₁) · y = mx + b · angle = arctan(m)
- Under the 2010 ADA Standards, a ramp’s running slope must not be steeper than 1:12. Source: 2010 ADA Standards for Accessible Design, 405.2 Slope (US Access Board).
- Two lines are perpendicular when their slopes multiply to −1 (neither vertical), so the perpendicular to a slope of 1/2 has slope −2. Source: Wikipedia, Slope.
Slopes as ratios, grades and angles
The same steepness written as rise : run, a slope, a percent grade and an angle from the horizontal.
| Rise : run | Slope | Grade | Angle |
|---|---|---|---|
| 1 : 20 | 1/20 = 0.05 | 5% | 2.86° |
| 1 : 12 | 1/12 ≈ 0.083 | 8.3% | 4.76° |
| 1 : 10 | 1/10 = 0.1 | 10% | 5.71° |
| 1 : 8 | 1/8 = 0.125 | 12.5% | 7.13° |
| 1 : 5 | 1/5 = 0.2 | 20% | 11.31° |
| 1 : 4 | 1/4 = 0.25 | 25% | 14.04° |
| 1 : 3 | 1/3 ≈ 0.333 | 33.3% | 18.43° |
| 1 : 2 | 1/2 = 0.5 | 50% | 26.57° |
| 3 : 4 | 3/4 = 0.75 | 75% | 36.87° |
| 1 : 1 | 1 | 100% | 45° |
Show all 14 rowsShow fewer
| 4 : 3 | 4/3 ≈ 1.333 | 133.3% | 53.13° |
| 2 : 1 | 2 | 200% | 63.43° |
| 3 : 1 | 3 | 300% | 71.57° |
| 10 : 1 | 10 | 1000% | 84.29° |
Common questions
Does it matter which point is first?
No. Swapping the points flips the sign of both the rise and the run, and the two signs cancel: (4 − 1) ÷ (4 − (−2)) and (1 − 4) ÷ (−2 − 4) are both 1/2.
What is the slope of a vertical line?
It is undefined. The run is 0 and you can’t divide by 0. The line’s equation is x = a number instead of y = mx + b.
How do I turn a slope into an angle?
Take the arctangent: a slope of 1 is arctan(1) = 45°, a slope of 1/2 about 26.57°. A 100% grade is 45°, not vertical.