Linear Interpolation Formula – How to Estimate Unknown Values (2026)

Linear Interpolation Formula – How to Estimate Unknown Values (2026)

June 10, 2026 | 9 min read | For engineering, physics, statistics, and data analysis

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.

Quick summary: Linear interpolation estimates a value y for a given x between two known points (x1, y1) and (x2, y2). The formula is y = y1 + (x – x1) * (y2 – y1) / (x2 – x1). It works well when the interval is small and the function is nearly linear.

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.

y = y1 + (x – x1) × (y2 – y1) / (x2 – x1)

Alternatively, you can write it as a ratio of differences:

(y – y1) / (x – x1) = (y2 – y1) / (x2 – x1)

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.

x1 = 30, y1 = 1.2
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.

x1 = 200, y1 = 2850
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.

Known: (30°C, 1.2 bar), (40°C, 1.5 bar). y = 1.4.
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.

y = 120 + (0.0035 – 0.002) × (280 – 120) / (0.005 – 0.002)
= 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

FieldTypical UseExample Variables
ThermodynamicsSteam table property lookupTemperature → Enthalpy, Pressure → Entropy
Fluid MechanicsPipe friction factorReynolds number → Friction factor (Moody chart)
Solid MechanicsStress-strain interpolationStrain → Stress
StatisticsPercentile estimationRank → Percentile value
Computer GraphicsColor gradient, texture mappingPixel position → Color
Numerical AnalysisIntermediate value in tablesFunction 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.

Try Linear Interpolation Calculator

Quickly estimate any intermediate value

Practice Problems

  1. Given (10, 45) and (20, 95), estimate y at x = 15.
  2. 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.
  3. From the same density data, at what temperature would density be 994.0 kg/m³?
  4. A pressure gauge reads 2.5 bar at 100°C and 3.2 bar at 150°C. Estimate pressure at 120°C.
Answers:
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.

Frequently Asked Questions

1. What is the difference between interpolation and extrapolation?
Interpolation estimates a value within the range of known data points (between x1 and x2). Extrapolation estimates outside that range. Extrapolation is much riskier because the function may behave very differently beyond the known points.
2. Can I use linear interpolation for non-linear data?
Yes, but only if the interval is very small so the non-linear curve can be approximated by a straight line. For large intervals, you will get significant error. In such cases, use polynomial or spline interpolation.
3. Why do we divide by (x2 – x1) in the formula?
That term is the slope of the line between the two points. The product (x – x1) × slope gives the change in y from y1. Adding that to y1 yields the interpolated value.
4. What if my known points are not in increasing x order?
The formula still works as long as you keep consistent pairs. But it is best to order them such that x1 < x2 to avoid sign confusion.
5. How many decimal places should I keep in interpolation results?
Keep at least the same precision as the input data. If your data has two decimal places, keep two or three in the result. In engineering, three to four significant figures is typical. The calculator on this site gives up to six decimals.
(c) 2026 EnggPrep – Engineering mathematics tutorials and calculators for students and professionals.

Leave a Comment