Math · 61 calculators
Linear Interpolation Calculator
Linear interpolation fills the gaps between two points you already know. Work out how far along the gap your target sits, then walk the same fraction along the values.
Last updated
Interpolated value
50
- Fraction of the way
- 25.00%
- Slope between the points
- 2
- Span between the inputs
- 100
- Span between the values
- 200
Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.
The formula this calculator uses
y = y1 + (x - x1) x (y2 - y1) / (x2 - x1)
- (x1, y1)
- The lower known point
- (x2, y2)
- The upper known point
- x
- The input you want a value for
- y
- The interpolated result
How to check the result by hand
- 1
Identify the two points that bracket your target
You need one known point below the target and one above it. With points at (0, 0) and (100, 200), a target of 25 sits inside that range, so the pair is the right one to use.
- 2
Work out the fraction of the way
Subtract the lower x from the target and divide by the span. That is (25 - 0) / (100 - 0), which is 0.25, so the target sits a quarter of the way along.
- 3
Multiply the fraction by the gap in y
The two known values differ by 200. A quarter of 200 is 50, which is how much the answer rises above the first known value.
- 4
Add it to the first value
0 plus 50 is 50. The interpolated value at x = 25 is 50, and the sanity check holds because the slope of 2 times 25 gives the same 50.
Common Questions
How does the Linear Interpolation Calculator work?
Find the fraction of the way your target x sits between the two known x values, multiply that fraction by the gap between the two y values, and add it to the first y. At x = 25 between (0, 0) and (100, 200) the answer is 50.
What do I need to enter in the Linear Interpolation Calculator?
It takes 5 inputs: First x, First y, Second x, Second y, Target x. Fields that expect a unit say so next to the label.
Where does Interpolated value come from?
It comes from y = y1 + (x - x1) x (y2 - y1) / (x2 - x1) — walk along the line from the first point using the slope between the two known points.
What is the most common mistake with the Linear Interpolation Calculator?
Interpolating outside the two known points. That is extrapolation, not interpolation. The straight line has no support beyond the data, and errors grow quickly the further you go.
For worked examples, common mistakes and the limits of this formula, read the full How To Calculate Linear Interpolation page.
