Slope Calculator
How Steep, and Which Way
Slope quantifies how much a line rises or falls for every unit it moves horizontally, and its sign carries just as much information as its size — positive means the line climbs left to right, negative means it descends, and zero means it's perfectly flat. This calculator computes slope from any two points and correctly flags the special case where the line is vertical and slope is undefined.
The Formula
m = (y2−y1) / (x2−x1)
When x2 equals x1, the denominator is zero and the line is vertical — slope is undefined in that case rather than infinite, since division by zero has no defined result.
Where Slope Is Used
- Road and ramp grades — construction grades are expressed as slope, often converted to a percentage.
- Linear regression and trend analysis — the slope of a best-fit line quantifies the rate of change between two variables.
- Roof pitch — roofing slope determines drainage and material requirements.
- Physics — the slope of a position-vs-time graph is velocity; the slope of a velocity-vs-time graph is acceleration.
| Point 1 | Point 2 | Slope |
|---|---|---|
| (1, 2) | (4, 8) | 2 |
| (0, 5) | (10, 0) | −0.5 |
How to Use This Calculator
- Enter X1 and Y1 for the first point.
- Enter X2 and Y2 for the second point.
- Select Calculate to see the slope, or a note that the line is vertical if X1 equals X2.
Related Calculations
Need where this same line crosses the axes? See the Y-Intercept Calculator and the X-Intercept Calculator.