Linear interpolation is one of the most useful tools in math, science and engineering, and it's simpler than the name suggests. If you know two values and want a value somewhere between them, linear interpolation draws a straight line between the two and reads off the answer.
The formula in plain English
y = y₁ + (x − x₁) × (y₂ − y₁) / (x₂ − x₁)
In words: start at the first known value, figure out how far along you are toward the second value, and move that same fraction of the way. If you're halfway between the two x values, the answer is halfway between the two y values.
Example 1: Estimating a temperature
A weather station recorded 50°F at 6 a.m. and 62°F at 9 a.m. What was the temperature at 7 a.m.?
- Points: (6, 50) and (9, 62).
- Slope: (62 − 50) / (9 − 6) = 12 / 3 = 4°F per hour.
- Distance from 6 a.m.: 1 hour.
- Answer: 50 + 1 × 4 = 54°F.
Example 2: Reading an engineering table
Engineering tables often list values only at certain intervals. Suppose a table gives a value of 0.800 at 40 and 0.880 at 60, but you need the value at 45.
- Slope: (0.880 − 0.800) / (60 − 40) = 0.080 / 20 = 0.004.
- Distance from 40: 5.
- Answer: 0.800 + 5 × 0.004 = 0.820.
This is exactly how engineering students use steam tables, gas tables and material property charts.
Example 3: Estimating an interest rate
Suppose a 2-year rate is 4.0% and a 5-year rate is 4.6%, and you want a rough estimate for 3 years.
- Slope: (4.6 − 4.0) / (5 − 2) = 0.6 / 3 = 0.2% per year.
- Distance from 2 years: 1 year.
- Answer: 4.0 + 0.2 = 4.2%.
Analysts use more advanced methods for real yield curves, but linear interpolation is a common first estimate.
Example 4: A child's growth chart
A child was 40 inches tall at age 4 and 45 inches tall at age 6. About how tall were they at age 5 and a half?
- Slope: (45 − 40) / (6 − 4) = 2.5 inches per year.
- Distance from age 4: 1.5 years.
- Answer: 40 + 1.5 × 2.5 = 43.75 inches.
Real growth isn't perfectly linear, so this is an estimate — but a reasonable one over a short period.
Example 5: Animation in video games
Game developers use linear interpolation (often called “lerp”) to move objects smoothly. If a character moves from x = 100 to x = 300 over one second, where is it after 0.25 seconds?
- Fraction of the way: 0.25.
- Distance to cover: 300 − 100 = 200.
- Answer: 100 + 0.25 × 200 = x = 150.
When linear interpolation isn't enough
Linear interpolation assumes a straight line between the points. That works well when the points are close together or the relationship really is linear. For data that curves sharply — such as population growth or the cooling of a hot object — the estimate can be off. In those cases, use points closer to your target value or a curve-fitting method.
Also be careful with extrapolation, which means estimating outside the range of your two points. The farther you go beyond your data, the less reliable a straight-line estimate becomes.
Try it yourself
You can check any of these examples with our free linear interpolation calculator. It shows the formula with your numbers, the slope, the line equation and a warning if you're extrapolating.