Short answer
The gradient between two points (x₁, y₁) and (x₂, y₂) is found by dividing the change in y by the change in x: m = (y₂ − y₁) ÷ (x₂ − x₁). A positive result means the line rises left to right; negative means it falls; zero means horizontal; undefined (division by zero) means vertical.
At a glance
- Key stage
- GCSE
- Subject
- Algebra
- Type
- How-to guide
- For
- Students
- Read time
- 4 min
- Last updated
- 21 October 2026
Where this fits
- Key Stage 3Years 7–9
- GCSEYears 10–11This article
Method at a glance
- Label the two points
- Calculate the change in y
- Calculate the change in x
- Divide
- Simplify
What does gradient measure?
Gradient measures the steepness of a straight line — how much y changes for every 1-unit increase in x. It is also called the slope.
Gradient = rise ÷ run = (vertical change) ÷ (horizontal change)
The formula with coordinates:
m = (y₂ − y₁) ÷ (x₂ − x₁)
It does not matter which point you label (x₁, y₁) and which you label (x₂, y₂), as long as you use the same point for both the y-part and the x-part of the calculation.
How do you apply the formula?
Method at a glance:
- Label the two points. Write (x₁, y₁) for the first and (x₂, y₂) for the second.
- Calculate the change in y. Subtract: y₂ − y₁.
- Calculate the change in x. Subtract: x₂ − x₁ (using the same order).
- Divide. m = (y₂ − y₁) ÷ (x₂ − x₁).
- Simplify the fraction if possible. Write the gradient as a fraction or decimal.
Worked examples
Example 1: Find the gradient of the line joining A(2, 5) and B(6, 13).
- Change in y: 13 − 5 = 8
- Change in x: 6 − 2 = 4
- m = 8 ÷ 4 = 2
The line rises by 2 units for every 1 unit to the right. ✓
Example 2: Find the gradient of the line joining P(−1, 7) and Q(3, −1).
- Change in y: −1 − 7 = −8
- Change in x: 3 − (−1) = 4
- m = −8 ÷ 4 = −2
The negative value confirms the line falls from left to right. ✓
Example 3: Find the gradient of the line joining C(0, 4) and D(5, 4).
- Change in y: 4 − 4 = 0
- Change in x: 5 − 0 = 5
- m = 0 ÷ 5 = 0
Zero gradient means the line is horizontal. ✓
Example 4: Find the gradient of the line joining E(3, 1) and F(3, 8).
- Change in y: 8 − 1 = 7
- Change in x: 3 − 3 = 0
- m = 7 ÷ 0 — undefined
Zero in the denominator means the line is vertical and has no defined gradient. ✓
What do different gradient values tell you?
| Gradient value | Line appearance |
|---|---|
| Large positive (e.g. 5) | Steeply rising left to right |
| Small positive (e.g. 0.2) | Gently rising left to right |
| Zero | Horizontal |
| Small negative (e.g. −0.2) | Gently falling left to right |
| Large negative (e.g. −5) | Steeply falling left to right |
| Undefined | Vertical |
Why does it not matter which point you call (x₁, y₁)?
If you swap the labels, both the numerator and denominator change sign:
Using A(2, 5) and B(6, 13) the other way: m = (5 − 13) ÷ (2 − 6) = −8 ÷ −4 = 2. Same answer. ✓
The crucial rule: both subtractions must use the same order — if you put the second point's y-value first in the numerator, you must also put the second point's x-value first in the denominator.
How does the formula connect to y = mx + c?
Once you have the gradient m from two points, you can find the equation of the line. Substitute one of the known points into y = mx + c and solve for c. This gives the full equation of the straight line through both points.
Example (continuing Example 1): m = 2; point A(2, 5). 5 = 2(2) + c → 5 = 4 + c → c = 1. Equation: y = 2x + 1 ✓ Check with B(6, 13): 2(6) + 1 = 13 ✓
Frequently asked questions
Can the gradient be a fraction?
Yes — fractions are common. For example, the gradient between (1, 3) and (4, 5) is (5 − 3) ÷ (4 − 1) = 2/3. Leave the answer as a fraction unless the question asks for a decimal.
What if the two points are the same?
If both coordinates are identical, the "line" is just a point — gradient is undefined in that case. This will not happen in a well-posed exam question.
How is gradient different from "rate of change"?
They are the same thing in different contexts. On a distance–time graph, gradient equals speed. On a cost–quantity graph, gradient equals cost per item. "Gradient" is the mathematical term; "rate of change" is used when the axes have real-world units.
If the gradient is negative, does the formula still give the right answer?
Yes — as long as you keep the sign throughout. Take care when subtracting a negative: x₂ − x₁ = 3 − (−1) = 3 + 1 = 4, not 3 − 1 = 2. Missing the double-negative step is the most common error in gradient calculations.
Professor Pi guides you through straight-line graphs from coordinates to equations — add the AI Tutors connector at aitutors.me.
Key terms
- gradient
- slope
- rise ÷ run
- Label the two points
- Divide
- Simplify
- horizontal
- undefined