Slope Calculator from Two Points

Find the slope of a line through two points, plus its equation y = mx + b, intercepts, angle, distance and midpoint, with steps.

Loading the calculator…

Slope measures how steep a line is: how much y changes for each step in x. Teachers call it “rise over run”.

m = (y₂ − y₁) ÷ (x₂ − x₁)

Reading the result

  • Positive slope: the line rises from left to right.
  • Negative slope: it falls from left to right.
  • Zero: a horizontal line, y = constant.
  • Undefined: a vertical line, x = constant, because the run is zero and you cannot divide by zero.

Step by step: points (1, 2) and (4, 8)

  1. Rise: 8 − 2 = 6.
  2. Run: 4 − 1 = 3.
  3. Slope: 6 ÷ 3 = 2.
  4. Intercept: put one point into y = mx + b → 2 = 2 × 1 + b, so b = 0.
  5. Equation: y = 2x.

The order of the points does not matter as long as you subtract in the same order on top and bottom: (2 − 8) ÷ (1 − 4) also gives 2.

Slope in real life

Roads and ramps express slope as a percentage (rise ÷ run × 100). A 2 slope is a 200 % grade and an angle of about 63.4°; a wheelchair ramp is typically limited to about 1:12, or 8.3 %. The angle shown above is arctan(m).

Working with a right triangle instead? The Pythagorean theorem calculator gives the missing side and angles.

FAQ

What does the slope of a parallel or perpendicular line look like?

Parallel lines have the same slope. Perpendicular lines have slopes that multiply to −1, so a line perpendicular to slope 2 has slope −1/2.

Why is the slope shown as a fraction too?

When both points are whole numbers, the exact fraction (for example 2/3) avoids rounding a repeating decimal such as 0.666667.

What is the x-intercept?

It is where the line crosses the x-axis, found by setting y = 0: x = −b ÷ m. A horizontal line that is not the x-axis never crosses it.

Last reviewed November 30, 2026. Results are estimates for general information.