Interpolation and Extrapolation Calculator (Linear, Bilinear, Lagrange)
Paste x and y values or a 2-D property table and estimate in-between values by linear, Lagrange, Newton or bilinear interpolation, with full working.
Runs in your browser. Your files never leave your device. See how to check
…
How to do it
- 1Enter the table
Type x and y pairs, paste two columns or import a CSV file.
- 2Set the target
Type the x value you need in Find y at x.
- 3Choose a method
Pick linear, Lagrange or Newton and, for the polynomial methods, the degree.
- 4Check the working
Read the substituted formula, the basis values or the divided-difference table.
- 5Look at the graph
Compare the straight segments with the polynomial curve and see where the estimate sits.
- 6Use 2-D tables
For two inputs, open Bilinear and paste the whole table or type the four corner values.
About this tool
Tables only list values at fixed steps, yet the question always asks for something in between: the logarithm of 2.537, the specific enthalpy of steam at 170 °C and 3 bar, the population in a year between two censuses. Interpolation fills that gap. This calculator takes a table you type, paste or import, and estimates y at any x in three ways. Linear interpolation joins the two neighbouring points with a straight line, which is what most exams and engineering tables expect. Lagrange and Newton divided differences fit a polynomial through several nearby points for a smoother, usually more accurate result; both give the same polynomial, so you can check one against the other. A separate tab does bilinear interpolation on four corner values or directly inside a pasted two-way table. Every answer comes with the substituted formula, the curve on a graph and a clear warning when x lies outside the data and you are really extrapolating.
Who this is for
Students reading log, trigonometric and statistical tables, engineering and thermodynamics students using steam and refrigerant tables, numerical methods courses that teach Lagrange and Newton forms, and anyone who needs a quick reading between two known values.
The methods
Linear: y = y₀ + (x − x₀)(y₁ − y₀) ÷ (x₁ − x₀), using the two table points that bracket x. Outside the table the nearest end segment is extended, and the result is flagged as extrapolated. Lagrange: P(x) = Σ yᵢ Lᵢ(x), where each basis polynomial Lᵢ(x) is the product of (x − xⱼ) ÷ (xᵢ − xⱼ) over all other points. The tool shows each Lᵢ value so the sum can be checked by hand. Newton divided differences build a triangular table whose top diagonal gives the coefficients of P(x) = f[x₀] + f[x₀, x₁](x − x₀) + …, which is easier to extend when a new point is added. You choose the polynomial degree, and the points nearest to x are used, which avoids the wild swings a single high-degree polynomial can show near the ends of a table.
Bilinear interpolation
For a quantity that depends on two variables, such as enthalpy as a function of temperature and pressure, interpolate along x on the two bracketing rows and then once along y between those results. Paste a whole table with x headings across and y headings down, and the tool finds the surrounding cell itself.
Worked example
From the table e⁰ = 1, e¹ = 2.7183, e² = 7.3891, e³ = 20.0855, estimate e^2.5. Linear between x = 2 and 3 gives 7.3891 + 0.5 × 12.6964 = 13.7373, well above the true 12.1825 because the curve bends. A cubic through the four points closest to 2.5 gives about 11.87, much closer to the true value. In a steam table with h = 2776 kJ/kg at 150 °C and 2875 at 200 °C (1 bar), linear interpolation at 170 °C gives 2776 + 20 ÷ 50 × 99 = 2815.6 kJ/kg.
Limits
Interpolation assumes the quantity changes smoothly between table entries; it cannot detect a phase change or a step hidden between two rows. Extrapolation is shown but is not reliable, and high-degree polynomials can oscillate badly (Runge's phenomenon). Splines and least-squares curve fitting are not included.
Worked example
Points (2, 7.3891) and (3, 20.0855): linear at x = 2.5 gives 13.7373. Steam table 150 °C 2776, 200 °C 2875: at 170 °C, 2815.6.
Quick facts
- Category: Math & Science
- Works in your browser, no sign-up, no upload.
- Your input stays on your device.
- Available in English.
- Content last reviewed:
- Official source: NIST Digital Library of Mathematical Functions, section 3.3 Interpolation
Frequently asked questions
When should I use linear rather than polynomial interpolation?
Use linear when the table steps are small, when an exam or standard tells you to, or when the data are noisy. Use a quadratic or cubic through nearby points when the curve clearly bends and the values are exact.
Why do Lagrange and Newton give the same answer?
Through n points with distinct x values there is exactly one polynomial of degree n − 1. Lagrange and Newton are two ways of writing that same polynomial, so their values must agree.
What does the extrapolation warning mean?
Your x lies outside the range of the table, so the tool is extending the trend beyond the data. The answer may be badly wrong if the pattern changes.
How do I interpolate in a steam table with two inputs?
Open the Bilinear tab and paste the table with temperatures across the top and pressures down the side, or type the four surrounding values directly. The tool interpolates along each row and then between rows.
Can points be in any order?
Yes. Points are sorted by x for the calculation, and the Sort button tidies the table. Two points with the same x are reported because polynomial methods cannot use them.
How many decimal places should I give?
Give no more decimals than the table itself, since interpolation cannot add accuracy that the table does not contain.
