Category

Linear Interpolation Calculator — Solve for y or x Between Two Points

Estimate an unknown value on a straight line from two known points using the formula y = (x − x₁)(y₂ − y₁)/(x₂ − x₁) + y₁. Solve for y (given x) or x (given y), see the slope and intercept, get a step-by-step solution and chart, and know instantly whether the result is an interpolation or an extrapolation. Supports metric and US units and 20 world currencies (USD, RUB, EUR…).

0 calculations

Interpolation Parameters

Enter your data points

Fill in the two known points and the value to interpolate, then press Interpolate.

What is linear interpolation?

Imagine you are trying to measure the relationship between the amount of flour you use to bake cookies and the number of cookies you get. The first time you used 200 g of flour and got 15 cookies; the second time, with 300 g, you got 20 cookies. How many cookies would you get with 250 g of flour? If you assume the relationship is linear, what you are looking for is the linear interpolation.

If you were looking for a value beyond the tested range — for example, 500 g of flour — it would be called extrapolation. This calculator handles both: whenever your target point falls outside the known range, the result is automatically flagged as an extrapolation.

Linear interpolation formula

To solve for y, the linear interpolation equation is:

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

where:

  • (x₁, y₁) — coordinates of the first known data point;
  • (x₂, y₂) — coordinates of the second known data point; and
  • (x, y) — coordinates of the point you are looking for.

To solve for x instead (when you know the target y), the formula is rearranged to:

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

The formula for extrapolation is identical. Keep in mind, though, that extrapolation often gives results that are not confirmed by experimental data — so, unless you are certain the relationship is linear, it is always safer to interpolate.

How to use this calculator to solve for y

Let's solve the cookie problem together. How many cookies can you bake with 250 g of flour?

  1. Determine the coordinates of the first data point. Here x₁ = 200 and y₁ = 15.
  2. Determine the coordinates of the second data point. Here x₂ = 300 and y₂ = 20.
  3. Choose the x-value for the point you are analyzing. In this case x = 250.
  4. Input all these values into the linear interpolation formula:
y = (250 − 200) × (20 − 15) / (300 − 200)  +  15
y = 17.5

The calculator also reports the slope and intercept of the line determined by the two points. In this example, m = 0.05 and b = 5, so the underlying line is y = 0.05x + 5.

You can also use the calculator for extrapolation — for instance, work out what amount of flour is required to bake 50 cookies by switching the mode to solve for x. Try checking how many cookies you could bake with no flour at all if you assume a linear relationship: the answer reveals why extrapolation should be treated with care.

Interpolation vs. extrapolation at a glance

  • Interpolation — the target point lies between your two known points. Results are generally reliable.
  • Extrapolation — the target point lies outside the known range. Use the result with caution.

💡 You might also be interested in the slope intercept form calculator, the slope calculator, or — if you want to expand into two dimensions — the bilinear interpolation calculator.

Calculation History

Loading...