What this calculator does
Linear interpolation is the arithmetic of filling a gap. Given two known points, it assumes the quantity changes at a constant rate between them and reads the value in between on that straight line. The formula is the same one behind a straight-line graph: slope equals the change in y divided by the change in x, and the value at any x is the first y plus the slope times the distance from the first x. It is used constantly in engineering tables, sensor calibration, price comparisons, and any dataset where the points are close enough that a straight line is a reasonable approximation. This calculator also reports the position along the line, a fraction from 0 to 1, which makes it obvious whether the answer is halfway or near an endpoint. Outside the two known points the same formula becomes an extrapolation, which is a much riskier operation.
How to use it
- Enter the first known x and its matching y.
- Enter the second known x and its matching y.
- Make sure the two x values are different, or the line is vertical.
- Enter the x value you want to estimate.
- Read the estimated y, the slope, and the position along the line.
- Check whether x lies inside the known interval; outside it, treat the result as an extrapolation.
How it works
Example calculations
Example 1: The midpoint of two points
With (10, 100) and (20, 200), the slope is 10.00 and x = 15 is halfway along the interval, so t = 0.50. The estimated y is 150.00, exactly halfway between 100 and 200.
Example 2: Calibrating a 4–20 mA sensor
A sensor outputs 4 mA at 0 bar and 20 mA at 10 bar. At 12 mA, the slope is 0.625 bar per mA and t = 0.50, so the pressure is 5.00 bar. This is a common calibration check because the relationship is designed to be linear.
Example 3: Estimating price per square metre
A 120 m² home sold for $420,000.00 and an 80 m² home sold for $300,000.00. Interpolating to 100 m² gives $360,000.00 at a slope of $3,000.00 per square metre. The result is an average relationship, not a valuation, because size is only one driver of price.
What the result means
The slope is the exchange rate between x and y, and the position t tells you how much of that rate has been applied. A t of 0.5 means the answer is exactly halfway; a t near 0 or 1 means the result depends heavily on one endpoint, so small errors in that point move the answer a lot. Interpolation is safest when the known points are close together and the underlying relationship is smooth. It is unsafe across a step change, a discontinuity, or a long gap, and it says nothing about curvature between the points. For curved data, a polynomial or spline fit is more appropriate. Always state whether the result is interpolated or extrapolated, because the two have very different confidence levels.
Common mistakes
- Swapping x and y when entering the points.
- Using the same x for both points, which makes the slope impossible to define.
- Extrapolating well beyond the known range and presenting it as interpolation.
- Interpolating across a discontinuity or a step change.
- Forgetting units, so the slope comes out in the wrong scale.
- Treating a linear estimate as exact when the underlying data is curved.
Assumptions and limits
- The relationship between the two points is approximately linear.
- Both points are accurate measurements or reliable figures.
- The x values are distinct so the slope is defined.
- Units are consistent across both points and the target x.
- No step change or discontinuity lies between the points.
- The estimate is a mathematical interpolation, not a causal prediction.
Frequently asked questions
What is the linear interpolation formula?
y = y1 + (x − x1) × (y2 − y1) ÷ (x2 − x1). It adds the fraction of the vertical change that corresponds to the position of x between x1 and x2.
What is the difference between interpolation and extrapolation?
Interpolation estimates inside the range of known points. Extrapolation estimates outside that range using the same line. Extrapolation is much less reliable because the relationship may change beyond the data.
Can I interpolate if the two x values are the same?
No. A vertical line has no finite slope, and the formula divides by zero. The calculator returns no result in that case. Use the known y value directly if the x is the same point.
Is linear interpolation accurate?
It is exact for a linear relationship and an approximation for anything curved. The error depends on the curvature and the distance between the known points. For smooth data with close points, it is usually good enough.
What does the position value mean?
The position t is (x − x1) ÷ (x2 − x1). A value of 0 means x equals x1, 0.5 means halfway, and 1 means x equals x2. Values outside 0 to 1 indicate extrapolation.
Can I use this with negative numbers?
Yes. The formula works with any real numbers, including negative x and y values, as long as the two x values are different.
Sources
2026 update
How to use the professional output
This page is not just a formula box. The result is designed to be checked, compared, and taken away.
- Professional worksheet. The result includes the inputs used, the method and scope, and a one-variable sensitivity check for finance calculators.
- A/B scenarios. Save two input sets in the browser and compare the primary, secondary, and breakdown figures side by side.
- Print / PDF and CSV. Print a branded worksheet, or export the year-by-year table when the calculator produces one.
The formulas and assumptions above still govern the number. The worksheet makes the estimate auditable; it does not make it a lender quote, tax return, or personalized advice.