Linear Interpolation Calculator

Enter two known points and a value to estimate the missing number between them. The calculator shows the formula with your numbers.

Point 1
Point 2

What is linear interpolation?

Linear interpolation is a way to estimate an unknown value that falls between two known values. It assumes the two points are connected by a straight line, then finds the point on that line that matches the value you're interested in.

For example, if a thermometer read 68°F at 8:00 a.m. and 82°F at noon, linear interpolation estimates that the temperature at 10:00 a.m. was about 75°F — exactly halfway between, because 10:00 is halfway between 8:00 and noon.

The linear interpolation formula

To find y for a known x between two points (x₁, y₁) and (x₂, y₂):

y = y₁ + (x − x₁) × (y₂ − y₁) / (x₂ − x₁)

The part (y₂ − y₁) / (x₂ − x₁) is the slope of the line — how much y changes for each one-unit change in x. The formula starts at the first point and moves along the line by the slope multiplied by the distance from x₁.

To work backward and find x for a known y, swap the roles of x and y:

x = x₁ + (y − y₁) × (x₂ − x₁) / (y₂ − y₁)

How to use this calculator

  1. Enter the coordinates of your first known point in x₁ and y₁.
  2. Enter the second known point in x₂ and y₂.
  3. Choose whether you want to find y (most common) or x.
  4. Type the known value and click Calculate.

The result shows the answer, the formula with your numbers plugged in, the slope, the full line equation (y = mx + b) and whether your value is an interpolation or an extrapolation. Decimals and negative numbers are fully supported.

Step-by-step example

Suppose a steam table lists a property value of 2.45 at 100°C and 2.85 at 120°C, and you need the value at 112°C.

  1. Point 1 is (100, 2.45) and Point 2 is (120, 2.85).
  2. Find the slope: (2.85 − 2.45) / (120 − 100) = 0.40 / 20 = 0.02.
  3. Find the distance from x₁: 112 − 100 = 12.
  4. Multiply: 12 × 0.02 = 0.24.
  5. Add to y₁: 2.45 + 0.24 = 2.69.

So the estimated value at 112°C is 2.69. You can confirm this by entering the same numbers in the calculator above.

Where linear interpolation is used

  • Engineering tables: Steam tables, material property charts and pipe sizing tables only list certain values, so engineers interpolate between rows.
  • Statistics and finance: Estimating percentiles, filling gaps in time-series data and estimating interest rates between published maturities.
  • Science labs: Reading calibration curves and estimating measurements between data points.
  • Computer graphics and games: Smoothly animating movement or blending colors between two values (often called “lerp”).
  • Everyday estimates: Estimating fuel use, growth charts or the temperature at a time when no reading was taken.

Interpolation vs. extrapolation

When your known value falls between the two points, you're interpolating, and the result is usually a reliable estimate. When it falls outside the two points, you're extrapolating: you assume the straight-line trend keeps going. That can be far less accurate, because real-world data often curves or levels off. The calculator tells you which case applies so you can judge how much to trust the answer.

How accurate is linear interpolation?

Linear interpolation is exact when the relationship really is a straight line. For curved data, it's a good approximation when the two points are close together. If you need more accuracy for strongly curved data, use points that are closer to your target value, or a method such as polynomial or spline interpolation.

Frequently asked questions

What is the formula for linear interpolation?

The formula is y = y₁ + (x − x₁) × (y₂ − y₁) / (x₂ − x₁), where (x₁, y₁) and (x₂, y₂) are the two known points and x is the value you want to estimate y for.

Can I find x instead of y?

Yes. Choose Find x for a known y in the calculator. It uses the formula x = x₁ + (y − y₁) × (x₂ − x₁) / (y₂ − y₁).

What happens if my value is outside the two points?

The calculator still gives an answer, but labels it as an extrapolation. Extrapolation assumes the straight-line trend continues, which may not be true for real data.

Why do I get an error when x₁ equals x₂?

If both points have the same x value, the line is vertical and the slope is undefined, so a y value can't be interpolated. Check that you entered two different points.

Does the calculator work with negative numbers and decimals?

Yes. You can enter any real numbers, including negatives and decimals, for all five fields.

What is lerp?

Lerp is short for linear interpolation. Programmers use it to blend between two values, for example when animating an object moving from one position to another.

How do I interpolate in a table with many rows?

Find the two rows whose x values sit just above and just below your target value. Use those two rows as Point 1 and Point 2 in the calculator.

How many decimal places does the calculator show?

Results are shown with up to six decimal places, and trailing zeros are dropped. Round the answer to the precision your work requires.

Want to learn more? Read our guide: Linear Interpolation Explained With 5 Real-World Examples.

Last updated: November 16, 2026

More free tools