Quick Answer
Slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁). Between the points (1, 2) and (4, 8), the rise is 6 and the run is 3, so the slope is 2. The line equation is y = 2x + 0.
Embed this calculator
Adjust the size if needed, then copy the code below into your page or blog. The calculator will load in an iframe and stay updated automatically.
Table of Contents
How This Slope Calculator Works
Slope measures how steep a line is. Enter two points, and the calculator finds the slope, the line equation in y = mx + b form, the angle, the distance between the points, and the midpoint.
Quick explanation: m = rise ÷ run.
- Positive slope: the line rises from left to right.
- Negative slope: the line falls from left to right.
- Zero: a flat line. A vertical line has an undefined slope.
How to Use the Slope Calculator
- Enter the x and y values of the first point.
- Enter the x and y values of the second point.
- Press Calculate.
- Read the slope, the line equation, the angle, the distance and the midpoint.
- Check the steps table to follow the working.
Core Formulas
- Slope: m = (y₂ − y₁) ÷ (x₂ − x₁)
- Y-intercept: b = y₁ − m × x₁
- Angle: arctan(m)
- Distance: √((x₂ − x₁)² + (y₂ − y₁)²)
- Midpoint: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
Key Terms
- Slope (m): how steep a line is: the change in y divided by the change in x.
- Rise: the vertical change between two points.
- Run: the horizontal change between two points.
- Y-intercept (b): the point where the line crosses the y-axis.
- Slope-intercept form: a line written as y = mx + b.
- Midpoint: the point exactly halfway between two points.
- Parallel and perpendicular lines: parallel lines have equal slopes. Perpendicular slopes multiply to −1.
Worked Example
Find the slope between (0, 0) and (2, −1).
- Rise = −1 − 0 = −1
- Run = 2 − 0 = 2
- Slope = −1 ÷ 2 = −0.5
- Equation: y = −0.5x + 0
Real-Life Examples
- Road grade: a road that climbs 30 m over 500 m has a slope of 0.06, a 6% grade, or an angle of about 3.43°.
- Wheelchair ramp: US ADA guidance limits most ramps to a slope of 1:12. That is about 8.33%, or 4.76°.
- Roof pitch: a 6/12 roof rises 6 in for every 12 in across, a slope of 0.5 or about 26.57°.
- Rate of change: if a phone plan costs $40 for 2 GB and $55 for 5 GB, the slope is (55 − 40) ÷ (5 − 2) = $5 per GB.
Slope vs Grade vs Angle
- Slope: rise ÷ run, as a number such as 0.25.
- Grade: slope × 100, as a percentage such as 25%. Used for roads and paths.
- Angle: arctan(slope), in degrees, such as 14.04°.
- Pitch: rise per 12 units of run, such as 3/12. Used for roofs in the US.
Slope, Grade, Angle and Pitch
| Slope | Grade | Angle | Roof pitch |
|---|---|---|---|
| 0.05 | 5.00% | 2.86° | 0.6/12 |
| 0.0833 | 8.33% | 4.76° | 1/12 |
| 0.1 | 10.00% | 5.71° | 1.2/12 |
| 0.25 | 25.00% | 14.04° | 3/12 |
| 0.5 | 50.00% | 26.57° | 6/12 |
| 0.75 | 75.00% | 36.87° | 9/12 |
| 1 | 100.00% | 45.00° | 12/12 |
| 2 | 200.00% | 63.43° | 24/12 |
Common Mistakes
- Mixing the order: subtract x and y in the same point order.
- Dropping a negative: take care when subtracting a negative number.
- Dividing by zero: if both x values match, the line is vertical.
- Swapping rise and run: slope is change in y over change in x, not the other way round.
- Confusing slope with angle: a slope of 1 is 45°, but a slope of 2 is not 90°.
Frequently Asked Questions
Multiply the slope by 100. A slope of 0.06 is a 6% grade.
It rises 6 units for every 12 across, so the slope is 0.5 and the angle is about 26.57°.
It is 0, because the y value stays the same as x changes.
It is the negative reciprocal. If one line has a slope of 2, a line at right angles to it has a slope of −1/2.
Yes. A slope of 2/3 means the line rises 2 units for every 3 units across. It is the same as about 0.667.
Rearrange it into y = mx + b. The number in front of x is the slope.
Subtract the y values, subtract the x values in the same order, then divide: m = (y₂ − y₁) ÷ (x₂ − x₁).
It means the line is flat, because y does not change.
It is the slope of a vertical line. The run is 0, and you cannot divide by 0.
It is the slope-intercept form of a line. m is the slope, and b is where the line crosses the y-axis.
Take the arctangent of the slope. A slope of 1 is an angle of 45°.
References & Sources
| Source | Used For | Link |
|---|---|---|
| Wikipedia, Slope | Definition and formula for slope. | https://en.wikipedia.org/wiki/Slope |
| Wikipedia, Linear equation | Slope-intercept form. | https://en.wikipedia.org/wiki/Linear_equation |