Bilinear Interpolation Calculator

Enter the four corners of your table cell and the point inside it. The answer updates as you type and shows every step.

Enter the two x values, the two y values, the four corner values f(x, y), then the point you want.

f(14, 800) = 25.92

tx = 0.4, ty = 0.6. Bottom edge R1 = 21.6, top edge R2 = 28.8, so f = 21.6 + 0.6 × (28.8 − 21.6) = 25.92. Corner weights: Q11 0.24, Q21 0.16, Q12 0.36, Q22 0.24.

Bilinear interpolation formula: with tx = (x − x1) / (x2 − x1) and ty = (y − y1) / (y2 − y1), f(x, y) = (1 − tx)(1 − ty)·Q11 + tx(1 − ty)·Q21 + (1 − tx)ty·Q12 + tx·ty·Q22. It is ordinary linear interpolation done twice along x, then once along y.

How to use the bilinear interpolation calculator

  1. Type the two x values that bracket your point (x1 and x2) and the two y values (y1 and y2).
  2. Type the four table values at the corners: Q11 at (x1, y1), Q21 at (x2, y1), Q12 at (x1, y2) and Q22 at (x2, y2).
  3. Type the point (x, y) you want. The result, the two edge values R1 and R2, and the weight of each corner appear below.
  4. Check the result lies between the smallest and largest corner value. If it does not, a corner is in the wrong box.

Worked example: a shipping rate table

A courier prices parcels by weight and distance. The table gives four prices, and you need the price for a 14 kg parcel going 800 km.

500 km (y1)1000 km (y2)
10 kg (x1)$18.00 (Q11)$24.00 (Q12)
20 kg (x2)$27.00 (Q21)$36.00 (Q22)
  • Fractions: tx = (14 − 10) / (20 − 10) = 0.4 and ty = (800 − 500) / (1000 − 500) = 0.6.
  • Along weight at 500 km: R1 = 18 + 0.4 × (27 − 18) = 21.60.
  • Along weight at 1000 km: R2 = 24 + 0.4 × (36 − 24) = 28.80.
  • Along distance: f = 21.60 + 0.6 × (28.80 − 21.60) = $25.92.

Check with the weights: 0.24 × 18 + 0.16 × 27 + 0.36 × 24 + 0.24 × 36 = 4.32 + 4.32 + 8.64 + 8.64 = 25.92. The weights add to 1, and the corner closest to the point (10 kg, 1000 km) gets the most weight, 0.36. These are the default values in the calculator above.

For a longer walk through the method, including an image resizing example, read our bilinear interpolation guide. For property tables such as superheated steam, see double interpolation.

Bilinear Interpolation Calculator: frequently asked questions

What is bilinear interpolation used for?

It estimates a value inside a two-way table or grid: steam and refrigerant tables, tax or rate tables, weather and elevation grids, and image resizing, where each new pixel is a weighted mix of the four nearest pixels.

Does it matter whether I interpolate along x or y first?

No. Doing y first gives the same answer. In the example, interpolating along distance first gives 21.60 at 10 kg and 32.40 at 20 kg, and then 21.60 + 0.4 × (32.40 − 21.60) = 25.92 again.

Is bilinear interpolation the same as double interpolation?

Yes in practice. Engineering courses call it double interpolation when you read a table twice, once for each variable. The arithmetic is the same three linear steps this calculator shows.

What if my point is outside the four corners?

Then the fractions fall below 0 or above 1 and the result is an extrapolation. The calculator still gives a number but flags it. Pick the table cell that contains your point if you can.

How is bilinear different from bicubic interpolation?

Bilinear uses the 4 nearest values and gives a surface that is straight along each edge. Bicubic uses 16 values and gives a smoother surface, which is why photo editors prefer it for enlarging images.

More interpolation tools and guides

Interpolation Calculator is a mathematical method used to estimate an unknown value between known data points.

Privacy

Disclaimer

Terms

GDPR

Affiliate

Refund

Company

About Us

Contact Us