Slope Calculator
The slope between two points, plus the full equation of the line through them.
Slope is rise over run: how much the line climbs for each step across.
How the slope calculator works
Slope is rise over run: how much the line climbs for each step across. A slope of 2 climbs two units for every one across; a slope of −0.5 falls half a unit.
A vertical line has no slope at all, which is different from having a slope of zero. Zero slope is horizontal — it climbs nothing. Vertical is undefined, because the run is zero and you cannot divide by it. Conflating the two is the most common mistake on this topic.
The page also gives the line in all three standard forms, the angle it makes with the horizontal, and the slope of any perpendicular line.
Formula: m = (y₂ − y₁)/(x₂ − x₁)
Worked examples
| Inputs | Slope | Note |
|---|---|---|
| From (2, 3) to (8, 15) | 2 | slope 2, y = 2x − 1 |
| A horizontal line | 0 — the line is horizontal | slope 0 |
| A vertical line | undefined — the line is vertical | undefined, not zero |
FAQFrequently asked questions
How do I find the slope between two points?
Divide the change in y by the change in x: (y₂ − y₁)/(x₂ − x₁).
What is the slope of a vertical line?
Undefined — the run is zero and you cannot divide by it. That is different from a slope of zero, which is horizontal.
What is the slope of a horizontal line?
Zero. It climbs nothing as it moves across.
What is slope-intercept form?
y = mx + b, where m is the slope and b is where the line crosses the y-axis.
What is the slope of a perpendicular line?
The negative reciprocal: a line of slope 2 is perpendicular to one of slope −½.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- National curriculum in England — Mathematics — the terms and methods taught in UK schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.