Linear interpolation: estimate a value between two points
Calculate an intermediate value on a straight line and recognise when you are extrapolating instead.
Decide whether a line is appropriate
Linear interpolation assumes a straight-line relationship between two known points. It gives an estimate under that assumption, not proof that the real process is linear. Avoid using it for a safety-critical decision without an appropriate model.
Find the slope
Take the points (2, 10) and (6, 30). The change in y is 20 and the change in x is 4, so the slope is 20 ÷ 4 = 5. In this model, moving one x-unit increases y by five y-units.
Compare the example
Straight line through (2, 10) and (6, 30)
| Selected x | Estimated y | Type |
|---|---|---|
| 2 | 10 | Endpoint |
| 3 | 15 | Interpolation |
| 4 | 20 | Interpolation |
| 8 | 40 | Extrapolation |
On a small screen, scroll the table sideways if needed.
Try this in the calculator
Enter x₁ = 2, y₁ = 10, x₂ = 6 and y₂ = 30. Compare x = 3 with x = 8. Use the graph to see why the second value lies beyond the observed interval.
Try the example ↗Estimate the value at x = 3
Start at y = 10 and move one x-unit from x = 2. The estimate is 10 + (3 − 2) × 5 = 15. More generally, y = y₁ + (x − x₁) × (y₂ − y₁) ÷ (x₂ − x₁). Keep the units consistent between both known points.
Recognise extrapolation
At x = 8, the same line gives y = 40, but 8 lies outside the interval from 2 to 6. That is extrapolation. The algebra still works, while the real-world assumption can become less defensible beyond the observed interval.
Check the inputs and graph
The two x-values must differ; otherwise the denominator is zero. Use the tool’s line chart to locate the selected point and compare it with the endpoints. A straight plotted line shows the chosen model, not additional observations.