StatGardenREF. DESK
Calculators/Maths/Linear interpolation
Maths

Linear interpolation calculator

Estimates a missing y (or x) on the straight line through two known points.

What this calculator does

Linear interpolation works out estimates a missing y (or x) on the straight line through two known points. Enter your own figures above and the answer updates as you type: nothing is fixed in the code, so the result reflects exactly the numbers you supply.

The formula this calculator evaluates is printed under the tool and explained below, so you can check the working by hand or reuse it in a spreadsheet.

The formula

Formulay = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁); solved for x when y is known instead

The inputs explained

FieldWhat to enter
x₁A number. Starts at 0.
y₁A number. Starts at 20.
x₂A number. Starts at 10.
y₂A number. Starts at 50.
Known x: find y hereA number. Starts at 4.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How the answer changes with x₁

Every other input is held at the calculator’s starting values while x₁ varies. Select any row to load that scenario into the calculator.

How the answer changes with x₁
x₁Interpolated y at x = 4.000SlopeIn range or extrapolated?
130.0003.333Interpolated: within the two known points
227.5003.750Interpolated: within the two known points
514.0006.000Extrapolated: outside the two known points
10N/AN/AN/A
2068.000-3.000Extrapolated: outside the two known points
5054.500-0.7500Extrapolated: outside the two known points