Interpolation Calculator

Estimate the value at a point between (or beyond) two known points using linear interpolation.

Interpolated y

How to Interpolate

Enter two known points and the x you want to estimate.

1

Enter the two known points

Type (x₀, y₀) and (x₁, y₁). The two x-values must be different.

2

Enter the target x

Type the x-value you want the y for. It can be between or beyond the two points.

3

Read the estimate

The calculator finds the point on the straight line through your two points.

Frequently Asked Questions

What is linear interpolation?
Linear interpolation estimates an unknown value on the straight line drawn between two known points, assuming the quantity changes at a constant rate between them. If a reading is 10 at x = 0 and 20 at x = 10, interpolation puts the value at x = 3 at 13. It is the simplest way to read between the rows of a table. The estimate is only as good as the straight-line assumption, so a strongly curved relationship will be slightly off.
What is the interpolation formula?
The formula is y = y₀ + (x − x₀)(y₁ − y₀) ⁄ (x₁ − x₀), where (x₀, y₀) and (x₁, y₁) are the known points. The fraction (y₁ − y₀) ⁄ (x₁ − x₀) is simply the slope of the line through them. With (0, 10) and (10, 20) the slope is 1, so at x = 3 the value is 10 + 3 × 1 = 13. This calculator applies the formula and shows each step; it fails only when x₀ equals x₁, which would divide by zero.
Can it extrapolate beyond the points?
The interpolation calculator extrapolates too, using the same straight line. If the target x lies outside the range of the two known points, the line is simply extended, which is extrapolation rather than interpolation. With (0, 10) and (10, 20), an x of 15 gives 25. Treat extrapolated values with more caution, because the constant-rate assumption is untested outside the interval you measured.
Is my data sent anywhere?
Nothing you type is sent anywhere. The linear interpolation calculator runs entirely in your browser with JavaScript, so your two known points and target x never leave your device. There is no account, no upload step and nothing is logged. The page keeps working offline once it has loaded.