Use this free slope calculator to find the slope of a line from two points. It also shows the angle, the percent grade, the distance and midpoint between the points, and the equation of the line. You can convert between slope, angle, grade, and ratio such as 1:12. Step-by-step working is included. No signup needed.
From two points:
Slope measures how steep a line is. It tells you how much the line goes up or down (the rise) for each step across (the run).
Slope = Rise ÷ Run = (y₂ − y₁) ÷ (x₂ − x₁)
It is usually written as m.
| Slope | What the line looks like |
|---|---|
| Positive (m > 0) | Goes up from left to right |
| Negative (m < 0) | Goes down from left to right |
| Zero (m = 0) | Horizontal, flat |
| Undefined | Vertical, since the run is 0 |
A larger absolute value of m means a steeper line.
Slope: m = (y₂ − y₁) ÷ (x₂ − x₁)
Angle from the horizontal: θ = arctan(m)
Slope from an angle: m = tan(θ)
Percent grade: Grade = m × 100%
Distance between the points: d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Midpoint: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
Slope-intercept form: y = mx + b, where b = y₁ − m × x₁
Point-slope form: y − y₁ = m(x − x₁)
Standard form: Ax + By = C, with slope −A ÷ B
Parallel lines: have the same slope
Perpendicular lines: have slopes whose product is −1, so m₂ = −1 ÷ m₁
All answers are rounded for display.
Points (1, 2) and (4, 8).
Points (−2, 5) and (3, −5).
Points (2, 3) and (6, 3).
Points (4, 1) and (4, 7).
A vertical line has no slope-intercept form.
Points (0, 0) and (5, 3).
Points (−3, −2) and (1, 4).
Points (1, 3) and (5, −1).
y = 3x − 7 has slope 3 and y-intercept −7.2x + 4y = 8: solve for y: y = −0.5x + 2, so the slope is −0.5. You can also use −A ÷ B = −2 ÷ 4 = −0.5.A line has slope 3 and passes through (2, −1).
A line with slope 2 passes through (1, 3). Find y when x = 5.
Take the line y = 2x + 3 (slope 2).
A road rises 6 m over a horizontal distance of 100 m.
A hill rises 150 m over a horizontal distance of 2,000 m.
A ramp with a ratio of 1:12 rises 1 unit for every 12 units of run.
A 1:12 slope is a common maximum for accessible ramps in some regions, such as in U.S. guidance. Local rules differ, so check your own building code.
Roof pitch is often written as rise per 12 units of run.
| Percent grade | Slope (decimal) | Angle |
|---|---|---|
| 5% | 0.05 | 2.86° |
| 8% | 0.08 | 4.57° |
| 10% | 0.10 | 5.71° |
| 15% | 0.15 | 8.53° |
| 25% | 0.25 | 14.04° |
| 50% | 0.50 | 26.57° |
| 100% | 1.00 | 45° |
Percent grade and angle are not the same. A 100% grade is a 45° line, not a 90° line. A vertical line has an infinite grade.
The slope is the same for any two points on the same straight line.
Divide the change in y by the change in x between two points: m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (4, 8), the slope is (8 − 2) ÷ (4 − 1) = 2.
m = (y₂ − y₁) ÷ (x₂ − x₁), also written as rise over run.
The line goes down as you move from left to right. For example, the slope between (−2, 5) and (3, −5) is −2.
Zero. For example, the line through (2, 3) and (6, 3) has slope 0, and its equation is y = 3.
It is undefined, since the run is 0 and you cannot divide by zero. The equation of the line is x = a number, such as x = 4.
Find the slope m, then find b = y₁ − m × x₁, and write y = mx + b. For (1, 2) and (4, 8), the equation is y = 2x.
Use the arctangent: angle = arctan(m). A slope of 1 is 45°, and a slope of 0.6 is about 30.96°.
Multiply the slope by 100. A slope of 0.06 is a 6% grade.
Percent grade is rise ÷ run × 100, while degrees measure the angle. A 100% grade is 45°, and a 10% grade is about 5.71°.
Parallel lines have the same slope. Perpendicular lines have slopes that multiply to −1, so the perpendicular slope of 2 is −1/2.
If the equation is y = mx + b, the slope is m. For Ax + By = C, the slope is −A ÷ B.
Yes. It is free, with no registration and no limits.
It uses the standard formulas and the numbers you enter. Fractions are exact, and decimals and angles are rounded for display.
A few of the most-used tools in each hub.
This calculator is for general and educational use. Results are rounded for display. For building, ramps, roofs, roads, drainage, or any work that affects safety, check your local building codes and consult a qualified professional. Follow your teacher’s rules on the form of the answer.