Slope & Grade Calculator
Convert rise and run into slope, percent grade, angle in degrees, and a 1:N ratio — for ramps, roofs, roads, and stairs.
Use the same units for both inputs (in/ft/cm/m). The slope ratio is unitless.
Formula: slope = rise / run · grade = slope × 100 · angle = arctan(rise / run)
Instantly find the slope, distance, midpoint, and equation of a straight line connecting any two points. This calculator handles the math for you, providing the 'rise over run,' angle of inclination, and the complete line equation y = mx + b for your coordinates.
How to Calculate Slope: The 'Rise Over Run' Formula
The slope of a line is a measure of its steepness and direction. It's calculated using a simple formula often referred to as 'rise over run.' The formula is expressed as m = (y2 - y1) / (x2 - x1), where 'm' stands for slope and (x1, y1) and (x2, y2) are two distinct points on the line. The 'rise' is the vertical change between the two points (the difference in their y-coordinates), while the 'run' is the horizontal change (the difference in their x-coordinates). The resulting value 'm' gives a single number that quantifies the line's slant.
The value of the slope tells a story. A positive slope indicates the line moves upward from left to right. A negative slope means the line moves downward from left to right. A slope of zero signifies a perfectly horizontal line, as there is no 'rise.' A larger absolute value of 'm' means a steeper line; for example, a slope of 4 is much steeper than a slope of 0.5. Conversely, an 'undefined' slope occurs when the 'run' is zero, which means the line is perfectly vertical. This calculator correctly interprets and handles all these cases.
A Step-by-Step Calculation Example
To see the formulas in action, let's work through a complete example. Imagine you have two points on a graph: Point 1 is located at (x1, y1) = (2, 3), and Point 2 is at (x2, y2) = (6, 11). We will use these two coordinates to find the slope (m), the equation of the line (y = mx + b), the physical distance between the two points, and the midpoint of the line segment that connects them. These values fully describe the geometric relationship between our two initial points.
First, we calculate the slope using the rise-over-run formula: m = (y2 - y1) / (x2 - x1). Plugging in our numbers, we get m = (11 - 3) / (6 - 2). This simplifies to m = 8 / 4, which gives us a final slope of m = 2. This positive result tells us the line is rising as we move from left to right. Specifically, for every one unit of horizontal movement to the right, the line increases its vertical position by two units. This constant rate of change is the fundamental characteristic of this specific straight line.
With the slope known, we can also find the distance and midpoint. The distance formula is an application of the Pythagorean theorem: D = √[(x2-x1)² + (y2-y1)²]. For our example, this is D = √[(6-2)² + (11-3)²] = √[4² + 8²] = √[16 + 64] = √80, which is approximately 8.94 units. The midpoint is simply the average of the x and y coordinates: Midpoint = ((x1+x2)/2, (y1+y2)/2) = ((2+6)/2, (3+11)/2) = (4, 7). This is the exact center point of the line segment.
From Slope to a Straight Line Equation
Calculating the slope is often just the first step. The ultimate goal is frequently to define the entire line by finding its equation in the standard slope-intercept format, y = mx + b. In this equation, 'm' is the slope we just calculated. The other variable, 'b', represents the y-intercept. This is the single, specific point where the line crosses the vertical y-axis. A line can only have one y-intercept, and finding it is essential for graphing the line and understanding its position relative to the origin point (0,0) of the coordinate system.
To find the value of 'b', we can use our calculated slope (m=2) and either of the original points. Let's use Point 1, (2, 3). We substitute these values into the line equation: y = mx + b becomes 3 = (2)(2) + b. This simplifies to 3 = 4 + b. To solve for 'b', we subtract 4 from both sides, which gives us b = -1. Now possessing both 'm' and 'b', we can write the final, complete equation of the line: y = 2x - 1. This equation is a powerful tool, allowing us to find the corresponding y-coordinate for any x-coordinate on the line.
Common Pitfalls and How to Avoid Them
The most common mistake when calculating slope manually is mismatching the order of the points. It is crucial that the subtraction order is consistent for both the y-coordinates (rise) and the x-coordinates (run). If you subtract y1 from y2 to find the rise, you must also subtract x1 from x2 to find the run. A common error is to calculate (y2 - y1) / (x1 - x2). This flips the sign of the denominator and will result in a slope that is the negative of the correct value, leading you to conclude a line is rising when it's actually falling, or vice versa.
Confusion also arises with perfectly horizontal or vertical lines. If two points have the same y-coordinate, such as (3, 7) and (10, 7), the 'rise' is zero. This results in a slope calculation of m = 0 / 7 = 0. This is not an error; it is the correct definition of a horizontal line. Similarly, if two points share the same x-coordinate, like (5, 2) and (5, 9), the 'run' is zero. This leads to a denominator of zero in the slope formula. Since division by zero is undefined in mathematics, the slope is officially 'undefined.' This is also correct and is the definition of a vertical line.
Frequently asked questions
What is the slope formula?
Slope = rise ÷ run, where rise is the vertical change and run is the horizontal change. For two points (x₁,y₁) and (x₂,y₂): slope = (y₂ − y₁) / (x₂ − x₁).
How do I convert slope to a percentage grade?
Multiply the decimal slope by 100. A slope of 0.08 = 8% grade. A 1:12 ramp has slope 1/12 ≈ 0.0833 = 8.33% grade.
How do I convert slope to an angle?
Angle = arctan(rise / run). A 100% grade is a 45° angle (rise equals run). A 10% grade is about 5.71°.
What is the maximum slope for an ADA wheelchair ramp?
1:12 (8.33%) is the maximum for accessible ramps under the ADA, with handrails and landings required. Existing-construction tolerances allow 1:10 for short runs.
What roof pitch is considered steep?
Roofs are typically described as 'X-in-12'. 4-in-12 is moderate; 8-in-12 is steep; 12-in-12 (45°) is very steep and requires special framing and roofing techniques.
Why is 100% grade only 45°?
Because grade is rise/run, not angle. A 100% grade means rise equals run, which is a 45° angle. Slope can exceed 100% — a cliff at 70° is roughly 275% grade.
More in Math Tools
General-purpose math: percentages, percent change, averages, proportions, slope/grade, fractions, descriptive statistics, and a full scientific calculator.
- Percentage Calculator
Three modes: X% of Y, A is what % of B, and % change.
- Percentage Increase / Decrease Calculator
Percent change between any old and new value, with the formula and direction shown.
- Average Calculator
Mean, median, mode, sum, count, min, max, and range for any list of numbers.
- Proportion Calculator
Solve any proportion a/b = c/d for the missing value using cross-multiplication.
- Fraction Calculator
Add, subtract, multiply, and divide fractions and mixed numbers — results returned simplified, as a mixed number, and as a decimal.
- Standard Deviation Calculator
Mean, median, mode, range, sample/population standard deviation, variance, quartiles, IQR, and SEM for any list of numbers.
Related calculators
Browse all Education →Course Grade Calculator
Weighted course grade from assignments, quizzes, and exams. Shows current grade plus the score needed on remaining work.
Grade Needed Calculator
Find the GPA you need on remaining coursework to hit a target cumulative GPA.
Percentage Calculator
Three modes: X% of Y, A is what % of B, and % change.
Percentage Increase / Decrease Calculator
Percent change between any old and new value, with the formula and direction shown.
Linear Regression Calculator
Least-squares slope, intercept, R², and predictions for any paired (x, y) data.
GPA Calculator
Calculate your semester or cumulative GPA on a 4.0 scale.
Fraction Calculator
Add, subtract, multiply, and divide fractions and mixed numbers — results returned simplified, as a mixed number, and as a decimal.
Standard Deviation Calculator
Mean, median, mode, range, sample/population standard deviation, variance, quartiles, IQR, and SEM for any list of numbers.