Linear Interpolation Calculator

Estimate a value between two known measurements — a temperature at an unmeasured time, a price between two dates, a reading between two calibration points. Enter your two known points and the value you want to estimate at; the calculator shows every step, and tells you honestly when you've strayed past your data into extrapolation.

🧮 Interpolate

📖 What Is Linear Interpolation?

Linear interpolation is a way of guessing a value between two measurements you already have. Suppose a sensor read 3 units at 2 o'clock and 11 units at 6 o'clock, and you want a reasonable value for 4 o'clock. Linear interpolation draws a straight line between the two known points — (2, 3) and (6, 11) — and reads the value off that line at x = 4. The answer is 7.

The key assumption is right there in the name: linear. You are assuming the quantity changed at a steady rate between the two measurements. When that assumption is roughly true — short gaps, smooth processes — the estimate is good. When it isn't, the estimate can be badly wrong, which is why this page is blunt about the method's limits.

🧾 The Formula, Derived Plainly

The formula is just the point-slope form of a line, solved for y:

y = y₀ + (x − x₀) × (y₁ − y₀) ÷ (x₁ − x₀)

Read it as a recipe: find the slope of the segment between your two known points, measure how far your target x sits past x₀, multiply the two, and add the result to y₀. The inverse mode flips it around to solve for x given y:

x = x₀ + (y − y₀) × (x₁ − x₀) ÷ (y₁ − y₀)

Both formulas need the denominator to be non-zero: the two known points must differ in x (forward mode) or in y (inverse mode). If they don't, there is no segment to interpolate along, and the calculator will say so instead of dividing by zero.

✏️ Worked Example

Known: a quantity is 3 at x = 2 and 11 at x = 6. Estimate its value at x = 4.

1
Segment slope: (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2.
2
Distance past x₀: 4 − 2 = 2.
3
Apply the formula: y = 3 + 2 × 2 = 7.
4
Sanity check: x = 4 sits halfway between 2 and 6, and 7 sits halfway between 3 and 11 — exactly what a straight line should give.

Push the target outside the data — say x = 10 — and the same arithmetic gives y = 3 + (10 − 2) × 2 = 19. That is extrapolation: the line is being extended past the last measurement, and the calculator flags it as less reliable.

⚖️ Interpolation vs Extrapolation

Interpolation estimates inside your data's range — between x₀ and x₁. The straight line only has to bridge a gap you have already measured across, so the error stays bounded.

Extrapolation estimates outside that range. It assumes the trend you measured keeps going unchanged into territory you never measured. Real quantities rarely cooperate: growth slows, trends reverse, ceilings appear. The further past your data you go, the less the number means.

This calculator never hides which one you just did. An amber warning appears whenever the target falls outside the known range, in both forward and inverse modes.

🚫 When Not to Use Linear Interpolation

Honest limits, because a wrong estimate presented confidently is worse than no estimate:

  • Curved relationships. Population growth, cooling curves, compound interest — anything that bends. A straight line between two points on a curve systematically misses the middle.
  • Wide gaps with nothing between. Two measurements a year apart tell you almost nothing about any given week in between if the quantity moves around.
  • When precision matters. Interpolation is an estimate, not a measurement. Don't size engineering tolerances or medical doses from it.
  • Noisy data. If the two "known" points are themselves uncertain, the line — and everything read off it — inherits that uncertainty.

This tool is deliberately linear-only. Curved data calls for polynomial or spline methods (Lagrange interpolation and friends) — genuinely different mathematics, not a mode we bolted on.

⚠️ Common Mistakes

  • Swapping the points' order matters not at all — (x₀, y₀) and (x₁, y₁) can be entered in either order; the formula handles it. What matters is pairing each x with its own y.
  • Treating extrapolation like interpolation. The most common error: reading a value far outside the data and trusting it as much as one inside. Watch for the amber warning.
  • Interpolating across a regime change. If something happened between your measurements — a policy change, a phase transition, a market shock — the straight line ignores it completely.
  • More decimal places than the data deserves. If your known points are rough, a result like 7.384291 is false precision. Round to the certainty of your inputs.

❓ Frequently Asked Questions

Q: What is linear interpolation?

Linear interpolation estimates an unknown value between two known data points by assuming the change between them follows a straight line. If a quantity was 3 at x = 2 and 11 at x = 6, linear interpolation estimates its value at x = 4 as 7 — the point on the straight line joining (2, 3) and (6, 11).

Q: What is the formula for linear interpolation?

y = y₀ + (x − x₀) × (y₁ − y₀) ÷ (x₁ − x₀). Find the slope of the segment between the two known points, multiply it by how far x sits past x₀, and add the result to y₀. For (2, 3), (6, 11) and x = 4: y = 3 + (4 − 2) × (11 − 3) ÷ (6 − 2) = 3 + 2 × 2 = 7.

Q: What is the difference between interpolation and extrapolation?

Interpolation estimates a value inside the range of your known data (between x₀ and x₁). Extrapolation estimates one outside that range. Extrapolation assumes the straight-line trend keeps going past your measurements, which it often does not — so treat extrapolated values as rough guesses, not answers.

Q: How do you do linear interpolation step by step?

1. Write down your two known points (x₀, y₀) and (x₁, y₁). 2. Compute the segment slope: (y₁ − y₀) ÷ (x₁ − x₀). 3. Measure how far your target x sits past x₀: (x − x₀). 4. Multiply that distance by the slope and add y₀. Example: points (2, 3) and (6, 11), target x = 4 gives slope 2, distance 2, and y = 3 + 4 = 7.

Q: When should you not use linear interpolation?

Skip it when the real relationship is curved (growth, decay, or anything with a bend), when your two known points are far apart with nothing measured between them, or when you need precision rather than a rough estimate. This calculator is linear-only on purpose: curved data needs polynomial or spline methods such as Lagrange interpolation, which is a different tool.

🔗 Related Calculators

📊 Math Calculators 📈 Slope Calculator