Slope Calculator
Divide the rise by the run between two points to find the slope of the line through them.
What slope measures
Slope describes how fast a line climbs or falls as you move left to right. Pick any two points on the line, subtract their y-coordinates to get the rise, subtract their x-coordinates to get the run, and the slope is rise divided by run. Enter two points — the defaults are (1, 2) and (3, 8) — and this calculator returns the slope along with the rise and run it used, so you can check your own subtraction step by step.
How the formula works
How the subtraction must stay consistent
The numerator y2 − y1 measures vertical change and the denominator x2 − x1 measures horizontal change between the same two points, so the quotient is units of height per unit of width. A slope of 3 means the line climbs 3 units for every 1 unit it moves right; a slope of −0.5 falls half a unit per unit to the right. Because the ratio is constant along a straight line, any pair of points gives the same answer — (1, 2) and (3, 8) give rise 6 and run 2, and so would (0, −1) and (10, 29).
Reading the sign and size
A positive slope rises to the right, a negative slope falls to the right, and a slope of 0 is a horizontal line. The size is the steepness: slope 1 makes a 45° angle with the x-axis, slope 3 is steeper at about 71.6°, and slope 0.05 is nearly flat, matching a 5% road grade. Angles come from the arctangent of the slope, so tan(71.57°) ≈ 3 for the default line.
Worked example at the defaults
Points (1, 2) and (3, 8). Step 1: rise = 8 − 2 = 6. Step 2: run = 3 − 1 = 2. Step 3: slope = 6 ÷ 2 = 3. The line therefore climbs 3 units for each unit of run: starting at (1, 2) it reaches y = 5 at x = 2 and y = 8 at x = 3, which lands exactly on the second point. In slope-intercept form the line is y = 3x − 1, since substituting x = 1 gives y = 3 − 1 = 2.
Order matters only in that it must stay consistent. Reversing both points — (3, 8) first, then (1, 2) — gives rise −6 and run −2, and −6 ÷ −2 is still 3. Reversing only one coordinate, for example run = 1 − 3 = −2 with rise = 6, gives −3, which is the wrong slope for the same line. This sign flip is the single most common slope error on timed tests, and writing the two subtractions on one line before dividing catches it.
A quick plot check confirms the arithmetic: from (1, 2), moving right 2 units and up 6 units arrives at (3, 8). If your computed slope were −3 instead, the same movement would predict (3, −4), which misses the second point by 12 vertical units — a visible proof that the sign is wrong.
Slope values you will actually meet
| Situation | Slope | What it means |
|---|---|---|
| Horizontal line | 0 | No vertical change at all |
| 5% road grade | 0.05 | Rises 5 m per 100 m of road |
| ADA wheelchair ramp (max 1:12) | ≈0.083 | Rises 1 unit per 12 of run |
| 45° line | 1 | Rise equals run |
| Default points (1, 2) to (3, 8) | 3 | Steep: 3 units up per 1 across |
| Vertical line | undefined | Run is zero, division impossible |
The table shows why slope units matter outside algebra class. A ramp built at the default slope of 3 would rise 3 units per 1 across — four times steeper than the 1:12 accessibility limit and unusable for wheelchairs. Road engineers prefer percent grade, which is just slope × 100, so a slope of 0.05 and a 5% grade describe the same hill; the default line would be a 300% grade, far beyond any drivable road.
Special cases and common mistakes
Most lost marks on slope questions come from a handful of repeating errors. The list below covers the ones that appear year after year in homework sets and exams.
- Vertical lines: x2 − x1 = 0, so the slope is undefined — not zero and not a usable number.
- Zero slope means horizontal; undefined means vertical. Confusing the two loses easy marks.
- Sign errors: subtract both x-values and both y-values in the same order, or the sign flips.
- Slope is not the y-intercept: the default line has slope 3 but crosses the y-axis at −1.
- Slope is not a percentage: a slope of 3 is a 300% grade, not 3%.
When the run is zero
If both points share an x-coordinate, such as (4, 1) and (4, 7), the rise is 6 but the run is 0, and 6 ÷ 0 has no defined answer. The line is perfectly vertical and its equation is simply x = 4. No number can represent this case, which is why the output field shows the slope as undefined rather than a very large value.
From slope to the rest of the line
Once the slope is known, everything else about the line follows cheaply. The point-slope form y − y1 = m(x − x1) builds the equation from one point: with m = 3 and (1, 2) it gives y − 2 = 3(x − 1). Parallel lines share the same slope, so any line parallel to the default also has slope 3. Perpendicular slopes multiply to −1, so a line crossing the default at a right angle has slope −1/3 ≈ −0.333. These two facts turn most slope homework questions into one subtraction and one division.
- Parallel lines: identical slopes, so both have slope 3 in the default example.
- Perpendicular lines: slopes multiply to −1, giving −1/3 against the default.
- Angle to the x-axis: arctangent of the slope, about 71.6° here.
- Percent grade: slope × 100, so slope 0.083 is an 8.33% grade.
Converting to slope-intercept form
To finish the default example, solve y − 2 = 3(x − 1) for y: distribute to get y − 2 = 3x − 3, then add 2 to both sides for y = 3x − 1. The slope 3 appears as the coefficient of x and the y-intercept −1 as the constant. Reading m directly off an equation in this form skips the subtraction entirely, which is why textbooks rewrite point-based problems into slope-intercept form before asking follow-up questions.
Where slope appears outside homework
Any two data points on a chart define a slope, which is why the same formula drives trend analysis. If a savings balance grows from $2,000 to $8,000 over 3 years, the slope is $2,000 per year, and projecting one more year adds that amount. Roofers convert pitch to slope to size materials, cyclists read gradient as slope × 100, and in 2026 coursework the identical arithmetic appears in linear regression, where the fitted slope minimizes squared vertical errors across many points. The three outputs this calculator reports — rise, run and slope — are the same three numbers a regression summary produces for any two-point dataset.
Frequently asked questions
How do I calculate slope from two points?
Subtract the y-values to get the rise, subtract the x-values in the same order to get the run, then divide. For (1, 2) and (3, 8) the rise is 6, the run is 2, and the slope is 3.
What does a negative slope mean?
The line falls as x increases: slope −2 drops 2 units for every unit moved right. On a chart the line slopes downhill from left to right.
What is the slope of a vertical line?
Undefined, because the run is 0 and division by zero is impossible. A horizontal line is the opposite case: its slope is exactly 0.
Do the two points have to be in order?
No, as long as you subtract both coordinates in the same order. Swapping both points gives rise −6 and run −2 for the defaults, and −6 ÷ −2 is still slope 3.
How do I convert slope to an angle?
Take the arctangent of the slope. Slope 1 is 45°, the default slope of 3 is about 71.6°, and slope 0.05 is about 2.9°, which road signs express as a 5% grade.
What slope is perpendicular to a line of slope 3?
−1/3, about −0.333, because perpendicular slopes multiply to −1. Parallel lines instead share the same slope exactly.
Is slope the same as percent grade?
Percent grade is slope × 100. A slope of 0.083, the 1:12 wheelchair ramp limit, is an 8.33% grade; the default slope of 3 would be a 300% grade, far steeper than any road.
Can I find slope from an equation instead of points?
Yes. In y = mx + b the slope is m directly, so y = 3x − 1 has slope 3 without any subtraction. The two-point form is useful when a chart or table gives coordinates instead.
Method and sources
- Slope = (y2 - y1) / (x2 - x1).