Slope Calculator

Slope, equation of the line, distance and midpoint from two points.

Calculate

Type your numbers and press Calculate — the answer appears with the full step-by-step working.

Answer
m = 1.5
Line: y = 1.5x + 0.5

Step-by-step working

  1. Rise: 8 − 2 = 6; run: 5 − 1 = 4
  2. Slope m = rise ÷ run = 1.5
  3. y-intercept: b = y₁ − m·x₁ = 0.5, so the line is y = 1.5x + 0.5
  4. Distance between the points: 7.2111025509 · Midpoint: (3, 5)

Try a worked example — it loads straight into the calculator:

Formula

m = (y₂ − y₁) ÷ (x₂ − x₁) · Line: y = mx + b

Worked examples

(1, 2) to (5, 8)

  1. Rise: 8 − 2 = 6; run: 5 − 1 = 4
  2. Slope m = rise ÷ run = 1.5
  3. y-intercept: b = y₁ − m·x₁ = 0.5, so the line is y = 1.5x + 0.5
  4. Distance between the points: 7.2111025509 · Midpoint: (3, 5)

Answer: m = 1.5 — Line: y = 1.5x + 0.5

Falling line: (0, 10) to (4, 2)

  1. Rise: 2 − 10 = -8; run: 4 − 0 = 4
  2. Slope m = rise ÷ run = -2
  3. y-intercept: b = y₁ − m·x₁ = 10, so the line is y = -2x + 10
  4. Distance between the points: 8.94427191 · Midpoint: (2, 6)

Answer: m = -2 — Line: y = -2x + 10

Vertical: (3, 1) to (3, 9)

  1. Both points have x = 3, so the run is zero — slope is undefined and the line is vertical: x = 3.

Answer: Undefined (vertical line) — x = 3

About this calculator

Slope is steepness as a number: how much y climbs for every one unit x moves. Rise over run. A slope of 2 climbs fast, ½ climbs gently, a negative slope descends, zero is flat, and a vertical line has no defined slope at all because its run is zero. From two points this calculator finds the slope, builds the full equation of the line, and throws in the distance between the points and their midpoint — the complete starter kit for coordinate geometry.

How to use it

  1. Enter the two points (x₁, y₁) and (x₂, y₂).
  2. Calculate — slope first, then the line's equation and the extras.

Frequently asked questions

Does the order of the points matter?

No, as long as you subtract in the same order top and bottom. Swapping both points flips the sign of rise and run together, leaving the slope unchanged.

What does slope mean outside maths class?

Any rate of change: speed is the slope of a distance-time graph, a ramp's gradient is its slope, and price elasticity is a slope in economics.