Linear Interpolation Calculator

Estimate an unknown value between two data points with linear interpolation.

How it is calculated

Linear interpolation estimates y at a chosen x by assuming the data follow a straight line between two known points (x1, y1) and (x2, y2). The slope is m = (y2 − y1) / (x2 − x1) and the estimate is y = y1 + (x − x1) × m. The tool shows both y and the slope with two decimals. It works for an x outside the two points too, which is extrapolation and is usually less reliable. The two x values must differ, otherwise the slope is undefined. The estimate is only as good as the straight-line assumption.

Worked example

Known points (10, 20) and (20, 50); estimate y at x = 14. Slope = (50 − 20) / (20 − 10) = 30 / 10 = 3. Distance from the first point: 14 − 10 = 4. y = 20 + 4 × 3 = 32. The estimated value is 32.00, with a slope of 3.00. Check: 14 is 40% of the way from 10 to 20, and 40% of the way from 20 to 50 is 32.

Try this example →

Common mistakes

  • Pairing coordinates wrongly, e.g. entering y1 with x2.
  • Using two points that are far apart on a curved relationship, where a straight line misses the real value.
  • Choosing x outside the two points and treating the extrapolated number as reliable.
  • Entering the same x for both points, which gives no result.
  • Using the two nearest table entries to a target is right; using the first and last entries of the table is not.

About this calculator

This calculator estimates an unknown y value on the straight line connecting two known points using linear interpolation: y = y1 + (x − x1)·(y2 − y1)/(x2 − x1). It assumes the relationship between x and y is linear between the two given points.

Engineers, scientists, and spreadsheet users rely on it to fill gaps in lookup tables, calibration curves, and sensor readings — for example, finding a property value at a temperature that falls between two tabulated points.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    A straight line between two points always errs on a curved relationship, so keep the two known points close to your x. Using the square roots of 16 and 25 to estimate the root of 20 gives 4.44, while the true value is 4.47; the line sits below a curve that bends downward. Halve the gap between known points and the error shrinks a lot. What kind of data are you filling in: a table, a sensor reading or a chart?

Popular calculators

All Calculators