Allday Education

The Slope Formula

Slope measures how steep a line is — how much the line goes up or down each time you move one unit to the right. A slope of 22 means the line climbs 22 units for every 11 unit right. A slope of 12-\dfrac{1}{2} means it drops half a unit for every 11 unit right.

If you know two points on a line, you can compute its slope directly with the slope formula: m=y2y1x2x1m = \dfrac{y_2 - y_1}{x_2 - x_1}. No graph needed — just two subtractions and a division. This one formula shows up everywhere in Algebra 1, so it's worth making automatic.

The formula, piece by piece

Call your two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2). The slope is m=y2y1x2x1m = \dfrac{y_2 - y_1}{x_2 - x_1} — the change in yy on top, the change in xx on the bottom.

The top, y2y1y_2 - y_1, tells you how far the line moved vertically between the two points. The bottom, x2x1x_2 - x_1, tells you how far it moved horizontally. Dividing gives the vertical change per one unit of horizontal change — that's the intuition people call rise over run, but the formula itself is always y2y1x2x1\dfrac{y_2 - y_1}{x_2 - x_1}.

In the graph below, the line passes through (1,1)(1, 1) and (3,5)(3, 5). Between those points, yy changed by 51=45 - 1 = 4 while xx changed by 31=23 - 1 = 2, so m=42=2m = \dfrac{4}{2} = 2.

-3-2-112345-3-2-112345xy

Keep the order consistent

It does not matter which point you call (x1,y1)(x_1, y_1) — but once you choose, you must subtract in the same order on top and bottom. If you write y2y1y_2 - y_1 on top, the bottom must be x2x1x_2 - x_1, not x1x2x_1 - x_2. Mixing the order flips the sign of your answer, and a wrong sign means a line that tilts the wrong way.

Negative coordinates are where most slope mistakes happen. Subtracting a negative becomes addition: with points (3,4)(-3, 4) and (2,6)(2, -6), the bottom is 2(3)=52 - (-3) = 5, not 1-1. Write out the substitution with parentheses before simplifying anything.

Zero slope and undefined slope

If the two points have the same yy-value, the top of the formula is 00, so the slope is 00 — a horizontal line. Zero slope is a perfectly good slope: the line is flat, not missing.

If the two points have the same xx-value, the bottom of the formula is 00, and dividing by zero is not allowed — the slope is undefined. That's a vertical line. Keep these two straight: horizontal means slope 00, vertical means no slope at all.

Worked examples

Example 1: two positive points

Find the slope of the line through (1,4)(1, 4) and (3,10)(3, 10).

Label the points(x1,y1)=(1,4),(x2,y2)=(3,10)(x_1, y_1) = (1, 4), \quad (x_2, y_2) = (3, 10)
Write the formulam=y2y1x2x1m = \dfrac{y_2 - y_1}{x_2 - x_1}
Substitutem=10431m = \dfrac{10 - 4}{3 - 1}
Simplifym=62=3m = \dfrac{6}{2} = 3

Answer: m=3m = 3

Example 2: negative coordinates

Find the slope of the line through (2,6)(-2, 6) and (4,6)(4, -6).

Label the points(x1,y1)=(2,6),(x2,y2)=(4,6)(x_1, y_1) = (-2, 6), \quad (x_2, y_2) = (4, -6)
Substitute with parenthesesm=664(2)m = \dfrac{-6 - 6}{4 - (-2)}
Simplify top and bottomm=126m = \dfrac{-12}{6}
Dividem=2m = -2

Answer: m=2m = -2

Example 3: a fraction answer

Find the slope of the line through (2,3)(2, 3) and (6,5)(6, 5).

Substitutem=5362m = \dfrac{5 - 3}{6 - 2}
Simplifym=24m = \dfrac{2}{4}
Reduce the fractionm=12m = \dfrac{1}{2}

Answer: m=12m = \dfrac{1}{2}

Example 4: either point can go first

Find the slope of the line through (1,5)(1, 5) and (6,3)(6, 3), both ways.

Take (1,5)(1, 5) firstm=3561=25m = \dfrac{3 - 5}{6 - 1} = \dfrac{-2}{5}
Now take (6,3)(6, 3) firstm=5316=25m = \dfrac{5 - 3}{1 - 6} = \dfrac{2}{-5}
Both give the same slopem=25m = -\dfrac{2}{5}

Answer: m=25m = -\dfrac{2}{5} either way — the order only has to be consistent

Try one yourself

-5-4-3-2-112345-4-2246xy

Common questions

Does it matter which point I call (x1,y1)(x_1, y_1)?

No — either point can go first. What matters is consistency: subtract the points in the same order on top and bottom. If y2y_2 comes first on top, x2x_2 must come first on the bottom.

What if I get 00 on the top or the bottom?

A 00 on top means the slope is 00 and the line is horizontal. A 00 on the bottom means the slope is undefined and the line is vertical, because dividing by zero is not allowed.

Should I leave the slope as a fraction?

Yes, reduced. A slope like 64\dfrac{6}{4} should be written 32\dfrac{3}{2}. Fractions are often more useful than decimals here, because the top and bottom tell you exactly how to step along the line when graphing.

Want the video version?

Allday Everyday Math has video lessons, practice, and an AI tutor for every topic, Pre-Algebra through Algebra 2.

Try it for $1