Slope Formula in Geometry

The slope formula measures how steep a line is as the ratio of vertical change to horizontal change between two points. It is m=y2y1x2x1m = \dfrac{y_2 - y_1}{x_2 - x_1} — often read as “rise over run.” A positive slope rises from left to right, a negative slope falls, a horizontal line has slope 0, and a vertical line has an undefined slope (division by zero).

Interactive slope explorer

Drag point A or B (or click a point and use the arrow keys). The green “rise” and amber “run” overlay the right triangle whose ratio is the slope.

run = 6rise = 6 A (-3, -2) B (3, 4)

Drag a point, or click it and use the arrow keys. Coordinates snap to the grid.

Slope 1

Step-by-step substitution

  • m = (y₂−y₁)/(x₂−x₁) = (4−-2)/(3−-3) = 6/6 = 1

Rise over run

Between two points, the rise is the change in y, y2y1y_2 - y_1, and the run is the change in x, x2x1x_2 - x_1. Slope is their ratio:

m=riserun=y2y1x2x1m = \dfrac{\text{rise}}{\text{run}} = \dfrac{y_2 - y_1}{x_2 - x_1}

Swapping the order of the points flips the sign of both the rise and the run, so the slope is unchanged — just be consistent about which point is first in the numerator and denominator.

Worked examples

  1. (0, 0) to (2, 4): m = (4−0)/(2−0) = 4/2 = 2 (rises steeply).
  2. (−3, −2) to (3, 4): m = (4−(−2))/(3−(−3)) = 6/6 = 1.
  3. (1, 5) to (6, 5): m = (5−5)/(6−1) = 0/5 = 0 (horizontal line).

Practice problems

  1. (0, 0) and (5, 10)
    Answer

    10/5 = 2

  2. (1, 2) and (4, 8)
    Answer

    6/3 = 2

  3. (−2, 3) and (2, −5)
    Answer

    −8/4 = −2

  4. (4, 1) and (4, 9)
    Answer

    8/0 = undefined (vertical)

  5. (−1, −1) and (5, 2)
    Answer

    3/6 = 0.5

Related

Classroom use: slope formula formulas

Who it's for: Grades 8–12 · Grade 8 students meeting slope and high-school students proving parallel and perpendicular criteria.

Learning objectives

After using this page, students will be able to:

  • Compute slope as rise over run from two points.
  • Interpret positive, negative, zero, and undefined slope geometrically.
  • Use slopes to decide whether two lines are parallel or perpendicular.

Suggested classroom activity

Drag the two points into a vertical line and let the explorer report an undefined slope. Asking why division by zero happens here — and what that means about the line — turns a memorised exception into an understood one.

Standards alignment

Aligned to the Common Core State Standards for Mathematics. Codes are given exactly as published so they can be matched against state crosswalks.
CodeStandard
8.EE.B.6Use similar triangles to explain why slope is the same between any two points on a line.
HSG.GPE.B.5Prove the slope criteria for parallel and perpendicular lines.

Free to use and adapt in class under the terms on our license page — no account, no sign-up, no ads. Content last reviewed August 2026.

Frequently asked questions

What is the slope formula?

Slope is m = (y₂ − y₁)/(x₂ − x₁), the change in y divided by the change in x between two points — “rise over run.” For (0, 0) and (2, 4), the slope is 4/2 = 2.

What does slope tell you?

Slope measures a line’s steepness and direction. A positive slope rises left to right, a negative slope falls, a slope of 0 is horizontal, and a vertical line has an undefined slope.

Why is the slope of a vertical line undefined?

A vertical line has the same x-value at both points, so x₂ − x₁ = 0. The slope formula would divide by zero, which is undefined — the line has no finite “run.”