Linear Interpolation Calculator

The linear interpolation calculator finds the y value at a position x between two known points. Example: between (10 | 20) and (30 | 60), x = 15 gives y = 30. Outside the points this is called extrapolation.

Example: Point 1: x₁ 10 · Point 1: y₁ 20 · Point 2: x₂ 30 · Point 2: y₂ 60 · Position x to find 15 · y value for the inverse 45 → Interpolated value: y(15) = 30. Source: Wikipedia – Linear interpolation. Updated: .

My ToolboxYour inputs are saved in this browser only.

Result

Interpolated value
y(15) = 30
Classification
Interpolation: x lies between the two points.
Line equation
y = 2 · x + 0
Inverse
For y = 45, x is 22.5.
Steps
  • y = y₁ + (x − x₁) · (y₂ − y₁) / (x₂ − x₁)
  • y = 20 + (15 − 10) · (60 − 20) / (30 − 10)
  • y = 20 + 0.25 · 40 = 30

How it is calculated

Linear interpolation reads an unknown value between two known data points off the straight line connecting them. Typical use is looking up tables: if the value you need lies between two rows, you calculate in a straight line between them.

The formula

y = y₁ + (x − x₁) · (y₂ − y₁) / (x₂ − x₁). The fraction is the slope m of the line through both points. The share t = (x − x₁) / (x₂ − x₁) shows how far x lies between the points: 0 is point 1, 1 is point 2.

Example

Two table values: 20 units at 10 °C, 60 units at 30 °C. You want the value at 15 °C: t = (15 − 10) / 20 = 0.25, so y = 20 + 0.25 · 40 = 30. The line is y = 2x. Conversely, y = 45 is at x = 22.5.

Interpolation and extrapolation

Between the points the estimate is usually fine if the relationship is roughly linear. Outside (extrapolation) the line is simply extended; the further away, the less reliable. For curved relationships (interest or temperature curves, for example) you need closer data points or another model.

Frequently asked questions

How do you calculate a linear interpolation?

With y = y₁ + (x − x₁) · (y₂ − y₁) / (x₂ − x₁): find the slope between the two points and move from point 1 as far as x is from x₁.

What is the difference between interpolation and extrapolation?

In interpolation x lies between the known points, in extrapolation outside them. Extrapolating is much less reliable.

When is linear interpolation exact?

It is exact when the true relationship is a straight line. For curved relationships it is an approximation that improves with closer points.

Can I also find x from a given y?

Yes, the inverse is shown below the result: x = x₁ + (y − y₁) / m. It only works if the line is not horizontal.

Where is this used in everyday life?

For example when reading tables (tax, vapour pressure, tyre pressure), in engineering for characteristic curves and in spreadsheets for missing intermediate values.

Sources and legal basis

As of: · Editorial policy

Related tools