Linear Interpolation Calculator

Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 12/9/2026

Linear interpolation estimates y for a given x between two known points: y = y1 + (x − x1) × (y2 − y1) / (x2 − x1). Between (2, 10) and (6, 30), the value at x = 4 is 10 + 2 × 20 / 4 = 20.

Explanation

Linear interpolation comes up whenever a table does not give exactly the value you want: a tax schedule, a conversion table, a table of physical properties, a calibration curve. If you know the value of y at two points x1 and x2, you assume y varies steadily between them, that is, it follows the straight line joining the two points. The sought value is then found by a proportionality rule: measure the share of the way from x1 to x2, the relative position t = (x − x1) / (x2 − x1), then apply that same share to the difference in values, y = y1 + t × (y2 − y1). For t = 0 you get y1; for t = 1, y2; for t = 0.5, the average of both. The slope (y2 − y1) / (x2 − x1) shows how much y changes when x increases by 1. The two points can be entered in either order. The calculator distinguishes two cases. When x is between x1 and x2, it is interpolation, usually reliable if the quantity varies smoothly. When x is outside, it is extrapolation: extending the line beyond the data, which is much riskier, since nothing guarantees the trend continues. If x1 and x2 are equal, the calculation makes no sense, as you would divide by zero: the calculator says so. The method is exact if the quantity is truly linear and approximate otherwise: the closer the two points, the better the estimate. For a curved quantity, such as vapor pressure or a growth curve, linear interpolation over a narrow interval remains a good approximation. If you want the complete equation of the line, use the line through two points calculator; to fit a line to more than two points, simple linear regression.

Example: reading an intermediate value from a table

Inputs

Known points (2, 10) and (6, 30). We want y for x = 4.

Calculation

Slope = (30 − 10) / (6 − 2) = 5. Relative position t = (4 − 2) / (6 − 2) = 0.5. y = 10 + 0.5 × (30 − 10) = 20.

Result

The estimated value is y = 20, halfway between 10 and 30; for x = 8, it would be an extrapolation giving 40.

Frequently asked questions

What is the difference between interpolation and extrapolation?

Interpolation estimates a value between two known points; extrapolation, outside them. Extrapolation is less reliable, since the trend may change beyond the data.

When is linear interpolation accurate?

When the quantity varies almost linearly between the two points, or when they are close together. For a strongly curved quantity over a wide interval, the error can become large.

Can I interpolate with points in reverse order?

Yes: the calculator accepts x1 greater than x2, and the formula stays exact.

Related resources

Similar calculators