linear interpolation calculator

Linear Interpolation Calculator

Enter two known points and the target x-value to estimate y on the straight line between them.

Formula: y = y1 + (x - x1) × (y2 - y1) / (x2 - x1)
Enter values above and click Calculate.

What is linear interpolation?

Linear interpolation is a method for estimating an unknown value that lies between two known data points. If you assume the change between those points is straight and uniform, interpolation gives a fast and practical estimate.

In plain language: if you know where a line starts and ends, you can estimate any point in the middle.

How this calculator works

This calculator takes two points: (x1, y1) and (x2, y2). Then it uses your target x value to compute the corresponding y on that line.

Step-by-step idea

  • Find how far your target x is from the first point.
  • Compute the slope between your two known points.
  • Move that fraction of the y-distance to get the estimate.

Example

Suppose you know:

  • (10, 100)
  • (20, 200)

And you want y when x = 15. Since 15 is halfway between 10 and 20, the result is halfway between 100 and 200, which is 150.

Common use cases

  • Estimating values in engineering tables
  • Filling gaps in scientific measurements
  • Data analysis and reporting
  • Converting lookup tables into quick estimates
  • Finance and economics trend approximation

Interpolation vs. extrapolation

Interpolation is estimating inside the range of your known x-values. Extrapolation is estimating outside that range. Extrapolation can be useful, but it is generally less reliable because the same trend may not continue.

Tips for better accuracy

1) Check your input order

x1 and x2 can be in either order, but they cannot be equal. If they are equal, the slope is undefined.

2) Keep units consistent

Make sure your x-values and y-values use consistent units (for example: seconds and meters, not seconds and feet mixed with meters).

3) Understand the straight-line assumption

Linear interpolation assumes a straight relationship between points. If your real data is curved, this is still an estimate, not an exact model.

Quick FAQ

Can I use decimals?

Yes. This calculator accepts decimal and negative values.

Can I interpolate with decreasing values?

Absolutely. The slope can be positive or negative.

Why did I get an error?

The most common reason is setting x1 equal to x2, which makes division by zero in the formula.

Final thoughts

Linear interpolation is one of the simplest and most useful estimation tools in math, science, and applied work. Use this calculator for quick answers, then validate with a more advanced model when precision matters.

🔗 Related Calculators