Skip to content
Omnikalc

Linear interpolation calculator: find a value between two points

Estimate the value of y at any x from two known points (x₁, y₁) and (x₂, y₂) on a straight line, for tables, charts and measurements.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Results

Interpolated y

0.99695

Interpolation between the two points
Slope of the line
-0.00025
Position of x between x₁ and x₂
50 %
y-intercept of the line
1.0032

Reading between two values

Tables and charts give values only at certain points: water density at 20 °C and 30 °C, a tax bracket at two incomes, a sensor reading every hour. Linear interpolation estimates the value in between by assuming it changes along a straight line from one known point to the next. It is the simplest and most widely used way to fill such gaps.

The formula

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

  • (x₁, y₁) and (x₂, y₂) are the two known points,
  • x is the value where you want y,
  • (y₂ − y₁) ÷ (x₂ − x₁) is the slope of the line between the points.

The calculator also shows where x falls between x₁ and x₂ as a percentage, and the equation of the line through the two points.

Worked example

A table gives the density of water as 0.9982 g/cm³ at 20 °C and 0.9957 g/cm³ at 30 °C. What is it at 25 °C?

  1. Slope = (0.9957 − 0.9982) ÷ (30 − 20) = −0.00025 per °C.
  2. y = 0.9982 + (25 − 20) × (−0.00025) = 0.99695 g/cm³.
  3. 25 °C is 50% of the way from 20 to 30 °C, so the result is exactly halfway between the two densities.

The measured value at 25 °C is 0.99705 g/cm³: the interpolation is off by only 0.01%.

Interpolation versus extrapolation

Situation Name Reliability
x between x₁ and x₂ interpolation good if the curve is smooth
x outside the two points extrapolation risky: the trend may change

The calculator warns you when x falls outside the interval, since extending a straight line too far can give misleading results.

When to be careful

Linear interpolation assumes a straight line, so its error grows with the curvature of the real relationship and with the distance between the points. Interpolating the area of a circle between r = 1 and r = 3 to estimate r = 2 gives 5π instead of the true 4π, an error of 25%. Using closer points reduces the error quickly.

Common uses

  • Engineering tables: steam tables, material properties, pipe friction factors.
  • Finance: estimating an interest rate between two published maturities on a yield curve.
  • Science: reading a calibration curve between two standards.
  • Everyday life: estimating the fuel left between two gauge marks, or the temperature at noon from readings at 9 am and 3 pm.

Two-step interpolation

For a table with two inputs, such as a property that depends on temperature and pressure, interpolate along one input first, then along the other. This is called bilinear interpolation and uses the same formula three times.

Frequently asked questions

What is the linear interpolation formula?

y = y₁ + (x − x₁) × (y₂ − y₁) ÷ (x₂ − x₁). It assumes the value changes along a straight line between the two known points.

When is linear interpolation used?

To read between the lines of a table, such as tax brackets, steam tables, water density or bond yields, or to estimate a missing measurement between two readings.

What is the difference between interpolation and extrapolation?

Interpolation estimates a value between the known points; extrapolation goes beyond them, which is less reliable because the trend may change.

How accurate is linear interpolation?

Very accurate when the points are close and the curve is nearly straight between them. For strongly curved data, use closer points or a curve-fitting method.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.