To find the slope from two points, subtract the y-values and divide by the difference in x-values: slope = (y₂ − y₁) ÷ (x₂ − x₁). Using points (2, 3) and (6, 11), the slope is (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2. The single condition that breaks this: the two x-values must differ. If x₁ equals x₂, the line is vertical and the slope is undefined, no matter what the y-values are.

That one restriction trips up more students than any arithmetic mistake. The formula itself is short enough to memorize in a minute. Applying it correctly — keeping the subtraction order straight, spotting a vertical line, reading the sign of the result — is where most errors happen.

What the slope formula actually measures between two coordinates

Slope is a ratio of vertical change to horizontal change, and the formula simply formalizes "rise over run." Take points (1, 2) and (4, 10). The rise is 10 − 2 = 8, the run is 4 − 1 = 3, and the slope is 8/3, roughly 2.67. Every unit you move right, the line climbs about 2.67 units.

Khan Academy's algebra curriculum defines slope the same way: the change in y divided by the change in x between any two distinct points on a line. The definition matters because it explains why slope is constant. Pick any two points on the same straight line — (1, 2) and (4, 10), or (4, 10) and (7, 18) — and you get 8/3 both times. That consistency is what makes a line straight.

Order matters less than consistency. If you subtract the second point's coordinates from the first, you get (2 − 10) ÷ (1 − 4) = −8/−3 = 8/3. Both negatives cancel. The only rule is that the x-subtraction and y-subtraction must follow the same point order. Mixing them — y₂ − y₁ over x₁ − x₂ — flips the sign and produces a wrong answer.

The formula appears in most U.S. algebra textbooks as m = (y₂ − y₁)/(x₂ − x₁), with m standing for slope. The letter choice is a historical convention, not an abbreviation for anything meaningful in English. What matters is that m captures steepness and direction in a single number, which is why it feeds directly into the slope-intercept form y = mx + b.

How to find slope from two points in four ordered steps

Here is the full procedure, in the order you should perform it. Each step assumes you have two coordinate pairs written as (x₁, y₁) and (x₂, y₂).

1: Label the coordinates. Write the first point's x as x₁ and its y as y₁, then the second point's values as x₂ and y₂. Labeling before calculating prevents the most common error: plugging values into the wrong slots. 2: Check that x₁ ≠ x₂. If the two x-values match, stop — the line is vertical and the slope is undefined. This check takes two seconds and saves you from dividing by zero. 3: Subtract y₂ − y₁, then subtract x₂ − x₁. Keep both subtractions in the same point order. For points (2, 3) and (6, 11): 11 − 3 = 8 and 6 − 2 = 4. 4: Divide the y-difference by the x-difference and simplify. 8 ÷ 4 = 2. If the fraction reduces, reduce it; if both terms are negative, the result is positive.

Worked once more with negatives, since that is where errors cluster. Points (−3, 5) and (1, −7). Step three gives −7 − 5 = −12 and 1 − (−3) = 4. Step four gives −12 ÷ 4 = −3. The line falls three units for every unit right. That negative sign is the whole answer to "is this line going down" — you do not need to graph it.

If you swap the point order, you get 5 − (−7) = 12 over −3 − 1 = −4, which is also −3. Same result. If you get +3 instead, you subtracted the y-values in one order and the x-values in the other. Go back to step one and relabel.

A slope-sign table that catches the four most common wrong answers

Most incorrect slope answers are not random arithmetic slips. They come from four predictable mistakes, and a sign-and-setup check catches all of them before you submit anything.

Your result What it usually means Fix
Wrong sign (+ instead of −) Subtractions done in opposite point orders Subtract both in the same order
Slope of 0 when the line is vertical Divided by zero incorrectly or ignored matching x-values Vertical lines have undefined slope, not 0
Slope of "undefined" when the line is horizontal Confused a flat line with a vertical one Horizontal lines (matching y-values) have slope 0
Fraction that never reduces Values plugged into wrong slots Relabel x₁, y₁, x₂, y₂ and restart

The zero-versus-undefined distinction deserves its own sentence, because it is the single most tested misconception in slope lessons. A horizontal line like the one through (2, 5) and (7, 5) has slope (5 − 5) ÷ (7 − 2) = 0 ÷ 5 = 0. Zero slope means flat. A vertical line through (4, 1) and (4, 9) has slope (9 − 1) ÷ (4 − 4) = 8 ÷ 0, which is undefined because division by zero has no value. Flat is zero; straight up is undefined.

Watch for a subtler version of the same trap: points that share an x-value after sign changes. (3, 2) and (3, −8) look different at a glance, but both x-values are 3, so the denominator is 3 − 3 = 0 and the slope is undefined. Scan the x-column first on every problem.

Worked example: slope from a table of values

Tables are where slope problems quietly get harder, because you have to choose which two rows to use. Consider a table showing x-values 0, 2, 4, 6 paired with y-values 1, 7, 13, 19.

Pick any two rows — say x = 0, y = 1 and x = 6, y = 19. The slope is (19 − 1) ÷ (6 − 0) = 18 ÷ 6 = 3. Now try adjacent rows: x = 2, y = 7 and x = 4, y = 13 gives (13 − 7) ÷ (4 − 2) = 6 ÷ 2 = 3. Same answer, which confirms the table represents a straight line.

The choice of rows is a genuine test of understanding. If two different row pairs give different slopes, the relationship is not linear and "the slope" does not exist as a single number. That is worth checking on any table problem before you commit to an answer.

Tables also let you shortcut. When x-values increase by a constant step — here, 2 — and y-values increase by a constant step — here, 6 — the slope is just the y-step divided by the x-step: 6 ÷ 2 = 3. This is the same arithmetic as the formula, done on the differences column. Use it as a cross-check, not a replacement, since it only works when the x-steps are equal.

If a table lists y-values that rise by 6, then 6, then 12, the relationship is not linear. The third pair of rows — say x = 4, y = 13 and x = 6, y = 25 — gives a slope of 12 ÷ 2 = 6, which contradicts the earlier 3. No single slope describes that table, and any answer claiming one does is wrong.

Reverse the formula to find a missing coordinate from a known slope

A common variation gives you the slope and three of the four coordinates, then asks for the missing value. Suppose a line passes through (2, 4) and (x, 10) with a slope of 3. Set up the formula with the unknown in place: (10 − 4) ÷ (x − 2) = 3.

Solve in two moves. First, 6 ÷ (x − 2) = 3. Then multiply both sides by (x − 2): 6 = 3(x − 2), so x − 2 = 2 and x = 4. Check it: (10 − 4) ÷ (4 − 2) = 6 ÷ 2 = 3. The unknown coordinate is 4.

The solving step follows a fixed pattern worth memorizing: cross-multiply, then isolate. Starting from (y₂ − y₁) ÷ (x₂ − x₁) = m, cross-multiplication gives y₂ − y₁ = m(x₂ − x₁). Everything else is ordinary equation solving, which is why this variation usually appears in algebra courses right after the basic formula.

Two failure cases show up here. If the resulting equation puts the unknown in a denominator that solves to zero — say x − 2 = 6 ÷ 3 leads to x = 2 — then no such point exists with that slope, because you would be dividing by zero. And if the known slope is zero with two different y-values, no solution exists at all: a flat line cannot pass through points at different heights.

Graph to slope and slope to graph without plugging numbers into the formula

On a graph, you can read slope directly by counting grid squares, and the count should match the formula. Take two plotted points at (1, 3) and (5, 7). Start at the left point, move up 4 squares and right 4 squares to reach the second point. That gives rise 4 over run 4, or slope 1. The formula confirms it: (7 − 3) ÷ (5 − 1) = 4 ÷ 4 = 1.

The counting method is fastest when the points sit exactly on grid intersections. Up-and-right movement means positive slope; down-and-right means negative. Counting also builds the intuition that slope is a direction as much as a number, which pure formula practice can miss.

When a point falls between grid lines, counting produces an estimate, not an answer. (1, 2.5) and (4, 6.2) do not sit on clean intersections, so the formula — (6.2 − 2.5) ÷ (4 − 1) = 3.7 ÷ 3, about 1.23 — is the reliable route. Use counting for confirmation, not as a substitute, on any graph that is not drawn to exact grid values.

Going the other direction, from a slope and one point to a graph, place the known point, then use the slope as directions: slope 2 means go up 2, right 1 repeatedly; slope −1/3 means down 1, right 3. Three applications of the direction gives you three plotted points, enough to draw the line. The slope-intercept form y = mx + b enters here if you need the intercept, but it is not required for graphing from two points.

Real pitfalls: sign slips, mismatched order, and vertical lines in standardized tests

Standardized tests write slope problems to target specific errors. One College Board-style algebra item presents points (5, −2) and (−1, 8) and offers four sign options. The correct slope is (8 − (−2)) ÷ (−1 − 5) = 10 ÷ (−6) = −5/3. The wrong options usually include +5/3, which appears when a student handles only one of the two negative differences correctly.

Mismatched point order produces that cleanly wrong answer every time, which is why it is a favorite distractor. Point order flipped in one row — y-values as y₂ − y₁ but x-values as x₁ − x₂ — gives (10) ÷ (6) = 5/3. The magnitude matches; the sign does not. If your answer is present in the options with the opposite sign, that is a signal to recheck order rather than choose the option that looks closest.

Vertical-line problems are rarer but still appear. A question that gives (4, 1) and (4, 7) and asks for slope is looking for the answer "undefined," and many multiple-choice sets include 0 as a tempting distractor. The x-column check from earlier catches this in two seconds.

The practical habit for tests: label the two points before touching the calculator, scan the x-column for a match, then compute. Labeling takes about ten seconds and eliminates the three highest-frequency errors on slope questions. The slope-intercept form and point-slope form both build on a correct slope, so a sign error here propagates through an entire multi-part problem.

What ctx and m mean, and why the vertical-line check changes the rule

Two pieces of vocabulary confuse students more than the arithmetic. First, the letter m denotes slope by convention, and the constant b in y = mx + b is the y-intercept — the y-value where the line crosses the vertical axis. Neither letter is a coded abbreviation; treat them as fixed symbols the way you treat ÷ as a division sign.

Second, the horizontal-versus-vertical asymmetry. Horizontal lines have a slope of exactly 0 because the numerator (change in y) is zero while the denominator is not. Vertical lines have no slope because the denominator (change in x) is zero, and division by zero is undefined across all standard algebra. This is not a quirk of notation — it reflects that steepness has no finite value when a line goes straight up.

Coordinate geometry treats the vertical case as a special rule rather than a gap. Any two distinct points define a unique line, but only a vertical line fails to have a slope. That exception shows up in later topics — perpendicular lines have slopes whose product is −1, which requires both slopes to exist — and it is worth learning now as a property of vertical lines rather than as a formula footnote.

One adjacent concept: the y-intercept can be computed once you have the slope. With m known and one point (x₁, y₁), the intercept is b = y₁ − m·x₁. Slope first, intercept only if the problem asks. Chasing the intercept before the slope is right just multiplies the work.

Why slope stays the same no matter which two points you choose, with one caution

On a straight line, any two pairs produce the same slope, and the check is fast. A line through (0, 1) and (3, 7) has slope (7 − 1) ÷ (3 − 0) = 6 ÷ 3 = 2. Pick a farther pair on the same line, (0, 1) and (6, 13): (13 − 1) ÷ (6 − 0) = 12 ÷ 6 = 2. The farther pair has larger differences but the same ratio, because both changes grew proportionally.

This invariance is why slope is a property of the line, not of the chosen points. If the invariance fails, the points do not lie on a single straight line, and you are looking at a curve or a mistyped coordinate. Visually, three collinear points form a straight row; if one point sits off the line, any slope computation that includes it will disagree with the others.

The caution: "any two points" means distinct points. Two identical points give 0 ÷ 0, which is undefined and tells you nothing about direction. Some problems dress this up by repeating coordinates in disguise, like (2, 3) and (2, 3) listed with different labels.

Also watch rounding behavior when you reuse a slope. If the true slope is 8/3 ≈ 2.67 and you round to 2.7 before computing a second point, your second point drifts off the line. Keep slopes as exact fractions through intermediate steps, and round only the final displayed answer.

FAQ

What is the slope of a line through (2, 3) and (8, 15)?

The slope is 2. Subtracting gives 15 − 3 = 12 and 8 − 2 = 6, and 12 ÷ 6 = 2. That means the line rises two units for every one unit it moves right. If your answer came out as 1/2, the y and x differences were swapped.

Do I subtract in a required order?

No, but both subtractions must be consistent. Using (6, 11) and (2, 3), the order y₂ − y₁ over x₂ − x₁ gives 8/4, and reversing both gives −8/−4 — still 2. Reversing only one gives −2. The pattern is: swap nothing or swap everything.

What happens if both points have the same y-value?

The slope is 0, and the line is horizontal. For (1, 4) and (9, 4), the calculation is (4 − 4) ÷ (9 − 1) = 0 ÷ 8 = 0. The line stays at the same height all the way across. Some students answer "no slope," which is the vertical-line result, and that is wrong here.

Can a slope come out as a whole number and still be a fraction?

Yes, and that is the simplified form. Points (0, 2) and (5, 17) give (17 − 2) ÷ (5 − 0) = 15 ÷ 5 = 3. Three is the fully reduced version of 15/5. Reducing is not optional in most graded work — a slope of 10/15 is expected to be written as 2/3.

Why does the calculator say "error" on a vertical-line problem?

Because the x-difference is zero when the two x-coordinates match, and division by zero is undefined. Points (4, 1) and (4, 9) produce 8 ÷ 0. The correct written answer is "undefined," not 0. A calculator error message is often the correct signal on a slope problem.

Is the y-intercept needed to find slope from two points?

No. The slope depends only on the two points, not on where the line crosses the y-axis. Finding b = y₁ − m·x₁ becomes necessary only when the question asks for the full equation, such as y = 2x + 1, rather than the slope alone.

What if a table gives different slopes for different row pairs?

Then the relationship is not linear, and no single slope exists. A table where x rises by 1, 1, 2 but y rises by 3, 5, 9 gives slopes of 3, 5, and 4.5 — three different answers. The correct conclusion is that the points do not lie on one line.

Which pairs in a table of values can I use?

Any two rows, as long as the relationship is linear. With x = 1, 3, 5 paired with y = 2, 10, 18, using rows 1 and 3 gives (18 − 2) ÷ (5 − 1) = 4, and using adjacent rows gives (10 − 2) ÷ (3 − 1) = 4. Matching slopes across row choices is the proof of linearity.