CCalclabhub

Linear Interpolation Calculator

Linear interpolation fills the gaps between two points you already know. Work out how far along the gap your target sits, then walk the same fraction along the values.

Interpolated value

50

Fraction of the way
25.00%
Slope between the points
2
Span between the inputs
100
Span between the values
200

Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.

The formula this calculator uses

y = y1 + (x - x1) x (y2 - y1) / (x2 - x1)

(x1, y1)
The lower known point
(x2, y2)
The upper known point
x
The input you want a value for
y
The interpolated result

How to check the result by hand

  1. 1

    Identify the two points that bracket your target

    You need one known point below the target and one above it. With points at (0, 0) and (100, 200), a target of 25 sits inside that range, so the pair is the right one to use.

  2. 2

    Work out the fraction of the way

    Subtract the lower x from the target and divide by the span. That is (25 - 0) / (100 - 0), which is 0.25, so the target sits a quarter of the way along.

  3. 3

    Multiply the fraction by the gap in y

    The two known values differ by 200. A quarter of 200 is 50, which is how much the answer rises above the first known value.

  4. 4

    Add it to the first value

    0 plus 50 is 50. The interpolated value at x = 25 is 50, and the sanity check holds because the slope of 2 times 25 gives the same 50.

For worked examples, common mistakes and the limits of this formula, read the full How To Calculate Linear Interpolation page.