Compute the slope of a line through two given points using the rise-over-run formula. The slope is computed exactly as a fraction and verified by an independent re-derivation of rise and run.

Example

Compute rise over run from two points. Slope measures how steeply a line climbs: the change in the vertical coordinate divided by the change in the horizontal coordinate as you move between the points. Because a straight line has constant steepness, any two points on it give the same ratio, so this single number fully describes the line's direction.

highlighted = computed this step

Step 1 — Set up

Set up the expression.

(1,2), (4,11)( 1 , 2 ),\ ( 4 , 11 )
Slope from two pointsThe right triangle shows the vertical change and horizontal change between the two points.AB

Step 2 — Find rise

Find rise: 11 - 2 = 9.

112=911 - 2 = \hl{9}
Slope from two pointsThe right triangle shows the vertical change and horizontal change between the two points.AB

Step 3 — Find run

Find run: 4 - 1 = 3.

41=34 - 1 = \hl{3}
Slope from two pointsThe right triangle shows the vertical change and horizontal change between the two points.AB

Step 4 — Put rise over run

Put rise over run: 9 / 3.

m=93m=\frac{ \hl{9} }{ \hl{3} }
Slope from two pointsThe right triangle shows the vertical change and horizontal change between the two points.ABC

Step 5 — Simplify slope

Slope is rise over run: 9 / 3 = 3.

m=93=3m=\frac{ 9 }{ 3 }= \hl{3}
Slope from two pointsThe right triangle shows the vertical change and horizontal change between the two points.ABC
slope-from-two-points The slope formula is m = (y₂ - y₁) / (x₂ - x₁). Compute rise = y₂ - y₁ and run = x₂ - x₁ independently, then divide. An undefined slope means run = 0 (vertical line).