Slope Calculator
The slope of a line between two points.
Input sheet
DIY at your own risk. Calcora's calculators and guides are general estimates and information only — not professional, engineering, legal, or safety advice. Always verify local building codes and permit requirements, and hire a licensed pro for electrical, gas, plumbing, structural, or any work you're not fully comfortable doing yourself.
Slope measures how steeply a line rises or falls — a road grade, a wheelchair ramp, the trend in a chart. It is the change in vertical position divided by the change in horizontal position between two points.
How it works
Slope is rise over run: (y2 − y1) ÷ (x2 − x1).
Slope is 'rise over run.' A positive slope climbs left to right, a negative one descends, zero is flat, and a vertical line has an undefined slope because the run is zero (the tool flags this).
From the slope and one point, this tool also reconstructs the full line equation y = mx + b, where b is the y-intercept — the value of y where the line crosses the vertical axis.
Slope m = (y₂ − y₁) ÷ (x₂ − x₁)
Worked examples
The line through (1, 2) and (4, 11). → Slope 3
Rise is 11 − 2 = 9, run is 4 − 1 = 3, and 9 ÷ 3 = 3. The line is y = 3x − 1.
The line through (0, 5) and (10, 0). → Slope −0.5
Rise is 0 − 5 = −5, run is 10 − 0 = 10, and −5 ÷ 10 = −0.5, a downward slope.
Tips & gotchas
- A vertical line has no defined slope; a horizontal line has a slope of exactly zero.
- Road grade is slope expressed as a percent — a 6% grade means 6 units of rise per 100 of run.
- Parallel lines share the same slope; perpendicular lines have slopes that multiply to −1.
FAQ
What does a slope of zero mean?
The line is perfectly horizontal — no rise as you move along it. Its equation is y = a constant.
Why is a vertical line's slope undefined?
The run (change in x) is zero, and dividing by zero has no value. The line still exists; its slope simply cannot be expressed as a number.
How do I get the line equation from the slope?
Use y = mx + b. Plug in the slope for m and one known point to solve for b, the y-intercept, as this tool does automatically.
Related calculators
Percentage Calculator · Percent Change Calculator · Average (Mean) Calculator · Ratio Calculator · Exponent Calculator