Slope Calculator
Test cases replayed : 2 of 2 match · Methodology · No outside source listed
Enter two points to get the slope, the line equation's intercept, the distance and the midpoint.
Result
Slope m (rise ÷ run)
y-intercept b (y = mx + b)
- Distance between the points
- Midpoint x
- Midpoint y
- Angle of the line (degrees from the x-axis)
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
How this calculator works
Slope m = (y₂ − y₁) ÷ (x₂ − x₁); intercept b = y₁ − m × x₁. Distance = √((x₂ − x₁)² + (y₂ − y₁)²); midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2).
A vertical line (x₁ = x₂) has an undefined slope, shown as a dash.
The formula
| Symbol | Meaning |
|---|---|
| x₁ | |
| y₁ | |
| x₂ | |
| y₂ | |
| Slope m (rise ÷ run) |
Worked example
| x₁ | 1 |
|---|---|
| y₁ | 2 |
| x₂ | 4 |
| y₂ | 8 |
| y-intercept b (y = mx + b) | 0 |
|---|---|
| Distance between the points | 6.7082 |
| Midpoint x | 2.5 |
| Midpoint y | 5 |
| Angle of the line (degrees from the x-axis) | 63.4349 |
Slope m (rise ÷ run) 2
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
How do you find slope from two points?
Divide the change in y by the change in x. From (1, 2) to (4, 8): (8 − 2) ÷ (4 − 1) = 2.
What does a negative slope mean?
The line goes down from left to right.