Linear Interpolation Calculator

Estimate a value between two known points with the linear interpolation formula.

Interpolate between two points
Enter (x1, y1), (x2, y2), and the target x coordinate.

About linear interpolation

Linear interpolation estimates an unknown value that lies between two known data points. Given points (x1, y1) and (x2, y2), it assumes that y changes at a constant rate as x moves from the first point to the second. The interpolation formula is y = y1 + ((x - x1) / (x2 - x1))(y2 - y1). This calculator evaluates that formula and also displays the interpolation fraction, which shows how far the target x has traveled across the interval. The fraction is zero at x1, one at x2, and between zero and one for a target inside the interval. For example, a fraction of 0.4 means the target is forty percent of the horizontal distance from the first point to the second. The same fraction is applied to the vertical change from y1 to y2. This proportional approach makes interpolation easy to understand and gives exact results whenever the underlying relationship is truly linear. The two x coordinates must differ because a vertical pair of points does not define y as a single-valued linear function of x. The y values may be equal, producing a constant result. The points can be entered in either order; reversing both endpoints leaves the interpolated value unchanged. A target outside the endpoint interval is also mathematically accepted, but that operation is linear extrapolation rather than interpolation and may carry more uncertainty. Interpolation is widely used to estimate measurements between table entries, convert scales, fill gaps in time series, blend positions in graphics, calibrate instruments, and approximate engineering data. Its reliability depends on whether the change between endpoints is reasonably straight. Curved, discontinuous, or rapidly changing relationships may require polynomial interpolation, splines, or a domain-specific model. Always preserve compatible units: x1, x2, and the target x must share one unit, while y1 and y2 must share another. To verify the answer, compute the horizontal fraction first, multiply it by y2 minus y1, and add that change to y1.

Examples

These examples show midpoint and fractional interpolation.

Known points and targetInterpolated valueExplanation
(0, 10), (10, 30), x = 4y = 18Forty percent of the y change is added to 10.
(20, 68), (30, 86), x = 25y = 77The target is exactly halfway between the endpoints.
(100, 5), (200, 9), x = 175y = 8A fraction of 0.75 adds three quarters of the change.

How to use the calculator

  1. Enter the x and y coordinates of the first known point.
  2. Enter the x and y coordinates of the second known point.
  3. Enter the target x value you want to estimate.
  4. Select Calculate interpolated value and review y and the interval fraction.

Frequently asked questions

What is linear interpolation?

It estimates a value between two known points by assuming a constant rate of change. Geometrically, the estimate lies on the straight line joining those points.

Can I enter the endpoints in reverse order?

Yes, reversing both complete points produces the same line and result. The fraction is measured in the reversed direction but remains mathematically consistent.

What if the target is outside the interval?

The formula still returns a value, but the operation is called extrapolation. Predictions beyond known data are generally less reliable than estimates between the endpoints.

Why must x1 and x2 be different?

Equal x coordinates make the formula's denominator zero. A vertical line cannot define one y value for every x under this interpolation model.

When should I avoid linear interpolation?

Avoid it when the data changes sharply or follows a strongly curved relationship between points. A model that reflects the underlying process will usually be more accurate.