Guides

What is interpolation?

Estimating values between known data points: the main methods, their formulas, and when each one is the right choice.

Updated 19 October 2026

Interpolation estimates an unknown value that lies between values you already know. If a table gives the density of a fluid at 20 °C and 30 °C, interpolation gives you a sensible value at 24 °C. If you know a sensor reads 2.5 at one setting and 3.7 at another, interpolation tells you the setting that should read 3.0.

Every interpolation method makes the same basic assumption: the quantity changes smoothly and predictably between the known points. The methods differ in what shape they assume: a straight line, a polynomial, or a chain of smooth curves.

Interpolation vs. extrapolation vs. curve fitting

  • Interpolation: the estimate lies inside the range of your data, and the result passes exactly through every known point.
  • Extrapolation: the estimate lies outside the range. The same formulas work, but you are assuming the trend continues where you have no evidence. Errors grow quickly with distance.
  • Curve fitting (regression): finds a curve that passes near the points, not through them. Use it for noisy measurements, where hitting every point exactly would just reproduce the noise.

Linear interpolation

The simplest and most common method. Draw a straight line between the two neighbouring points and read off the value:

y = y₁ + (x − x₁) × (y₂ − y₁) / (x₂ − x₁)

Example: a table gives 25 at x = 10 and 45 at x = 20. At x = 14 you are 40% of the way along, so y = 25 + 0.4 × 20 = 33.

Linear interpolation is exact for straight-line relationships and very good for smooth data with closely spaced points. That is why printed engineering tables are designed to be read with it. Try it in the linear interpolation calculator.

Interpolating in a table

With more than two points, find the pair that brackets your x and interpolate between those two. This is called piecewise linear interpolation. The result is a chain of straight segments that passes through every point. It never overshoots the data, which makes it the safe default for lookup tables. See the table interpolation calculator.

Polynomial interpolation

Through n points there is exactly one polynomial of degree n − 1 that passes through all of them. Two common ways to build it:

  • Lagrange form: a weighted sum of basis polynomials, each equal to 1 at its own point and 0 at the others.
  • Newton's divided differences: the same polynomial built incrementally, which makes it easy to add one more point.

With 3–5 points from a smooth curve, a polynomial is often much more accurate than straight lines. For example, it recovers y = x³ exactly from four points on it. With many points it becomes unstable and oscillates between them (Runge's phenomenon). See choosing an interpolation method.

Spline interpolation

A cubic spline joins a separate cubic polynomial on each interval. The pieces are matched so that the value, slope and curvature are continuous at every data point. You get a smooth curve that follows the data closely without the wild swings of a single high-degree polynomial. It is the standard choice for smooth curves through many points, such as animation paths, calibration curves and resampling. Try the cubic spline calculator.

Interpolating in two dimensions

When a value depends on two inputs, as in a superheated steam table indexed by pressure and temperature, use bilinear (double) interpolation. Interpolate along one input on two rows, then interpolate between those two results along the other input. The order doesn't matter. How to interpolate steam tables walks through a full example.

Inverse interpolation

Sometimes you know y and need x, such as the temperature at which a property reaches a target value. Solve the linear formula for x:

x = x₁ + (y − y₁) × (x₂ − x₁) / (y₂ − y₁)

This works when y always increases or always decreases between the points. See the inverse interpolation calculator.

Common mistakes

  • Using the wrong bracketing pair. Always interpolate between the two points on either side of x, not just any two points.
  • Mixing units or swapping axes. x₁ and y₁ must come from the same row.
  • Extrapolating by accident. If x is outside your data, you are extrapolating. Check whether that is justified.
  • Over-fitting. A high-degree polynomial through many points can be worse than straight lines.
  • Rounding too early. Keep full precision until the final answer, especially in double interpolation.
A short history

Interpolation is older than calculus. Astronomers used it to fill gaps in tables of planetary positions. Newton's divided-difference formula was published in the late 1600s, Lagrange's form in 1795, and splines were formalised in the 1940s, inspired by the flexible strips draughtsmen used to draw smooth curves through fixed points.

More guides