Linear Interpolation Calculator

Estimate an in-between value from two points or a data table with linear interpolation, or work backward to find x from a known y.

Data
Find
Slope of the segment
3
Line through the points
y = 3x + 20
Position t
0.4interpolation (0 ≤ t ≤ 1)
y at x = 1462

Show the work

  1. Use the points (10, 50) and (20, 80).
  2. Linear interpolation formula: y = y1 + (x − x1) × (y2 − y1) ÷ (x2 − x1)
  3. y = 50 + (14 − 10) × (80 − 50) ÷ (20 − 10)
  4. = 50 + 4 × 3 = 62
  5. Fraction of the way from point 1 to point 2: t = 0.4.
101214161820020406080(14, 62)

Known points in blue; the interpolated point in gold.

Linear interpolation fills a gap between two known data points by assuming a straight line between them. It is how engineers read steam tables, how accountants estimate values between table rows, and how graphics programs blend colors. This calculator interpolates from two points or from a whole table, works in either direction, and warns you when you step outside the data.

How to use the linear interpolation calculator

  1. Choose Two points or Table of points.
  2. Choose whether to find y for a given x or x for a given y.
  3. Enter (x1, y1) and (x2, y2), or paste a table with one “x, y” pair per line.
  4. Enter the known value. The result, slope, line equation and position t appear on the tape, with the points plotted below.

Linear interpolation formula

y = y1 + (x − x1) × (y2 − y1) ÷ (x2 − x1)

The fraction (y2 − y1)/(x2 − x1) is the slope of the line. An equivalent and often handier form uses the position t = (x − x1)/(x2 − x1):

y = y1 + t(y2 − y1) = (1 − t)y1 + ty2

When 0 ≤ t ≤ 1 you are interpolating; t outside that range means extrapolation. Solving the first formula for x gives inverse interpolation: x = x1 + (y − y1)(x2 − x1)/(y2 − y1).

Worked example

A tank holds 50 liters at 10 minutes and 80 liters at 20 minutes. Estimate the volume at 14 minutes.

Slope: (80 − 50) ÷ (20 − 10) = 3 liters per minute.

Interpolate: y = 50 + (14 − 10) × 3 = 50 + 12 = 62 liters.

Position: t = 4/10 = 0.4, so 14 minutes is 40% of the way from the first reading to the second.

Inverse: to find when the tank reaches 62 liters, x = 10 + (62 − 50) × 10/30 = 14 minutes.

With a table, only the two bracketing rows matter. In the default table, x = 25 falls between (20, 1.630) and (30, 1.975), halfway between them, so y = 1.630 + 0.5 × 0.345 = 1.8025.

How accurate is linear interpolation?

The method is exact when the underlying relationship really is a straight line and approximate otherwise. The error depends on how curved the true function is and on how far apart the known points are. For a smooth function the worst-case error over a gap of width h is at most h2/8 times the largest size of the second derivative in that gap — so halving the spacing between table rows cuts the error by about a factor of four.

Practical guidance:

  • Use the closest bracketing points. Interpolating across a wide gap ignores curvature in between.
  • Watch for curved data. Exponential growth, square laws and saturation curves bend away from straight lines; a finer table helps more than a cleverer formula.
  • Be careful extrapolating. A trend that held from 10 to 20 minutes may not hold at 60.
  • Do not interpolate categories. Interpolation assumes the in-between value is meaningful, which is not true for shoe sizes or tax brackets.

The slope used here is the same one the slope calculator finds from two points, and the midpoint calculator is the special case t = 0.5. When your data has scatter rather than exact values, fit a best line with the linear regression calculator instead. For quantities that scale through the origin, the proportion calculator is simpler.

Frequently asked questions

What is the linear interpolation formula?

y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁). It assumes the quantity changes at a constant rate between the two known points, so the unknown point lies on the straight line joining them.

What is the difference between interpolation and extrapolation?

Interpolation estimates a value between known points; extrapolation goes beyond them. Extrapolation uses the same formula but is riskier, because the straight-line pattern may not continue. The calculator flags it.

How does table interpolation work?

The rows are sorted by x, the two rows that bracket your x are found, and the formula is applied to just those two rows. Each gap between neighboring rows gets its own straight line.

Can I find x when I know y?

Yes. Choose Find: x for a given y. The calculator swaps the roles of x and y in the formula. It needs the two bracketing y values to differ, otherwise the line is flat and x is not determined.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.