Bilinear Interpolation Calculator

Interpolate a value inside a rectangular grid from four known corner values.

2D grid interpolation
Enter rectangle bounds, four corner values, and the target point.

About bilinear interpolation

Bilinear interpolation estimates a value at a point inside a rectangle when values are known at all four corners. It is the two-dimensional extension of ordinary linear interpolation. Rather than fitting one line, the method blends along both coordinate directions. It is widely used for resampling images, evaluating gridded scientific data, mapping textures in computer graphics, estimating table values, and building smooth approximations from measurements collected on a rectangular mesh. The four corner values are conventionally named by their coordinates. The bottom-left value belongs to x1 and y1, the bottom-right to x2 and y1, the top-left to x1 and y2, and the top-right to x2 and y2. The target uses coordinates x and y. This calculator computes normalized horizontal and vertical positions, then weights each corner according to its opposite rectangular area. A corner close to the target receives more weight, while a distant corner receives less. All four weights add to one when the point is inside the rectangle. An equivalent way to understand the algorithm is as two successive linear interpolations. First interpolate horizontally between the two bottom values and separately between the two top values. Then interpolate vertically between those two intermediate results. Reversing the order gives the same answer: interpolate vertically on the left and right edges, then horizontally. This symmetry is useful for checking an implementation and explains why the final expression contains products of one horizontal and one vertical factor. The method reproduces every corner exactly. It also reproduces any function that is linear in x while y is fixed and linear in y while x is fixed, including surfaces with an x times y cross term. It does not generally reproduce curved surfaces exactly. When the true surface bends strongly, using a finer grid or a higher-order method such as bicubic interpolation can reduce approximation error. Bilinear interpolation is nevertheless popular because it is fast, continuous, easy to audit, and needs only four samples. The axis limits must differ because a rectangle with zero width or height cannot define interpolation fractions. Although the formula can extrapolate beyond the rectangle, estimates outside the known data range may be unreliable because one or more weights become negative. Keep coordinate units consistent across each axis and ensure the corner values describe the same measured quantity. The result then carries the same unit as those four values.

Bilinear interpolation examples

Examples using rectangular grids and internally consistent corner values.

Grid and targetResultExplanation
Unit square; corners 0, 10, 20, 30; target (0.5, 0.5)15At the center, all four corners have equal weight.
Unit square; corners 0, 10, 20, 30; target (0, 0)0A corner target reproduces that corner value exactly.
Rectangle 0 to 2 and 0 to 4; corners 2, 6, 10, 14; target (1, 2)8The midpoint is the average of the four corner values.
Unit square; corners 5, 5, 5, 5; target (0.3, 0.8)5A constant surface stays constant everywhere.

How to use the bilinear interpolation calculator

  1. Enter the left and right x coordinates and the bottom and top y coordinates of the rectangle.
  2. Enter the known function value at each of the four labeled corners.
  3. Enter the x and y coordinates of the target point using the same coordinate system.
  4. Select Calculate Interpolation to evaluate the weighted four-corner estimate.

Bilinear interpolation FAQ

Is bilinear interpolation the same as linear interpolation?

It applies linear interpolation in two coordinate directions instead of one. The resulting surface can contain a cross term even though each one-dimensional slice is linear.

Must the target lie inside the rectangle?

The formula also returns an extrapolated value outside the rectangle. Such results may be less reliable because they extend trends beyond the four known samples.

Why can the rectangle not have zero width or height?

The method divides by both coordinate spans to calculate normalized positions. A zero span makes that fraction undefined and does not describe a two-dimensional cell.

Does the order of interpolation matter?

No. Interpolating horizontally and then vertically gives the same result as interpolating vertically and then horizontally, apart from tiny floating-point rounding differences.

When should I use bicubic interpolation instead?

Bicubic interpolation can produce smoother derivatives and better approximate curved data when more neighboring samples are available. Bilinear interpolation remains faster and is often sufficient for dense grids.