Math

Linear Interpolation Calculator

Estimate a value between two known points assuming a straight-line relationship.


Linear Interpolation Calculator

Advertisement

Estimate a value between two known data points, assuming the relationship between them is a straight line.

How it works

The formula is y = y₁ + (x – x₁) × (y₂ – y₁) ÷ (x₂ – x₁). Between the points (0, 0) and (10, 100), the value at x = 3 interpolates to y = 30.

What this does not include

This assumes a straight-line relationship between the two known points — if the real relationship curves, linear interpolation only approximates it, with more error the further the true curve departs from a straight line.

How to use this calculator

  1. Enter the two known points (x₁, y₁) and (x₂, y₂).
  2. Enter the x-value you want to estimate y for.

A worked example

Points (0,0) and (10,100), interpolating at x=3: y = 0 + (3−0)/(10−0) × (100−0) = 30.

Points (20,68) and (30,86), interpolating at x=25 (the midpoint): y = 77, exactly halfway between 68 and 86.

What the variables mean

Variable Meaning
(x1,y1), (x2,y2) Two known data points
x The point to estimate y for, between x1 and x2

Edge cases worth knowing

Linear interpolation assumes a straight line between the two known points — it’s an estimate, not necessarily the true value if the actual relationship curves between those points.

Identical x1 and x2 values make interpolation impossible — there’s no line to interpolate along with zero horizontal distance between the points, so the calculator declines to show a result.

When is linear interpolation a reasonable estimate?

It works best when the two known points are close together and the underlying relationship is smooth — the wider the gap or the more curved the real relationship, the less accurate a straight-line estimate becomes.

What if x falls outside the range between x₁ and x₂?

The formula still computes an answer (called extrapolation instead of interpolation), but the further outside the known range you go, the less reliable that estimate becomes.

Where is linear interpolation commonly used?

Reading a value between two rows of a lookup table, estimating between two calibration points, and filling gaps in a dataset are all common uses.

Be the first to rate this

Written by

J. Adeyemi

Statistics writer

J. Adeyemi writes the statistics and probability calculators, from descriptive summaries through to distributions and conditional probability. The recurring theme is scope: each page states precisely which question it answers, because most statistical mistakes come from applying a correct formula to the wrong question. Related-but-different measures get separate pages rather than being quietly merged.

Reviewed by

T. Okafor

Calculator reviewer — mathematics

T. Okafor reviews the mathematics calculators, verifying algebraic correctness and, just as importantly, behaviour at the edges — division by zero, undefined results, and the floating-point cases where a formula technically returns a number that should be reported as undefined. Every test case is recomputed independently rather than taken on trust.

How we write and review

Related calculators