Mihsaba›Math›Linear Interpolation Calculator

Linear Interpolation Calculator

Estimate y at a target x from two known points, with slope, interval position and an interpolation-versus-extrapolation flag.

Share this free calculator

Send this tool to someone who needs the calculation.

How to use

Linear interpolation estimates a value on the straight line through two known points. A target x between x₁ and x₂ is interpolation; a target outside the interval is extrapolation and usually deserves more caution.

  1. Enter known points (x₁,y₁) and (x₂,y₂).
  2. Enter the target x.
  3. Review y, slope, position fraction and calculation type.

How it is calculated

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

Example

Between (0,10) and (20,50), x=5 gives t=0.25 and y=10+0.25×40=20.

Important notes

The method assumes a straight-line change between the two points. Real data may not be linear, and extrapolation outside the known range is generally less reliable.

Worked examples and interpreting results

Between (0,10) and (4,30), x=1 is one quarter of the horizontal distance, giving y=15. Linear interpolation assumes a straight-line change between the endpoints.

Worked examples and interpreting results
CaseCalculationResult
Value at x=110 + (1−0) × (30−10) ÷ (4−0)15
Value at midpoint x=210 + 2 × 20 ÷ 420

How to check the result

The two x coordinates must differ to avoid division by zero. An x outside their interval gives extrapolation rather than interpolation; extending the line beyond the data is an additional assumption.

Frequently asked questions

What if x₁ equals x₂?

The formula has a zero denominator, so the calculator rejects that vertical-line case.

Does it allow extrapolation?

Yes, but the result is explicitly flagged as outside the interval.

What is t?

It is the relative x position: 0 at the first point and 1 at the second.

Can interpolation be used outside the known interval?

Using the formula beyond the two known points is extrapolation, not interpolation, and can be unreliable because the trend may change. Results are safer when the target x lies between x₁ and x₂.