Slope Calculator
Two points in, and the slope, equation, percent grade, angle and distance come out — live.
Last updated
How to use slope calculator
- Enter the first point’s coordinates in x1 and y1, and the second point’s in x2 and y2.
- The slope, y-intercept and the line’s equation appear as you type.
- The muted lines underneath show the rise over run, the slope as a percentage, the angle in degrees, and the distance between the points.
- If x1 and x2 are equal, the result shows a vertical line whose slope is undefined.
Examples
Line through (0, 1) and (4, 5)
The rise is 4 over a run of 4, so m = 1 and the equation is y = x + 1 — a 45° line with a 100% grade and a distance of 5.66 between the points.
Downhill from (0, 5) to (4, 1)
Dropping 4 over a run of 4 gives m = −1: the equation y = −x + 5, a −100% grade, a −45° angle, and a distance of 5.66.
Vertical line through x = 5
Both points have x = 5, so the run is zero and the slope is undefined — the tool reports the vertical line x = 5 with a distance of 6.
What is Slope?
Drive through mountains and you will see signs warning of an 8% grade ahead; open a set of stairs plans and the pitch is written the same way. Grade, pitch and slope are one idea measured everywhere: how much a line rises for each unit it runs. The number that captures it, m = (y2 − y1)/(x2 − x1), is the workhorse of algebra — it is the rate on a distance-time graph, the steepness of a wheelchair ramp, and the first thing to check when a line climbs, falls or runs flat.
Two points are all it takes. From (x1, y1) and (x2, y2) this tool derives everything at once: the slope itself, the rise and run behind it, the y-intercept b where the line crosses the y-axis, and the equation in slope-intercept form y = mx + b — so it doubles as a slope intercept form calculator. For terrain work it also expresses the slope as a percentage (rise over run × 100, the same figure a road-grade sign quotes) and as an angle in degrees, and it measures the straight-line distance between the two points, which is just the hypotenuse of the rise-run right triangle.
Type your coordinates below and every value updates live. A negative slope points downhill, a zero slope means a flat line, and when both points share an x-coordinate the line is vertical and the slope is undefined — the tool says so plainly instead of dividing by zero. The angle helps when you are setting a saw blade or comparing against a survey, and the percent grade settles ramp and driveway questions. Nothing is uploaded; the arithmetic happens entirely on your device.
Frequently asked questions
What is the slope formula?
m = (y2 − y1) / (x2 − x1) — the change in height (the rise) divided by the change in horizontal position (the run). Going from (0, 1) to (4, 5): (5 − 1) / (4 − 0) = 1. It does not matter which point you call the first; swapping them flips the sign of both numerator and denominator, leaving m unchanged.
What is slope-intercept form?
The equation y = mx + b, where m is the slope and b is the y-intercept — the y-value where the line crosses the y-axis. The equation line in the result is written in this form, so the tool works as a slope intercept form calculator: read m and b straight off the answer.
How do I calculate the slope of a ramp?
Divide the rise by the run and multiply by 100 for a percent grade — rise over run is all there is to it. Accessibility guidelines commonly require a gentler ratio than 1:12 (one unit up for every twelve across), which works out to about 8.3% grade, roughly 4.76°. Enter the ramp’s two endpoints as (x, y) points above to see the grade, angle and length together.
How many degrees is a 1% slope?
About 0.573°. Percent grade and degrees measure the same steepness differently: grade is rise ÷ run × 100, while the angle is the arctangent of rise ÷ run. For small grades they track closely — 1% ≈ 0.573°, 10% ≈ 5.71° — but they diverge as it gets steep: a 100% grade is 45°. The angle line in the result converts for you.
What is the slope of a vertical line?
Undefined. The run (x2 − x1) is zero, and division by zero has no answer — the line rises no matter how little it runs. Instead of a slope, a vertical line has an equation of the form x = k, which is what this calculator reports when both points share an x-coordinate.
How do I convert slope percent to degrees?
Take the arctangent of the grade written as a decimal: degrees = atan(grade ÷ 100). A 100% grade (rise = run) is atan(1) = 45°, and a 1:12 ramp is atan(1/12) ≈ 4.76°. Because the same calculation runs behind the angle line, you can type any two points and read the degrees off directly.
Related tools
- Pythagorean Theorem Calculator
Solve any right triangle side from the other two — hypotenuse or missing leg — with the working shown.
- Volume Calculator
Calculate the volume of a cylinder, sphere, cone, cube or box from its dimensions.
- Average Calculator
Quickly find the average of a list of numbers.
- BMI Calculator
Calculate your BMI in metric or imperial units and see your WHO category and healthy weight range.
- CD Calculator
Calculate the maturity value and interest of a certificate of deposit from the deposit, APY, term and compounding.
- Compound Interest Calculator
Calculate compound growth of a lump sum plus monthly contributions.
Browse all calculators.