Search the complete library

What do you want to learn or calculate?

Quick linksAll calculatorsMath subjectsPractice questionsFormula library
← Algebra formulas

Slope between two points

Measure vertical change per unit of horizontal change.

Algebra · Lines
$$m=\frac{y_2-y_1}{x_2-x_1}$$

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

  1. Name the unknown, and the unit the answer has to come out in.
  2. Match the symbols to your values. $(x_1,y_1)$ and $(x_2,y_2)$ are points; $m$ is slope.
  3. Check the conditions before substituting. $x_2\ne x_1$; a vertical line has undefined slope.
  4. 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.

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.

Stuck on a problem?

Work a slope between two points problem step by step

Type your own problem, or upload a photo of it. You get the method, the answer, and a check you can repeat yourself.