Free online tools

Linear Interpolation Calculator

Enter two points and a target x. The calculator estimates y on the straight line through those points and shows where the target sits relative to them.

Enter your values

This tool processes your input in your browser.

Result

Find the fraction of the way between the points

Subtract the first x from your target and divide by the difference between the two x values. For points (2, 14) and (6, 26), target x = 5 is (5 − 2) ÷ (6 − 2) = 0.75 of the way from the first point to the second.

Apply the same fraction to the change in y

The y values change by 12 between the points. At x = 5, add 0.75 × 12 to 14 to get 23. This is the linear case of interpolation, which NIST documents as estimating intermediate values from known x–y pairs.

Recognize when the estimate extends beyond the data

The same line gives y = 29 at x = 7, past the second observed x of 6. That is extrapolation. Use the optional setting to model it and treat the result as a continuation of the assumed line. A curved or changing relationship may behave differently outside the measurements.

Frequently asked questions

Can the two x values be in descending order?

Yes. The fraction is measured from the first input point toward the second. Swapping the order gives the same estimated y, subject to rounding.

What if both x values are the same?

The two points do not define a single-valued linear relationship from x to y. Enter two different x values.

Is the result guaranteed between the points?

The result is the value on the straight line connecting the points. It is an estimate of the underlying quantity when that relationship may be curved.