Saved

Press the star next to a tool's name to save it.

All my tools

Interpolation Calculator

Use this interpolation calculator for linear and bilinear interpolation: find y between two known points, find x for a given y, or look up a value inside a four-corner grid.

Restored your last values ·

For linear interpolation, enter two known points (x, y) and either the x you want the y for, or the y you want the x for. For bilinear interpolation, enter the two x values and the two y values of a grid, the values at its four corners, and the point to look up. Leave unused boxes empty.

Everything is worked out in your browser. Nothing you type is sent anywhere.

–

–

Choose what you want, fill in the boxes, then press Work out the result.

See full result

An interpolation calculator estimates a value between two known points. Linear interpolation finds y at a given x on the straight line through two points, or x at a given y, and bilinear interpolation does the same on a grid with four known corner values. Enter the known values and the point you want, then press the button. The formulas follow the Wikipedia pages on linear and bilinear interpolation, and the work is done in your browser. It is useful for reading values from a table that lie between its rows.

How to use the interpolation calculator

  1. Choose what you want: a y for an x, an x for a y, or a bilinear value.
  2. Enter the two known points, with their x and y values.
  3. Enter the x (or the y) that you want to look up.
  4. For a grid, enter the two x values, the two y values and the four corner values.
  5. Press Work out the result.

The linear interpolation formula

The Wikipedia page on linear interpolation gives the value of y at x as y0 plus (x minus x0) times the slope, where the slope is the change in y divided by the change in x between the known points. For the points (0, 0) and (10, 20), the slope is 2, so at x = 2.5 the value is 5. The calculator also shows the slope. The point is described as lying between the known values, which is interpolation, or outside them, which is extrapolation. Extrapolation uses the same formula but is less reliable, because the straight line may not continue beyond the data. At x = 15 the same line gives 30.

Finding x for a given y

The same line can be read the other way. To find the x where y reaches a target, rearrange the formula: x is x0 plus the target minus y0, divided by the slope. For the same points, a y of 5 gives x = 2.5. This is handy when a table lists a quantity against a variable and you want the variable that gives a certain quantity, for example the temperature at which a property reaches a limit. If the two y values are equal, the line is flat and no single x can be given, so you see a message.

Bilinear interpolation on a grid

Bilinear interpolation extends the idea to two variables. The Wikipedia page describes it as doing linear interpolation first in one direction and then in the other, using the four known values at the corners of a rectangle. On the unit square, the value is f00 times (1 − x)(1 − y), plus f01 times (1 − x) times y, plus f10 times x times (1 − y), plus f11 times x times y. With corner values 0, 1, 1 and 0.5, the value at the center (0.5, 0.5) is 0.625. For a rectangle that is not a unit square, the calculator scales the position first, so a grid with x from 0 to 2 and y from 0 to 4 and the same corner values gives 0.5625 at (1, 1). The result is exact at the corners and changes smoothly between them.

When interpolation works well

Linear interpolation is accurate when the data change at a steady rate, or when the known points are close together. It is a common way to read a value between the rows of a table, such as a tax table, a steam table or a lookup of rates. If the underlying curve bends a lot, the straight line under- or over-estimates, and a finer table or a curve fit does better. Always check that your point lies between the known values, and treat a result that falls outside as a rough guess.

An example from a table

Suppose a table says that a gadget costs 40 at 100 units and 70 at 200 units, and you want the cost at 130 units. The slope is 30 divided by 100, which is 0.3 per unit, so the cost at 130 is 40 plus 30 times 0.3, which is 49. In the calculator, enter (100, 40) and (200, 70), choose to find y, and type 130 for x. The tool shows 49 and marks the point as lying between the known values.

Interpolation compared with a trend line

Interpolation passes exactly through the known points, while a regression trend line passes near all of them and smooths out the noise. If your two points are exact readings, such as entries in a printed table, interpolation is the right tool. If your data are scattered measurements, a regression gives a better estimate of the underlying trend, and the linear regression calculator on this site can do that.

Checking the result

A quick check is to see that the answer lies between the two known y values when the point lies between the known x values. If x is halfway between x0 and x1, y should be halfway between y0 and y1. In the first example, 5 is a quarter of the way from 0 to 20, and 2.5 is a quarter of the way from 0 to 10, so both agree.

Common mistakes

  • Using two points with the same x. The line is vertical and has no slope.
  • Trusting extrapolation. Outside the data, the real curve may bend.
  • Mixing up the corner order in a grid. Check which corner each value belongs to.
  • Interpolating a curved relation over a wide gap. Narrow the gap or use more points.
  • Forgetting the units. Keep x and y in the same units as the table.

What next

Use this often? Add Interpolatio to your Home screen.

Frequently asked questions

What is an interpolation calculator?

A tool that estimates a value between known data points, using a straight line (linear) or a grid (bilinear).

What is the linear interpolation formula?

y = y0 + (x − x0) × (y1 − y0) / (x1 − x0). For (0, 0) and (10, 20) at x = 2.5, y = 5.

What is the difference between interpolation and extrapolation?

Interpolation estimates inside the known range. Extrapolation goes outside it and is less reliable.

How does bilinear interpolation work?

It interpolates in one direction, then in the other, using the four corner values of a rectangle. Corners 0, 1, 1, 0.5 give 0.625 at the center.

How do you interpolate in a table?

Find the two rows around your value, then use the linear formula between them. The result is exact only if the data are linear there.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Math Tools