Slope between two points is one of 4 lines formulas in the algebra section of this library, and it is used at high school level.
Why slope between two points works
Slope compares two changes. Moving from one point to the other, the height changes by y2 minus y1 while the horizontal position changes by x2 minus x1. Dividing turns that pair into a single number: the rise per one unit of run. Because the graph is straight, that ratio comes out the same no matter which pair of points you pick off the line.
What each symbol means
$(x_1,y_1)$ and $(x_2,y_2)$ are points; $m$ is slope.
Slope between two points: when it holds
$x_2\ne x_1$; a vertical line has undefined slope.
When it stops applying
When the two points sit directly above each other, x2 equals x1 and the denominator is zero. The line is vertical and its slope is undefined, not zero. Report it as x = c rather than forcing a number out of the division.
Slope between two points: a worked example
Through $(1,2)$ and $(5,10)$, $m=(10-2)/(5-1)=2$.
The mistake to avoid
What people do: m = (x2 - x1) / (y2 - y1), with the horizontal change on top.
Why it goes wrong: That is run over rise, so it hands back the reciprocal of the real slope. A steep line then looks shallow and a shallow line looks steep.
Do this instead: Say the words while you write: rise on top, run on the bottom. Label the two points first, then subtract the y values into the numerator.
Slope between two points: step by step
- Name the unknown, and the unit the answer has to come out in.
- Match the symbols to your values. $(x_1,y_1)$ and $(x_2,y_2)$ are points; $m$ is slope.
- Check the conditions before substituting. $x_2\ne x_1$; a vertical line has undefined slope.
- Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most algebra slips.
Where this formula fits
- Subject
- Algebra formulas — 28 entries in this library
- Topic
- Lines
- Level
- High school
Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where slope between two points comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.
- How to Solve Linear Equations — the lesson behind this formula: balance equations one reversible step at a time.
- Slope Intercept Form Calculator — check your substitution and the value it produces.
- Study algebra — the subject guide that explains the ideas these formulas compress.
- Algebra I Practice — questions that make you retrieve the formula instead of recognising it.
- All 28 algebra formulas — the full grouped reference, or the complete formula library.
Questions about slope between two points
Does it matter which point I call point 1?
No. Swapping them flips the sign on top and on the bottom, and those two sign flips cancel. Through (1,2) and (5,10) you get 8/4 = 2 one way and -8/-4 = 2 the other.
What is the difference between zero slope and undefined slope?
Zero slope means the rise is zero and the line is flat, like y = 3. Undefined slope means the run is zero and the line is vertical, like x = 3. They are opposite situations, not the same one.
Can slope be a fraction or a decimal?
Yes, and a fraction is usually more useful for graphing. A slope of 3/4 tells you to move up 3 and right 4 from any point on the line to land on another one.
How do I tell from the slopes whether two lines are parallel?
Parallel lines have exactly equal slopes and different intercepts. Perpendicular lines have slopes that multiply to -1, so a line of slope 2 is perpendicular to one of slope -1/2.