Slope Calculator
Find the slope, line equation, y-intercept, and angle of incline from two points (with the formula and substitution shown).
Details
Your points
Slope
2
This works out how steep a line is from two points. Enter the coordinates and it returns the slope as a number, along with the equation of the line in y = mx + b form.
It also gives the angle in degrees, the distance between the two points, and where the line crosses the y-axis, which covers both the algebra and the practical grade questions.
What is slope?
Slope is how steep a line is. It compares how far something rises against how far it runs along.
A slope of 2 means that for every 1 step forward you go 2 steps up. A slope of 0.5 means you climb half a step for every step forward, which is far gentler.
The same idea gets written three different ways depending on who is using it: as a plain number in maths, as degrees by anyone with a protractor, and as a percentage by builders, roofers and highway engineers. They all describe the same steepness.
Always subtract in the same order on top and bottom. Take y₂ − y₁ on top, so the bottom must be x₂ − x₁, or the sign comes out backwards.
What to enter
- Two points
- The x and y of each point. Order does not matter as long as you keep each pair together.
- Equation of the line
- The result in y = mx + b form, where m is the slope and b is where the line crosses the y-axis.
- Angle it climbs at
- The same steepness in degrees. A slope of 1 is exactly 45°.
- Distance between the points
- The straight-line distance, worked out with the Pythagorean theorem.
What common percent grades actually feel like
- 1%
- 0.57°, or ⅛ inch of fall per foot. The minimum fall for a drain pipe run.
- 2%
- 1.15°, or ¼ inch per foot. The usual fall for patios and driveways so water runs off.
- 6%
- 3.43°. A steep motorway hill; the grade that gets a warning sign for lorries.
- 8.33%
- 4.76°, or exactly 1 inch of rise per foot. The 1:12 maximum for a wheelchair ramp.
- 100%
- 45°. Rise equals run. A 100% grade is not vertical, which surprises most people.
What this assumes
The line is straight. A curve has a different slope at every point, which is what calculus is for.
A vertical line has undefined slope, because the run is zero and you cannot divide by zero.
How to calculate slope
Subtract, subtract, divide. The only thing to be careful about is doing both subtractions the same way round.
- y₂ − y₁
- The rise: how much the height changes
- x₂ − x₁
- The run: how far you travel across
- m
- The slope
Find the rise. Subtract the first y from the second y.
Find the run. Subtract the first x from the second x, taking the points in the same order as before.
Divide. Rise divided by run gives the slope. Positive climbs left to right, negative falls.
Convert if you need to. For a percentage, multiply the slope by 100. For degrees, take the inverse tangent.
See a worked example: the line through (3, 4) and (6, 8)
- First point
- (3, 4)
- Second point
- (6, 8)
Rise: 8 − 4 = 4.
Run: 6 − 3 = 3.
Slope: 4 ÷ 3 = 1.333.
As a percentage that is 133%, and as an angle it is 53.13°.
The straight-line distance between the points is 5, from the 3-4-5 triangle.
Slope = 4/3, or 53.13°
Frequently asked questions
A 2% slope drops 2 units for every 100 travelled. Over one foot that is ¼ inch of fall, which is the standard for patios, driveways and paths so rainwater runs off instead of pooling.
For drainage pipe the usual minimum is 1%, about ⅛ inch per foot. Too little and waste does not carry; surprisingly, too much is also a problem, because water can outrun the solids and leave them behind.
About 3.43°. It sounds gentle written as an angle, but 6% is steep for a road: it is the point where motorways start posting truck warning signs.
The reason it sounds mild is that percent grade and degrees are not the same scale. They only match up near zero and drift apart quickly after that.
No. 100% is 45°, where the rise exactly equals the run. This catches almost everybody.
A vertical line has no defined percent grade at all, because the run would be zero and you cannot divide by it. Percent grade can keep climbing past 100% and never reaches vertical.
The widely used maximum is 1:12, which is 8.33% or 4.76°. That means one inch of rise for every twelve inches of run.
So a step 6 inches high needs a ramp 6 feet long. Check your local building rules before relying on it, as requirements vary and often add landings for longer runs.
Zero means flat: the line stays at the same height. Negative means it falls as you move right.
Undefined is different from zero and means a vertical line. Because the run is zero, the division is impossible, which is why the calculator reports undefined rather than a number.
Take the inverse tangent of the slope, written tan⁻¹ or arctan on a calculator. A slope of 1 gives 45°, and 4/3 gives 53.13°.
To go the other way, take the tangent of the angle. The scientific calculator has both.
Problems people actually run into
Confusing percent grade with degrees
A 10% grade is about 5.7°, not 10°. People read a road sign saying 10% and picture something far steeper than it is.
The two only agree near zero. By 45° the grade is already 100%, and beyond that the percentage runs off towards infinity while the angle creeps towards 90°.
Subtracting the points in different orders
Taking y₂ − y₁ on top but x₁ − x₂ underneath flips the sign, turning an uphill line into a downhill one.
Pick a point to call 'first' and use it first in both subtractions. If your answer has the wrong sign, this is nearly always why.
Results are estimates for general information only and are not professional financial, medical, or legal advice. Read our full disclaimer.
Sources
- Determine the percent slope and angle of slope · U.S. Geological Survey
- ADA Standards for Accessible Design: ramps and slope (section 405) · U.S. Department of Justice
Last updated: September 3, 2026