Estimate a value between two known data points, assuming the relationship between them is a straight line.
How it works
The formula is y = y₁ + (x – x₁) × (y₂ – y₁) ÷ (x₂ – x₁). Between the points (0, 0) and (10, 100), the value at x = 3 interpolates to y = 30.
What this does not include
This assumes a straight-line relationship between the two known points — if the real relationship curves, linear interpolation only approximates it, with more error the further the true curve departs from a straight line.
How to use this calculator
- Enter the two known points (x₁, y₁) and (x₂, y₂).
- Enter the x-value you want to estimate y for.
A worked example
Points (0,0) and (10,100), interpolating at x=3: y = 0 + (3−0)/(10−0) × (100−0) = 30.
Points (20,68) and (30,86), interpolating at x=25 (the midpoint): y = 77, exactly halfway between 68 and 86.
What the variables mean
| Variable | Meaning |
|---|---|
| (x1,y1), (x2,y2) | Two known data points |
| x | The point to estimate y for, between x1 and x2 |
Edge cases worth knowing
Linear interpolation assumes a straight line between the two known points — it’s an estimate, not necessarily the true value if the actual relationship curves between those points.
Identical x1 and x2 values make interpolation impossible — there’s no line to interpolate along with zero horizontal distance between the points, so the calculator declines to show a result.
When is linear interpolation a reasonable estimate?
It works best when the two known points are close together and the underlying relationship is smooth — the wider the gap or the more curved the real relationship, the less accurate a straight-line estimate becomes.
What if x falls outside the range between x₁ and x₂?
The formula still computes an answer (called extrapolation instead of interpolation), but the further outside the known range you go, the less reliable that estimate becomes.
Where is linear interpolation commonly used?
Reading a value between two rows of a lookup table, estimating between two calibration points, and filling gaps in a dataset are all common uses.