Math

Interpolation Calculator

Interpolate between known data points using linear, Lagrange polynomial and cubic spline methods, with the differences between them shown and extrapolation flagged.

Last reviewed by the Radiatus Cloud team

Plot appears here.

Need this done properly for your business?

Radiatus delivers secure cloud, DevOps & compliance engineering.

Book a free consult

Interpolation fills gaps between measurements

Given a table of measured values, interpolation estimates what lies between them. Engineering tables, calibration curves, lookup tables in embedded code and sensor readings all need it. The choice of method determines what shape is assumed between the points, and since no data can confirm that shape, the method is an assumption rather than a derivation. Different methods can give visibly different answers from identical data, and none of them is more correct without knowledge of the underlying process.

High degree polynomials oscillate wildly

A single polynomial through all n points is unique and appealing until n grows. Runge's phenomenon is the classic demonstration: fitting a high degree polynomial to evenly spaced samples of a perfectly smooth bell shaped function produces enormous oscillations near the ends, growing worse as more points are added. More data making the fit worse is deeply counterintuitive and is exactly why polynomial interpolation is rarely used above about degree five.

Splines are the practical answer

A cubic spline fits a separate cubic between each pair of points, matched so the value, slope and curvature are continuous across every join. The result is smooth, has no tendency to oscillate, and is local: moving one point affects the curve only nearby, while moving one point in a polynomial fit changes the whole curve. This is why splines are used for animation curves, font outlines, and virtually every drawing tool.

Related tools

  • Percentage Calculator — Calculate percentages, percentage change, increase and decrease, and reverse percentages, with the working shown for each result.
  • Statistical Calculator — Calculate mean, median, mode, standard deviation, and more.
  • Probability Calculator — Calculate probabilities for single and combined events, including conditional probability and Bayes' theorem.
  • Scientific Calculator — Perform advanced mathematical operations including trig, log, and exponents.

Frequently Asked Questions

Which method should I use?

A cubic spline for most purposes: it is smooth, local and does not oscillate. Linear when you want a guaranteed monotonic result between points and do not mind the corners. A polynomial only for a small number of points where you know the underlying relationship really is polynomial.

What is Runge's phenomenon?

The tendency of a high degree polynomial through evenly spaced points to oscillate wildly near the ends of the interval, getting worse as more points are added. It is why polynomial interpolation is rarely used above about degree five.

What is the difference between interpolation and extrapolation?

Interpolation estimates inside the range of the known points and is generally reliable. Extrapolation goes outside it and is not: every method diverges beyond the data, and polynomial methods diverge fastest. Any estimate outside the range is flagged here.

Why do the methods disagree?

Because each assumes a different shape between the points and the data cannot say which is right. Where they agree closely, the answer is well determined by the data; where they diverge, the choice of method is doing the work rather than the measurements.

Does interpolation preserve monotonic data?

Linear interpolation does. Cubic splines can overshoot slightly between points even when the data increases throughout, which matters when the quantity cannot physically go backwards. Monotone variants of the spline exist for exactly this case.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Enter known x and y points and a value to estimate the corresponding result.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.