What this calculator does
Estimate a missing value that sits between two values you already know. That's linear interpolation: it assumes the change between the two is steady. Say a table gives a value at 10 and at 20, but you need it at 14. You draw a straight line through the two known points and read the line at 14. It's the everyday way to read between the rows of tables in engineering, science, finance and statistics.
Enter the two known points, (x₁, y₁) and (x₂, y₂), and a target x. The calculator gives you the estimated y and the slope of the line (how much y rises for each step in x). It also shows the line's equation and how far along from point 1 to point 2 the target sits. If the target lies outside the two points, the result is an extrapolation (a guess past the data), and the calculator says so. You can also run it backwards. Give a target y, and it finds the x where the line reaches that value.
Where it's used
Why this math matters outside the classroom:
- Reading engineering tables. An engineer reads a property at 104 °C from table rows at 100 and 110 °C by interpolating 40% of the way between them.
- Fee schedules. A clerk estimates a fee for 14 units from a schedule listing $50 at 10 units and $80 at 20 units, which gives $62.
- Animation keyframes. Animators move an object from x = 0 to x = 300 over 60 frames, so at frame 20 it sits at x = 100 by straight-line interpolation.
- Filling data gaps. A weather analyst fills a missing hourly reading between 12 °C at 2 pm and 16 °C at 4 pm with 14 °C at 3 pm.
- Algebra class. Students write the line through (10, 50) and (20, 80) as y = 3x + 20 and use it to predict y at any x.
Grade level and standards: Grades 8–9; Common Core State Standards for Mathematics 8.F.B.4, HSF.LE.A.2. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.
How to use it
- Choose whether you want y for a given x (the usual case) or x for a given y.
- Enter the two known points. They can come in either order, and the x values must differ.
- Enter the target x (or target y) and read the estimate at the top.
- Check the Type line. Interpolation means the target lies between the points. Extrapolation means the line has been stretched past them, which is less reliable.
What the inputs mean
- Find
- Inverse interpolation answers questions like 'at what temperature does the value reach 65?' It needs the two y values to be different.
- Point 1: x₁
- Pick the two table entries closest to your target, one on each side. Closer points give a better estimate when the real relationship curves.
Formula and method
slope m = (y₂ − y₁) ÷ (x₂ − x₁) y = y₁ + (x − x₁) × (y₂ − y₁) ÷ (x₂ − x₁) x = x₁ + (y − y₁) × (x₂ − x₁) ÷ (y₂ − y₁) t = (x − x₁) ÷ (x₂ − x₁), so y = (1 − t)·y₁ + t·y₂
(x₁, y₁) and (x₂, y₂) are your two known points. x is the target x, and y is the value you're estimating. m is the slope, and t is the fraction of the way along.
A straight line rises by the same amount for every step of 1 in x. That rate is the slope, m. Start at the first point and move x − x₁ steps along the line. That adds m × (x − x₁) to y₁, and that's the interpolation formula.
The fraction t says how far the target is from point 1 toward point 2. It's 0 at the first point, 1 at the second and 0.5 halfway. Written with t, the formula is a weighted average of the two y values: it mixes them in proportion. That's why it's sometimes called 'lerp', short for linear interpolation.
When t is between 0 and 1, the estimate is an interpolation. When t is below 0 or above 1, the same formula extrapolates. It assumes the straight-line trend carries on outside the data.
Swapping the roles of x and y gives the inverse formula. It finds the x that produces a target y.
Worked example
A table lists a value of 50 at x = 10 and 80 at x = 20. Estimate the value at x = 14, and find where it reaches 65.
- Slope: (80 − 50) ÷ (20 − 10) = 30 ÷ 10 = 3 per unit of x.
- Interpolate: y = 50 + (14 − 10) × 3 = 50 + 12 = 62.
- Position: t = (14 − 10) ÷ (20 − 10) = 0.4, so 14 is 40% of the way from the first point to the second.
- Line equation: b = 50 − 3 × 10 = 20, so y = 3x + 20.
- Inverse: x = 10 + (65 − 50) × (20 − 10) ÷ (80 − 50) = 10 + 15 × 10 ÷ 30 = 15.
Result: The estimated value at x = 14 is 62 (an interpolation), and the line reaches 65 at x = 15.
Understanding the result
An interpolated value is exact only if the relationship really is a straight line between the two points. Some relationships curve, such as compound growth or the pressure of steam. For those, it's an approximation that gets better as the two known points get closer together.
Treat extrapolated values with extra care. Nothing in the two known points says the trend carries on. Use them only for short reaches past the data.
The fraction along the way makes a quick sanity check. An interpolated y always lies between y₁ and y₂ when t is between 0 and 1.
Assumptions and limitations
- The quantity changes at a constant rate between the two known points.
- Both points are measured exactly. Any error in them carries straight into the estimate.
- Only two points are used. If you have many scattered data points, fit a line with linear regression (a best-fit line through all of them) instead.
- Curved data, such as logarithmic or exponential tables, may need a different approach. You can interpolate on transformed values, or use a higher-order method that fits a curve.
- A vertical line (equal x values) gives no single y for each x, so it can't be interpolated. A flat line can't be run backwards to find x.
Frequently asked questions
What is the linear interpolation formula?
y = y₁ + (x − x₁) × (y₂ − y₁) ÷ (x₂ − x₁). It takes the first known y and adds the slope times the distance from the first known x. Between (10, 50) and (20, 80), x = 14 gives 50 + 4 × 3 = 62.
What is the difference between interpolation and extrapolation?
Interpolation estimates a value between the known points, where a straight line is usually a fair guess. Extrapolation stretches the line past them. There the real data may bend away, so it's riskier.
Does it matter which point I enter first?
No. Swapping the two points gives the same line and the same estimate. Only the fraction along the way changes, because it's measured from whichever point you enter first.
How do I interpolate in a table with two variables?
Use bilinear interpolation, which repeats the one-direction step. First interpolate along one direction in two neighbouring rows. Then interpolate between those two results in the other direction. This calculator handles each of those single steps.
How this calculator is checked
Method: The two-point form of a straight line, y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁), and its rearrangement for x. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Linear Interpolation Calculator on your own website or blog for free. Paste this code where you want it to appear: