Linear Interpolation Formula – How to Estimate Unknown Values (2026)
In engineering and science, you often have a table of known values but need an intermediate value that is not listed. For example, steam tables in thermodynamics, stress-strain curves, or temperature-density relationships. Linear interpolation is the simplest and most common method to estimate an unknown value between two known data points assuming the relationship is approximately linear. In this guide, I will explain the linear interpolation formula, walk through several practical examples, and show you how to avoid common mistakes. There is also a free calculator tool at the end.
The Linear Interpolation Formula
Assume you have two known points: (x1, y1) and (x2, y2) with x1 < x < x2. You want to find y at x. The formula assumes a straight line between the two points.
Alternatively, you can write it as a ratio of differences:
The second form is easier to remember: the slope from (x1,y1) to (x,y) equals the slope from (x1,y1) to (x2,y2).
Step-by-Step Example 1 – Basic Numeric Interpolation
Suppose you have a dataset of temperature and pressure. At 30°C, pressure is 1.2 bar. At 40°C, pressure is 1.5 bar. Estimate pressure at 35°C.
x2 = 40, y2 = 1.5
x = 35
y = 1.2 + (35 – 30) × (1.5 – 1.2) / (40 – 30)
= 1.2 + 5 × 0.3 / 10 = 1.2 + 1.5 / 10 = 1.2 + 0.15 = 1.35 bar.
So at 35°C, estimated pressure is 1.35 bar. If the true relationship is linear, this is exact. If not, it is still a reasonable approximation.
Example 2 – Engineering Thermodynamics (Steam Table Interpolation)
In thermodynamics, you often need properties at temperatures or pressures not listed in the steam tables. For example, using superheated steam table at 0.6 MPa (6 bar):
- At 200°C, specific enthalpy h = 2850 kJ/kg
- At 250°C, specific enthalpy h = 2960 kJ/kg
Estimate enthalpy at 220°C.
x2 = 250, y2 = 2960
x = 220
y = 2850 + (220 – 200) × (2960 – 2850) / (250 – 200)
= 2850 + 20 × 110 / 50 = 2850 + 2200 / 50 = 2850 + 44 = 2894 kJ/kg.
In real practice, engineers perform such interpolations frequently.
Example 3 – Finding X Given Y (Reverse Interpolation)
Sometimes you know y and need to find x. The same formula can be rearranged. For example, from the same pressure data: if pressure is 1.4 bar, estimate temperature.
Rearranged formula: x = x1 + (y – y1) × (x2 – x1) / (y2 – y1)
= 30 + (1.4 – 1.2) × (40 – 30) / (1.5 – 1.2)
= 30 + 0.2 × 10 / 0.3 = 30 + 2 / 0.3 = 30 + 6.6667 = 36.67°C.
Example 4 – Interpolation in Material Properties
A tensile test gives stress at strain values:
- Strain 0.002 → Stress 120 MPa
- Strain 0.005 → Stress 280 MPa
Estimate stress at strain 0.0035.
= 120 + (0.0015) × 160 / 0.003 = 120 + 0.24 / 0.003 = 120 + 80 = 200 MPa.
When is Linear Interpolation Valid?
Linear interpolation assumes the function behaves linearly between the two known points. It works well when:
- The interval (x2 – x1) is small.
- The underlying function is smooth and nearly linear over that interval.
- You only need an approximate value – not exact.
If the function has high curvature or you need high accuracy, you might need nonlinear interpolation (quadratic, cubic spline). But for most engineering tables and exam problems, linear interpolation is standard.
Common Mistakes to Avoid
- Mixing up which point is (x1,y1) and which is (x2,y2). The formula works as long as x1 ≠ x2, but order does not matter if you keep signs consistent. However, it is safer to use x1 < x2.
- Forgetting to subtract in the denominator – dividing by zero if the two x values are equal.
- Applying interpolation outside the interval (extrapolation). The formula still gives a number, but it may be wildly inaccurate.
- Misplacing parentheses when calculating – use a calculator step by step.
- Assuming linear interpolation works for non-linear data over large intervals without checking.
Table of Common Applications
| Field | Typical Use | Example Variables |
|---|---|---|
| Thermodynamics | Steam table property lookup | Temperature → Enthalpy, Pressure → Entropy |
| Fluid Mechanics | Pipe friction factor | Reynolds number → Friction factor (Moody chart) |
| Solid Mechanics | Stress-strain interpolation | Strain → Stress |
| Statistics | Percentile estimation | Rank → Percentile value |
| Computer Graphics | Color gradient, texture mapping | Pixel position → Color |
| Numerical Analysis | Intermediate value in tables | Function values at non-tabulated points |
Use Our Free Linear Interpolation Calculator
If you need to perform interpolation quickly or check your homework, use the linear interpolation calculator on this site. Enter x1, y1, x2, y2 and your x value. It will compute y (or reverse x if needed). It also shows the step-by-step calculation.
Quickly estimate any intermediate value
Practice Problems
- Given (10, 45) and (20, 95), estimate y at x = 15.
- The density of water at 30°C is 995.7 kg/m³, at 40°C is 992.2 kg/m³. Estimate density at 35°C.
- From the same density data, at what temperature would density be 994.0 kg/m³?
- A pressure gauge reads 2.5 bar at 100°C and 3.2 bar at 150°C. Estimate pressure at 120°C.
1. y = 45 + (15-10)×(95-45)/(20-10) = 45 + 5×50/10 = 45+25=70.
2. y = 995.7 + (35-30)×(992.2-995.7)/(40-30) = 995.7 + 5×(-3.5)/10 = 995.7 – 1.75 = 993.95 kg/m³.
3. x = 30 + (994.0-995.7)×(40-30)/(992.2-995.7) = 30 + (-1.7)×10/(-3.5) = 30 + (-17)/(-3.5) = 30 + 4.857 = 34.86°C.
4. y = 2.5 + (120-100)×(3.2-2.5)/(150-100) = 2.5 + 20×0.7/50 = 2.5 + 14/50 = 2.5 + 0.28 = 2.78 bar.