StatGardenREF. DESK
Calculators/Maths/Bilinear interpolation
Maths

Bilinear interpolation calculator

Estimates a value at a point inside a rectangular grid from the four surrounding known values.

Published 9 August 2026 · Updated 24 September 2026

What this calculator does

Bilinear interpolation estimates a value at a point inside a rectangle when only the four corners are known. It works by interpolating linearly along one axis twice, then interpolating between those two results along the other axis. Doing it in the other order gives an identical answer, which is a useful property and not an obvious one.

The name suggests a flat plane through the corners, and that is the common misreading. The result is linear along either axis taken on its own, but the surface as a whole is curved, because it carries a cross term in xy. Four corner values will not usually lie on a plane at all, and bilinear interpolation is what fits them smoothly without one.

The formula

FormulaP = Q11(x2−x)(y2−y) + Q21(x−x1)(y2−y) + Q12(x2−x)(y−y1) + Q22(x−x1)(y−y1), all divided by (x2−x1)(y2−y1)

Each of the four corner values is weighted by the area of the rectangle diagonally opposite the corner it sits on, and the weighted values are added and divided by the total area of the cell. A target point near one corner therefore takes most of its value from that corner. The calculator rejects any target point outside the grid rather than extrapolating, since the weights turn negative beyond the corners and the result stops being an interpolation.

TermMeaning
Q11, Q21, Q12, Q22The known values at the four corners, indexed by which x and which y they sit on.
Target pointThe position (x, y) inside the rectangle where a value is wanted.
Cross termThe xy component that makes the interpolated surface curved rather than flat.
ExtrapolationEstimating outside the known corners, which this calculator declines to do because the weighting breaks down there.

The inputs explained

FieldWhat to enter
x1The lower x edge of the grid cell.
x2The upper x edge. It must differ from x1.
y1The lower y edge of the grid cell.
y2The upper y edge. It must differ from y1.
Value at (x1, y1)The known value at the corner (x1, y1).
Value at (x2, y1)The known value at the corner (x2, y1).
Value at (x1, y2)The known value at the corner (x1, y2).
Value at (x2, y2)The known value at the corner (x2, y2).
Target xThe x coordinate of the target point, which must fall between x1 and x2.
Target yThe y coordinate of the target point, which must fall between y1 and y2.

When to use it

Reading a value from a two-way table

Engineering and thermodynamic tables are indexed by two variables, and the value wanted usually falls between printed rows and columns. The four surrounding entries are exactly the four corners this calculation needs.

Resampling an image or a height map

Scaling an image or sampling terrain elevation between grid points is bilinear interpolation applied at every output pixel. It is the standard step up from nearest-neighbour sampling and it removes most of the blockiness at very little cost.

Estimating between measurement points on a grid

Readings taken across a regular grid, such as temperature or signal strength at fixed stations, can be filled in between stations this way, provided the quantity varies smoothly enough for the assumption to be reasonable.

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 does the interpolated value change along the bottom edge?

The target point swept across the cell at y = 0, the lower edge, where the corner values are 20 and 30.

Corners 20, 30, 40, 60 on a 10 by 10 cell, at y = 0
Target xInterpolated value P
020.000
2.522.500
525.000
7.527.500
1030.000
Along this edge the value runs from 20 to 30 in even steps, a gain of 1 for every unit of x. The two end rows return the corner values exactly, which is the basic requirement any interpolation has to meet.

Is the interpolated surface flat?

An identical sweep across x, moved to the opposite edge of the same cell, where the corner values are 40 and 60.

The same sweep at y = 10, the upper edge
Target xInterpolated value P
040.000
2.545.000
550.000
7.555.000
1060.000
No. This sweep runs from 40 to 60, gaining 2 for every unit of x, where the same sweep along the bottom edge gained only 1. The slope in x depends on where you are in y, which is precisely the cross term at work and precisely what a flat plane could not do.

Questions

Is bilinear interpolation the same as fitting a plane through the corners?

No, and four arbitrary corner values will not lie on a plane anyway. The result is linear along each axis separately but carries an xy cross term, which makes the surface a curved one known as a hyperbolic paraboloid.

Does the order of interpolation matter?

No. Interpolating along x first and then y gives exactly the same result as y first and then x. The symmetry falls straight out of the weighting, and it is a useful check when implementing the calculation.

What happens if the target point is outside the grid?

That would be extrapolation rather than interpolation, and this calculator declines it. Outside the corners some of the weights go negative and the result can fall well outside the range of the four known values, which is rarely what anyone wants.

When should I use bicubic interpolation instead?

When smoothness across cell boundaries matters. Bilinear is continuous but its slope jumps at the edges between cells, which shows up as visible banding on smooth gradients. Bicubic uses a wider neighbourhood to match slopes as well as values, at a higher cost.

For interpolating between just two points along a single axis, see the linear interpolation calculator. For numerically integrating a function from sampled values, see the trapezoidal rule calculator.