Slope from two points
m
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.
m=2
m equals (11 minus 3) divided by (5 minus 1), equals 8 divided by 4, equals 2
Den här sidan finns på svenska. Byt till svenska
Definition — what does that mean?
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
m
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.
m=2
m equals (11 minus 3) divided by (5 minus 1), equals 8 divided by 4, equals 2
You are given
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.
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.
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.
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.
| 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.
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.
| Solve for | Rearranged | With the numbers | Comes to |
|---|---|---|---|
| x₁ | x₂ | 5 | 1 |
| y₁ | y₂ | 11 | 3 |
| x₂ | x₁ | 1 | 5 |
| y₂ | m(x₂ | 2(5 | 11 |
| m | y₂ | 11 | 2 |
Last reviewed October 6, 2026 ·How pages are reviewed
Sheets that ask this formula, with their answer keys. Open one to see the questions or print it.
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.
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.