Linear Interpolation Calculator: Between Points, in Tables and Bilinear
By FindMySum · Last reviewed
A linear interpolation calculator estimates a value between two known points by assuming a straight line between them. It is the everyday way to read between the lines of a table: a tax table, a steam table, a growth chart, a price list. This page interpolates between two points, looks up a value in a whole pasted table, works backwards to find x for a given y, warns you when a point is outside the data (extrapolation), and does bilinear interpolation in two-way tables.
The formula
Given two points (x₀, y₀) and (x₁, y₁), the value at x is
y = y₀ + (x − x₀) × (y₁ − y₀) ÷ (x₁ − x₀).
Read it as: start at y₀, then move along the line by the slope (y₁ − y₀) ÷ (x₁ − x₀) for a distance of x − x₀.
Worked example with the defaults
The known points are (10, 50) and (20, 80), and we want y at x = 14.
- Slope: (80 − 50) ÷ (20 − 10) = 3 per unit of x.
- Distance from x₀: 14 − 10 = 4.
- Result: y = 50 + 4 × 3 = 62.
Another way to see it: 14 is 40% of the way from 10 to 20 (t = 0.4), so y is 40% of the way from 50 to 80: 50 + 0.4 × 30 = 62. Linear interpolation is a weighted average, y = (1 − t)·y₀ + t·y₁.
Interpolating in a table
With a whole table, find the two rows that bracket x and interpolate between those. The default table is:
| x | y |
|---|---|
| 0 | 0 |
| 10 | 15 |
| 20 | 35 |
| 30 | 60 |
For x = 25, the bracketing rows are (20, 35) and (30, 60). The slope is 2.5, so y = 35 + 5 × 2.5 = 47.5. Paste your own table with one pair per line; rows can be in any order, separated by commas, spaces or tabs. The calculator highlights the segment it used, and the chart shows the whole piecewise-linear curve.
Inverse interpolation: x for a given y
Sometimes you know the target value and need the input that produces it: the temperature at which pressure reaches a limit, or the dose that gives a 50% response. Swap the roles of x and y:
x = x₀ + (y − y₀) × (x₁ − x₀) ÷ (y₁ − y₀).
Between (10, 50) and (20, 80), y = 70 is reached at x = 10 + 20 × 10 ÷ 30 = 16.67. In the table, y = 50 falls between 35 and 60, so x = 20 + 15 × 10 ÷ 25 = 26.
Extrapolation
If x is outside the known range, the same formula extends the line beyond the data. The calculator still gives an answer but marks it as extrapolated. Be careful: real relationships often bend. Between (10, 50) and (20, 80), x = 25 extrapolates to 95, which is only right if the line really continues.
Bilinear interpolation for two-way tables
Some tables have two inputs, one along the rows and one along the columns. Bilinear interpolation uses the four values around your point:
- Q₁₁ = f(x₁, y₁), Q₂₁ = f(x₂, y₁), Q₁₂ = f(x₁, y₂), Q₂₂ = f(x₂, y₂);
- t = (x − x₁) ÷ (x₂ − x₁) and u = (y − y₁) ÷ (y₂ − y₁);
- f = (1 − t)(1 − u)·Q₁₁ + t(1 − u)·Q₂₁ + (1 − t)u·Q₁₂ + tu·Q₂₂.
The default cell has x from 14 to 15, y from 20 to 21, and corner values 91, 210, 162 and 95. At (14.5, 20.2), t = 0.5 and u = 0.2, so
f = 0.4 × 91 + 0.4 × 210 + 0.1 × 162 + 0.1 × 95 = 36.4 + 84 + 16.2 + 9.5 = 146.1.
How accurate is it?
Linear interpolation is exact when the underlying relationship is a straight line. For a smooth curve, the error over an interval of width h is at most h²/8 times the largest value of the second derivative. Two practical consequences:
- Closely spaced tables interpolate well; widely spaced ones less so.
- Halving the spacing makes the error about four times smaller.
For strongly curved data, or when you need a smooth curve rather than straight segments, use a quadratic or spline interpolation instead.
Common mistakes
- Mixing up x and y in the inverse formula.
- Using rows that don't bracket x, which turns an interpolation into an extrapolation.
- Interpolating on a log scale linearly: values such as pH, decibels or compound growth should be interpolated in the units of the scale they vary linearly on.
More questions
When should I use interpolation instead of regression?
Interpolate when the table values are exact or trusted and you want a value between them, such as a tax table, a steam table or a manufacturer's chart. Use regression when the data are noisy measurements and you want the trend through all of them: a regression line usually doesn't pass through any point exactly.
Can I interpolate dates or times?
Yes, if you convert them to numbers first, for example days since a start date or hours since midnight. Interpolating a value at 14:30 between readings at 14:00 and 15:00 uses t = 0.5.
Why do engineering tables need bilinear interpolation?
Many properties depend on two inputs at once. Superheated steam enthalpy depends on pressure and temperature, wind chill on air temperature and wind speed, and beam capacity on span and depth. A table gives values on a grid, and bilinear interpolation reads between both the rows and the columns.
Does the order of interpolation matter in bilinear interpolation?
No. Interpolating along x first and then y gives exactly the same answer as y first and then x. The combined formula is symmetric in the two directions, which is why it can be written as a single weighted average of the four corners.
What happens if my table has the same x twice?
The calculator rejects it, because a function can't have two different y-values at one x and the slope between them would be undefined. Remove the duplicate or average the two values first.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.