Linear Interpolation Calculator
Whole numbers, decimals, negatives or 1e3 form. Use the same units for both points.
Use commas, tabs or spaces. Rows can be in any order. A header row is fine.
How it was worked out
The working will show here.
What Is Linear Interpolation?
Linear interpolation finds a value that sits between two known points by drawing a straight line through them. If you know the value at 10 and at 20, it estimates the value at 14 by assuming the change in between is steady.
It is the same idea as slope. The line between the two points has one rate of change, and the missing value is found by walking along that line from the first point.
Linear Interpolation Formula
(x₁, y₁) and (x₂, y₂) are the two known points, and x is where you want the value. The part (y₂ − y₁) ÷ (x₂ − x₁) is the slope of the line. Multiply it by how far x is from x₁, then add that to y₁.
Example: a car’s speed is 30 mph at 2 seconds and 50 mph at 6 seconds. What is it at 3 seconds?
Slope: (50 − 30) ÷ (6 − 2) = 20 ÷ 4 = 5 mph per second
y = 30 + (3 − 2) × 5 = 30 + 5 = 35 mph
How to Interpolate Step by Step
- Pick the two points around your value. One x must be below the value you want and one above it.
- Find the slope. Subtract the y values, subtract the x values, and divide.
- Find the distance. Subtract x₁ from the x you want.
- Multiply and add. Multiply the slope by that distance and add the result to y₁.
- Check it. The answer should lie between or equal to y₁ and y₂. If it doesn’t, check that x sits between x₁ and x₂, then recheck your inputs.
How to Interpolate Between Values in a Table
Tables in engineering, science and finance often skip values. A steam table might list 110 °C and 120 °C, but you need 115 °C. Find the two rows just above and below your value and interpolate between them.
| Temperature (°C) | Specific volume (m³/kg) |
|---|---|
| 110 | 1.2102 |
| 115 | 1.0511 (interpolated) |
| 120 | 0.8919 |
To do this with the From a Table tab, paste the number rows only, for example 110, 1.2102 and 120, 0.8919.
Steam tables that list 115 °C directly give 1.0366, so the straight-line estimate is about 1.4% high. The values curve between the rows. That is normal: interpolation is very close for small gaps and less exact for wide ones.
Source: saturated steam tables (IAPWS-IF97), values rounded.
Finding x When You Know y
Sometimes you know the result and need the input. Swap the roles: y becomes the known value and you solve for x.
Example: using the steam table above, at what temperature is the specific volume 1.1 m³/kg?
x = 110 + (1.1 − 1.2102) × (120 − 110) ÷ (0.8919 − 1.2102)
x = 110 + (−0.1102 × 10) ÷ (−0.3183) = 110 + 3.4622 = 113.46 °C
Linear Interpolation in Excel
Excel has no INTERPOLATE function, but FORECAST.LINEAR does the same job when you give it only the two surrounding points.
Example: put 2 and 6 in A2:A3 (seconds) and 30 and 50 in B2:B3 (mph).
=FORECAST.LINEAR(3, B2:B3, A2:A3) returns 35.
The order is x first, then the y cells, then the x cells. Swapping the two ranges is the most common mistake.
Keep the Units the Same
The calculator works with plain numbers, so it does not know your units. Both x values must use the same unit, and both y values must too. If one point is in seconds and the other in minutes, convert first. The answer comes out in the same unit as the y values (or the x values when you solve for x).
Interpolation vs Extrapolation
Interpolation stays between your two points. Extrapolation goes past them and assumes the line keeps the same slope. Interpolation is generally more reliable than extrapolation, but accuracy depends on the data and the gap between the known points. Extrapolation can go badly wrong, because real data often bends outside the range you measured.
Common Mistakes
- Mixing up the points. Keep x₁ with y₁ and x₂ with y₂. Swapping only one pair gives a wrong slope.
- Using points that don’t surround your value. For a true interpolation, x must sit between x₁ and x₂.
- Using it on curved data. If values change fast or bend (like exponential growth), pick points closer together for a better estimate.
- Mixing units. Make sure both points use the same units before you calculate.
- Rounding too early. Keep full decimals until the last step, especially with table values.
Frequently Asked Questions
What is linear interpolation used for?
Reading values between rows in tables (steam, tax, conversion and survey tables), estimating data between measurements, and filling small gaps in data.
Is linear interpolation accurate?
It is exact when the data really is a straight line. For curved data it is an estimate, and it gets better the closer your two points are.
Can I interpolate in Excel?
Yes. Use =FORECAST.LINEAR(x, known_ys, known_xs) with just the two surrounding points, as in the Excel example above, or type the formula directly.
What is the difference between linear and bilinear interpolation?
Linear interpolation works along one line with two points. Bilinear interpolation works on a grid with four points and two inputs, like a table with both rows and columns.
What if x₁ equals x₂?
Then the two points sit on a vertical line, so there is no single y for a given x. Finding x from y still works when y₁ and y₂ differ: every y on that line has the same x.
Cite this page: “Linear Interpolation Calculator”, Slope Calculators, slopecalculators.com/linear-interpolation-calculator/