Slope Calculator
Find the slope of a line from two points, a point and a slope, an angle and intercept, or an equation Ax + By = C — with the percent grade, angle of inclination, roof pitch, distance, intercepts and all three line-equation forms, plus a graph.
Written by Suhaib Hassan. Every formula is standard coordinate geometry, and the worked examples are re-derived by hand. Our methodology.
It computes rise over run, reduces it to an exact fraction where possible, takes the arctangent for the angle, and builds the line’s equation in three forms.
Slope shows up as grade, pitch and angle in construction and maths. One page converts between all of them and handles vertical lines correctly.
—
Graph of the line
The line with its intercepts marked.
Step-by-step working
—
Types of slope
How the sign and size of m describe a line.
| Line | Slope m | Angle θ | Description | Equation |
|---|---|---|---|---|
| Positive | m > 0 | 0° < θ < 90° | Rises from left to right | y = mx + b |
| Negative | m < 0 | −90° < θ < 0° | Falls from left to right | y = mx + b |
| Zero (horizontal) | m = 0 | θ = 0° | Perfectly level | y = b |
| Undefined (vertical) | Δx = 0 | θ = 90° | Straight up and down | x = a |
Slope in the real world
Wheelchair ramps
US accessibility standards (ADA) set a maximum running slope of 1:12 for ramps.
θ = arctan(1/12) = 4.76°
Road drainage
Pavements are crowned or cambered so that water runs off; cross slopes of about 1.5–2% are common.
Roof pitch
Pitch is quoted as rise per 12 units of run: “6 in 12” means 6 inches of rise per foot.
What is slope?
Slope measures how steep a line is: the vertical change (rise) divided by the horizontal change (run) between any two points on it, m = (y₂ − y₁) ÷ (x₂ − x₁). It is the same for every pair of points on a straight line. Slope is the tangent of the angle the line makes with the x-axis, m = tan θ.
Three ways to write a line
- Slope-intercept: y = mx + b, where b is the y-intercept.
- Point-slope: y − y₁ = m(x − x₁), for a known point (x₁, y₁).
- Standard form: Ax + By = C, with the slope −A ÷ B and y-intercept C ÷ B.
Grade, angle and pitch
Percent grade = slope × 100. The angle is arctan(slope). A roof pitch of “n in 12” has slope n ÷ 12. A 100% grade is a 45° incline.
By Suhaib Hassan · Reviewed 28 September 2026 · How CalculatePilot verifies formulas →
Sources
- Descartes, R. (1637). La Géométrie — the foundation of coordinate geometry.
- US Access Board, 2010 ADA Standards for Accessible Design, section 405 (ramps) — maximum running slope 1:12.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics.
Frequently asked questions
Why is the slope of a vertical line undefined?
A vertical line has Δx = 0, so the slope formula divides by zero. Its angle is 90° and its equation is x = a, rather than y = mx + b.
How is slope related to the derivative?
The derivative dy/dx is the slope of the tangent line to a curve at a point. For a straight line the slope is constant, so the derivative equals m everywhere.
What is the difference between percent slope, degrees and roof pitch?
They are the same steepness in different units. Percent slope is 100 × rise ÷ run; degrees are arctan(rise ÷ run); pitch is rise per 12 units of run. A 12% slope is 6.84°, or a pitch of 1.44 in 12. They are not proportional: 100% slope is 45°, not 100°.
How do I find a perpendicular or parallel slope?
A parallel line has the same slope m. A perpendicular line has slope −1 ÷ m (the negative reciprocal). If m = 0 the perpendicular line is vertical, and vice versa.
How do I convert Ax + By = C to y = mx + b?
Solve for y: y = (−A ÷ B)x + C ÷ B, provided B ≠ 0. If B = 0 the line is vertical at x = C ÷ A.
Can slope be a fraction or a decimal?
Yes. Slope is any real number. It is often best left as an exact fraction such as 2/3, because the decimal 0.6667 is only an approximation.
How slope is calculated from two points: slope calculator guide.
Related calculators
Continue with coordinate geometry.