Linear Interpolation Calculator
Estimate a value between two known data points by linear interpolation: enter both (x, y) pairs and a target x to get the y on the straight line joining them.
Linear Interpolation Calculator
Background.
Tables only list some values. A steam table, a table of statistical critical values, a rate schedule or a set of readings taken once an hour all leave gaps, and the number you need usually falls in one of them. Linear interpolation fills the gap by assuming the quantity changes at a steady rate between the listed points on either side. If the target sits 40% of the way from the first x to the second, the answer sits 40% of the way from the first y to the second.
That single assumption is both the strength and the limit of the method. For short gaps, and for quantities that change smoothly, a straight line between neighbours is usually very close to the truth, which is why printed tables have long been read this way. Over long gaps, or across a curve that bends sharply, the straight chord cuts the corner and the estimate drifts. A curve that bends upward between the points, such as y = x², is overestimated everywhere in between; one that bends downward is underestimated.
Enter the two known points and the x you want, and the page returns the y on the straight line through them. The points can go in either order and the line can slope up or down. Nothing stops you entering a target outside the two x-values: the page then extends the line beyond the data, which is extrapolation, and confidence in the answer should fall the further out you go. The only thing refused is two equal x-values, because the points then fix no single line and the formula would divide by zero.
What is linear interpolation calculator?
Linear interpolation estimates an unknown value between two known data points by assuming the relationship is a straight line between them. Given points (x₁, y₁) and (x₂, y₂) and a target x, it returns the y-value of that line at the target. When the target lies between x₁ and x₂ the result is a weighted average of y₁ and y₂, with more weight on the nearer point. Outside that range the same arithmetic becomes linear extrapolation.
How to use this calculator.
- Choose the two known points that bracket your target as tightly as possible; the table rows just below and just above it give the best estimate.
- Enter the lower row as First x and First y and the upper row as Second x and Second y. Swapping the two rows does not change the answer, as long as each x stays with its own y.
- Enter the value you want to look up as Target x, in the same units as the two x-values.
- Read the interpolated y. If the target lies outside the two x-values, treat the result as an extrapolation and check it against other data before relying on it.
The formula.
y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁). The fraction (y₂ − y₁)/(x₂ − x₁) is the slope of the line, the change in y for each unit of x. Multiplying it by (x − x₁), the distance from the first point to the target, gives how far y has moved since the first point, and adding y₁ gives the answer. Put another way, with t = (x − x₁)/(x₂ − x₁), y = (1 − t)·y₁ + t·y₂: t is the fraction of the way from the first point to the second, so t = 0 returns y₁, t = 1 returns y₂ and t = 0.5 returns their midpoint. A t below 0 or above 1 means extrapolation. The error depends on how much the true curve bends between the points and, for smooth curves, shrinks with the square of the spacing: halving the gap between table rows cuts the typical error to about a quarter.
A worked example.
The default points are (0, 0) and (10, 10), with a target of x = 5. The target lies (5 − 0) ÷ (10 − 0) = 0.5 of the way along, and y rises by 10 − 0 = 10 across the span, so y = 0 + 0.5 × 10 = 5. The line through these points is simply y = x, so here the answer is exact. Curves are less obliging. Take two points on y = x², (2, 4) and (4, 16), and interpolate at x = 3: y = 4 + (3 − 2) × (16 − 4) ÷ (4 − 2) = 4 + 6 = 10. The true value is 9, so the straight chord overshoots by 1. Points closer to the target, (2.5, 6.25) and (3.5, 12.25), give 9.25, and the error drops to a quarter.
Frequently asked questions.
How do I read a value between two rows of a table?
What happens if my target is outside the two known points?
How accurate is linear interpolation?
What should I do when the data grow exponentially?
Is linear interpolation the same as linear regression?
References& sources.
- [1]OpenStax, Rice University. College Algebra 2e, 2021. Algebra and function chapters. Retrieved 2026-08-06.
- [2]OpenStax, Rice University. Precalculus 2e, 2021. Trigonometry and analytic geometry chapters. Retrieved 2026-08-06.
- [3]NIST/SEMATECH. e-Handbook of Statistical Methods, 2012. Chapter 1.3 and Chapter 4. Retrieved 2026-08-06.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 3 cited below
- Method
- y=y1+(x-x1)(y2-y1)/(x2-x1)
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled