Slope Calculator
Choose a calculation mode below, enter the known values, and the calculator will find the slope along with the angle, percentage grade, and a full step-by-step solution.
What Is Slope?
Slope is a number that describes how steep a line is and in which direction it leans. It tells you how much the vertical position changes for every one unit of horizontal movement. A slope of 2 means the line rises 2 units for every 1 unit moved to the right. A slope of -1 means the line falls 1 unit for every 1 unit moved to the right. A slope of 0 means the line is perfectly flat.
The Slope Formula
When two points on a line are known, slope is calculated by dividing the difference in the y-coordinates by the difference in the x-coordinates.
Worked Examples
| Points (0, 0) and (4, 8) | Rise = 8 − 0 = 8. Run = 4 − 0 = 4. Slope = 8 ÷ 4 = 2. The line rises steeply, going up 2 units for every 1 unit across. Angle = 63.43 degrees. Grade = 200%. |
| Points (1, 5) and (4, 2) | Rise = 2 − 5 = −3. Run = 4 − 1 = 3. Slope = −3 ÷ 3 = −1. A perfectly diagonal descent. Every step right, the line drops one unit. Angle = −45 degrees. Grade = −100%. |
| Points (2, 3) and (8, 3) | Rise = 3 − 3 = 0. Run = 8 − 2 = 6. Slope = 0 ÷ 6 = 0. The line is completely flat. Both points share the same y-value so there is no vertical movement at all. |
| Rise = 1, Run = 4 | Slope = 1 ÷ 4 = 0.25. A gentle incline. Roads with a 1-in-4 gradient are considered steep for vehicles. Angle = 14.04 degrees. Grade = 25%. |
| Angle = 45 degrees | Slope = tan(45) = 1. A 45-degree line rises exactly as fast as it travels forward. Grade = 100%. This is the steepest practical slope for most wheeled vehicles. |
| Percent grade = 5% | Slope = 5 ÷ 100 = 0.05. Many road standards allow a maximum grade of 5% to 8% on highways. Angle = 2.86 degrees. A gentle but noticeable incline when walking or cycling. |
Slope, Angle, and Percent Grade
Slope, angle, and percent grade all describe the same steepness in different units. This calculator converts between all three automatically so you always have the full picture. Slope is a pure number with no unit. Angle is expressed in degrees and is calculated using the arctangent of the slope. Percent grade is simply the slope multiplied by 100 and is the standard way road and rail engineers describe gradients.
| Slope from angle | Slope = tan(angle in degrees) |
| Angle from slope | Angle = arctan(slope) converted to degrees |
| Percent grade | Grade = slope × 100 |
| Slope from grade | Slope = percent grade ÷ 100 |
Positive, Negative, Zero, and Undefined Slope
A positive slope means the line rises from left to right. A negative slope means the line falls from left to right. A zero slope is a horizontal flat line. An undefined slope occurs when the run is zero, meaning the line is perfectly vertical. A vertical line does not have a slope value because division by zero is not defined in mathematics.
Where Slope Is Used
In road and highway engineering, the gradient of a road is expressed as a percent grade. A road climbing 5 meters for every 100 meters of horizontal distance has a grade of 5%. Highway design standards set maximum grades depending on road type and speed limit. Mountain roads can legally reach 10% to 12% grade in some countries, while motorways are typically kept below 4% to 6% to maintain safe driving speeds and fuel efficiency for heavy vehicles.
In architecture and building design, roof pitch is described as a ratio of rise to run, which is directly equivalent to slope. A roof with a 4-in-12 pitch rises 4 inches for every 12 inches of horizontal span, giving a slope of 4 divided by 12 which equals 0.333. Steeper roofs shed water and snow more effectively but require more material and are more expensive to build and maintain. Ramp gradients for wheelchair access are regulated in most countries to a maximum of 1 in 12, which is a slope of 0.0833 or about 8.33%.
In mathematics and physics, slope appears in the equations of straight lines, velocity-time graphs, and linear relationships between two variables. The slope of a velocity-time graph gives acceleration. The slope of a cost function gives the marginal cost of producing one more unit. In statistics, the slope of a regression line tells you how much the dependent variable changes for each unit increase in the independent variable.
In geography, hillside gradients and river channel gradients are expressed as slope ratios. A river that drops 10 meters in elevation over a horizontal distance of 2000 meters has a channel gradient of 10 divided by 2000, which equals 0.005 or 0.5%. Steeper gradients produce faster water flow and greater erosive power, which is why river engineers and hydrologists calculate slope when designing flood control works and predicting sediment movement.
Quick Reference: Common Slopes
| Flat surface | Slope = 0, Angle = 0 degrees, Grade = 0% |
| Wheelchair ramp (max) | Slope = 0.0833, Angle = 4.76 degrees, Grade = 8.33% |
| Typical road grade | Slope = 0.05, Angle = 2.86 degrees, Grade = 5% |
| Steep road | Slope = 0.1, Angle = 5.71 degrees, Grade = 10% |
| Typical roof pitch | Slope = 0.333, Angle = 18.43 degrees, Grade = 33.3% |
| Staircase | Slope = 0.75, Angle = 36.87 degrees, Grade = 75% |
| 45-degree line | Slope = 1, Angle = 45 degrees, Grade = 100% |
| Vertical line | Slope = undefined, Angle = 90 degrees, Grade = undefined |