Skip to main content

Interpolation Calculator

Blake Boege
Written by Blake Boege · Founder, Calculator Answers

An interpolation calculator estimates the value of a function at an unsampled point from known values nearby. This one performs linear interpolation only: it draws a straight line between two coordinate points and reads the value off that line, using the ratio of differences between the points. It does not perform polynomial, Lagrange, Newton or spline interpolation, which curved data needs. Science students, engineers, and financial analysts use it to estimate intermediate values from lookup tables, experiment data, or financial curves.

Estimate y values between known data points using the standard linear interpolation formula.

Quick Answer

Estimate a value between two known points. Enter both (x, y) pairs and a target x to get the linearly interpolated y, with the working shown and extrapolation flagged when the target falls outside the pair.

Point 1 (Known)


Point 2 (Known)


Target Point

Interpolated Result

Estimated y value

35

At x = 25

Step-by-step Calculation

Interpolation

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

Step 1, the slope between the two known points: m = (y₂ - y₁) / (x₂ - x₁) = 1

Step 2, apply y = y₁ + m × (x - x₁):

y = 20 + (25 - 10) × (40 - 20) / (30 - 10)

y = 20 + (15) × (20) / (20)

y = 20 + (15) × (1)

y = 35

Was this helpful?

How it works

What is interpolation?

Interpolation is a method of estimating new data points within the range of a discrete set of known data points. In engineering, science, and business, you often have a table of data values (like temperature vs. pressure) but need to know the value at a point that isn't explicitly listed in the table.

The Linear Interpolation Formula

Linear interpolation is the simplest and most common form. It assumes that the line connecting two known points is straight.

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

Where:
• (x1, y1) is your first known data point
• (x2, y2) is your second known data point
• x is the target value you want to evaluate
• y is the estimated result

Interpolation vs. Extrapolation

Interpolation occurs when your target x value falls between x1 and x2. This is generally safe and reliable.

Extrapolation occurs when your target x value falls outside the range of x1 and x2. Extrapolation is riskier because you are assuming that the linear trend continues indefinitely past your known data points, which is rarely true in the real world.

Worked Example

Suppose you know the temperature at 11:00 AM (x1=11) is 60°F (y1=60), and the temperature at 1:00 PM (x2=13) is 70°F (y2=70). What was the estimated temperature at 11:30 AM (x=11.5)?

  • y = 60 + (11.5 − 11) × (70 − 60) / (13 − 11)
  • y = 60 + (0.5) × (10) / (2)
  • y = 60 + (0.5) × 5
  • y = 60 + 2.5 = 62.5°F

Disclaimer

For educational purposes. Linear interpolation assumes a straight-line relationship between points. Verify results for critical applications.

Related calculators

Frequently asked questions

Take the two known points that bracket your target. Work out the slope between them, (y2 − y1) ÷ (x2 − x1), multiply that slope by how far your target x sits past x1, and add the result to y1. Between the points 10,20 and 30,40 the slope is 1, so a target of 25 gives 20 + 15 × 1 = 35. That is the whole method, and it is what this calculator does.

Enter both known points and the x you want an answer for. The calculator finds the slope between the two points, then applies y = y1 + m(x − x1) and shows each step. Working it through once is worth doing: with the points 10,20 and 30,40 the slope is 1, so a target of 25 gives 20 + 15 × 1 = 35.

Interpolation is a mathematical method used to estimate an unknown value that falls within the range of a discrete set of known data points. Linear interpolation assumes that the relationship between two consecutive data points is a straight line.

Interpolation estimates a value INSIDE the range of your known data points. Extrapolation estimates a value OUTSIDE that range. This calculator does both, because both use the same straight line: when your target x falls outside the interval, the line is simply extended, which is linear extrapolation. The result is labelled so you always know which one you got. Extrapolation is much less reliable, because it assumes the trend continues unchanged beyond the data you actually have.

The standard formula is y = y1 + (x − x1) × (y2 − y1) / (x2 − x1). It essentially calculates the slope between the two known points, multiplies that slope by how far the target x is from the first point, and adds that to the first y value.

Linear interpolation works best when your data points are close together, or when the underlying relationship between variables is relatively linear (a straight line). It becomes less accurate for highly curved or volatile data.

If your data is highly curved (e.g., exponential, logarithmic, or polynomial trends), linear interpolation will introduce significant errors. In these cases, polynomial interpolation, spline interpolation (like cubic splines), or curve fitting is more appropriate.

Yes. In advanced mode, you can provide a larger table of data points. The calculator will automatically find which two known points your target x falls between, and perform linear interpolation just between those two specific points. This is called piecewise linear interpolation.

Interpolation is heavily used in engineering (reading values from thermodynamic tables), statistics (estimating percentiles), computer graphics (smoothing animations), and finance (estimating interest rates on the yield curve).

If x1 and x2 are identical, you cannot perform linear interpolation because it requires dividing by (x2 − x1), which would result in division by zero. The two known points must have different x values.