Slope Calculator – From Two Points, Rise/Run, Angle, or Grade
Compute the slope of a line from two points, rise and run, angle in degrees, or percent grade. Get slope \(m\), angle, grade and a quick interpretation (positive, negative, horizontal, or vertical).
1. Slope calculator
Choose how you want to specify the line. The tool converts everything into the slope \(m\) and then reports the angle and grade.
Slope and ratio
–
Angle and grade
–
What is the slope of a line?
In analytic geometry, the slope of a non-vertical line is the ratio between the vertical change and the horizontal change. It tells you how many units the line goes up or down when you move one unit to the right.
A positive slope means the line rises as you move to the right. A negative slope means it falls. A slope of zero corresponds to a horizontal line, while a vertical line has an undefined (infinite) slope because the run is zero.
Relationships between slope, angle and percent grade
If a line makes an angle \(\theta\) with the positive x-axis, measured in degrees, the slope and θ are related by
In civil engineering and road design it is common to describe slopes as percent grade:
Sign and magnitude of the slope
- Sign: determines whether the line is increasing (positive), decreasing (negative), horizontal (zero), or vertical (undefined).
- Magnitude: \(|m|\) measures how steep the line is. Large \(|m|\) means a steep line, small \(|m|\) means a gentle slope.
For many applications, it is useful to express the slope as a ratio such as “1:4” meaning 1 unit of rise for 4 units of run. This calculator reports both the decimal slope and a simplified rise:run ratio when possible.
FAQ – Slope and grade
Can a vertical line have a slope?
A vertical line has an undefined slope because the run (change in x) is zero. In the formula \(m = (y_2 - y_1) / (x_2 - x_1)\) the denominator would be zero, which cannot be represented by a finite real number. The calculator detects this case and labels the slope as vertical/undefined.
What is a gentle vs a steep slope?
There is no universal threshold, but in many practical contexts slopes with an absolute value less than about 0.05 (5%) are considered gentle, between 5–10% are moderate, and above 10% are steep. For roads and ramps there are often regulatory limits on maximum grades depending on usage and safety requirements.
How do I get the slope from the equation of a line?
If the equation is in slope–intercept form \(y = mx + b\), the coefficient of \(x\) is directly the slope. If the equation is in standard form \(Ax + By + C = 0\) with \(B \neq 0\), you can rearrange to \(y = -(A/B)x - C/B\), so the slope is \(-A/B\).
Can this calculator be used for incline ramps and roofs?
Yes. If you know the vertical rise and horizontal run of a ramp, stair, or roof, you can use the “Rise and run” mode to compute both the slope and the percent grade. This is useful for checking design guidelines or code requirements related to accessibility and safety.