Skip to content
LoveToCalc

Definition — what does that mean?

Slope from two points

Two points on a line are enough to find how steep it is — the change in y divided by the change in x.

In Swedish: Riktningskoefficient ur två punkter

Slope from two points

The relation

m=y₂−y₁x₂−x₁

The change in y divided by the change in x. Both differences have to be taken in the same order, from the same point to the same point.

Solve for

m=2

m equals (11 minus 3) divided by (5 minus 1), equals 8 divided by 4, equals 2

Working3 steps

Practice questions

You are given

  • y₂=12
  • y₁=2
  • x₂=9
  • x₁=4

The formula

The line through (1, 3) and (5, 11): the top is 11 − 3 = 8, the bottom is 5 − 1 = 4, and m = 8 / 4 = 2. The line rises two in y for every one across.

Both differences, the same way round

Take the points in the other order and the top and the bottom both change sign, so the answer is the same. The error comes from reversing only one:

Reverse one of them and you get −2, and a line that rises appears to fall. The answer is still a number and still a plausible line, and nothing in the working shows the error. Decide which point is the first one and keep it that way through the whole calculation.

An example that falls

The line through (1, 7) and (3, 1): (1 − 7) / (3 − 1) = −6 / 2 = −3. A negative slope means the line falls — three down in y for every one to the right.

On to the equation of the line

With m in hand, the equation of a straight line is one step away: put one of the points into y = mx + c and solve for c.

With m = 2 and the point (1, 3): 3 = 2 · 1 + c, so c = 1, and the line is y = 2x + 1.

Vertical and horizontal

The line x₂ − x₁ y₂ − y₁ m
Rising > 0 > 0 positive
Falling > 0 < 0 negative
Horizontal > 0 0 0
Vertical 0 ≠ 0 none

A horizontal line has m = 0, which is a perfectly good value. A vertical line has no slope at all: the bottom of the fraction is 0, and no number describes how steep it is. The card above says so rather than answering.

Common mistakes

Common questions

Is it m or k? Both. English-language textbooks write m for the slope and c or b for the intercept; Swedish and German textbooks write k and m, so m means the slope in one convention and the intercept in the other. The letters differ; the formula does not.

Does it matter which point is first? No, as long as you are consistent. Both orders give the same m, because both differences change sign together.

Can I use this on a curve? You get the slope of the straight line between the two points, not the slope of the curve. That number is the average rate of change. The derivative is the limit of that number as the points close together.

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearrangedWith the numbersComes to
x₁x₂−y₂−y₁m5−11−321
y₁y₂−m(x₂−x₁)11−2(5−1)3
x₂x₁+y₂−y₁m1+11−325
y₂m(x₂−x₁)+y₁2(5−1)+311
my₂−y₁x₂−x₁11−35−12

Last reviewed October 6, 2026 ·How pages are reviewed

Ready-made worksheets with this formula

Sheets that ask this formula, with their answer keys. Open one to see the questions or print it.

High school

  • Equation of a straight line

    Eight questions on the equation of a line, asking for x, y or the intercept, and eight on the slope between two points, sometimes asking for a coordinate.

Straight linesAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.