Estimate a value between two observations
Linear interpolation finds a value along the straight line joining two known points. Enter the first and second (x, y) pair and choose whether you want to estimate y from x or solve the reverse problem, x from y. The result includes the slope, the fraction of the interval and an explicit distinction between interpolation and extrapolation. The calculator works in your browser. It is useful for looking between rows of a table when the relationship is reasonably smooth over a short interval.
Forward interpolation formula
For points (x₁, y₁) and (x₂, y₂), the formula is y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁). The ratio (x − x₁)/(x₂ − x₁) says how far the target lies between the known x values. Multiply that fraction by the change in y and add the first y value. The slope is (y₂ − y₁)/(x₂ − x₁). Two points with the same x value cannot define a single-valued y(x) line for this method, so such inputs are rejected.
Worked example
Suppose a table says that at x = 0, y = 10, and at x = 10, y = 30. To estimate y when x = 4, compute the fraction (4 − 0)/(10 − 0) = 0.4. The y difference is 30 − 10 = 20. Therefore y = 10 + 0.4 × 20 = 18. The slope is 2 units of y per unit of x. The estimate is 40% of the way from the first point to the second. For the inverse question, find x when y = 20: the y fraction is 10/20 = 0.5, so x = 5.
Inverse interpolation and flat segments
Reverse mode uses x = x₁ + (y − y₁)(x₂ − x₁)/(y₂ − y₁). It is valid only when the two y values differ. A flat line has one y value for many x values, so no unique inverse exists. The tool rejects a zero y difference in reverse mode instead of inventing an x. Both modes allow descending data; you do not need to sort the points first. The interval check works even if the first endpoint is numerically greater than the second.
Interpolation is not a physical law
Interpolation is an assumption that the relationship is approximately straight between observations. It does not fit a polynomial, estimate uncertainty or prove that the underlying process is linear. Extrapolation extends the same line beyond the measured interval and is often less reliable. By default, outside-range targets are refused. You must deliberately enable extrapolation to see such a result, and it is labeled. For curved functions, use more nearby points or a suitable physical model. Never treat a table estimate as a certified engineering or medical value without checking the source data and method.
Frequently asked questions
What is the difference between interpolation and extrapolation?
Interpolation stays within known endpoints; extrapolation extends the line beyond them and requires explicit permission here.
Can the two points be in descending order?
Yes. The interval and formulas work regardless of endpoint order.
Why is reverse interpolation sometimes undefined?
If both known y values are identical, there is no unique x for that y.
Last updated: November 14, 2026