Linear Interpolation Calculator

Interpolated y—
Slope (y₂ − y₁) ÷ (x₂ − x₁)—

How Linear Interpolation Calculator is calculated: y = y₁ + (x − x₁)(y₂ − y₁) ÷ (x₂ − x₁)

What is a Linear Interpolation Calculator?

The Linear Interpolation Calculator is a free online tool that estimates a value that lies between two known data points, by drawing a straight line between them and reading off the value in between. Students, engineers and anyone reading values off a table use it when a value at a point the table skips — a temperature at 4 pm when the table lists 3 pm and 5 pm. Instead of working out the fraction of the way along the interval and scaling the gap by hand, which is easy to get backwards, you type the two known points (x₁, y₁) and (x₂, y₂), plus the x value you want to estimate y at and the calculator returns the interpolated y and the slope of the line between the two points straight away.

The working idea is simple. the calculator finds how far x sits between x₁ and x₂ as a fraction, then moves the same fraction of the way from y₁ to y₂ If x is a quarter of the way from x₁ to x₂, the answer is a quarter of the way from y₁ to y₂. That is the straight-line assumption: between the two known points, the value changes at a steady rate. There is no sign-up and nothing to install: the page runs entirely in your browser, so your numbers never leave your device.

That matters because tables only list round values, but real questions fall between them, and a straight-line estimate is usually close enough when the gap is small The estimate is only as good as the straight-line assumption — if the true relationship bends between the two points, the estimate is off, and the error grows with the size of the gap. The rest of this page walks through the formula, the input people get wrong most often, and a worked example with real numbers you can check by hand.

How a Linear Interpolation Calculator works

At its core, the calculator applies y equals y₁ plus the fraction (x − x₁) ÷ (x₂ − x₁) times the gap (y₂ − y₁). The fraction (x − x₁) ÷ (x₂ − x₁) is 0 at the first point and 1 at the second, so the formula returns exactly y₁ at x₁ and exactly y₂ at x₂, and scales smoothly in between. The slope (y₂ − y₁) ÷ (x₂ − x₁) is the rate of change per unit of x. The formula box at the top of this page shows the same rule in symbols: y = y₁ + (x − x₁)(y₂ − y₁) ÷ (x₂ − x₁).

The calculator first works out the slope from the two known points, then applies it to the distance from x₁ to x. Because it is one multiplication and one addition, the arithmetic is exact for the straight-line model. The two known points must have different x values — if x₁ equals x₂ there is no interval to interpolate across, and the calculator shows dashes. The x you ask about does not have to sit between the points, but if it lies outside, you are extrapolating, not interpolating.

For a truly straight relationship the answer is exact; for a curved one it is an approximation, and the error is largest near the middle of a wide interval A slope calculator can help you check the numbers that feed into this step, and it is worth doing that check before you trust an answer that looks surprising.

The the two known points explained

The two known points are the whole basis of the estimate, and the mistake people make is picking points that are far apart when closer ones exist. Interpolating across a wide gap assumes the value changes steadily over that whole stretch, which is often false: a temperature can rise fast in the morning and flatten by noon, so points an hour apart give a far better estimate than points six hours apart.

Always use the two known points nearest to the x you are asking about, one on each side if you can. If the table gives values every 10 units and you need x = 43, use the points at 40 and 50, not the points at 0 and 100. If your x sits exactly on a known point, the answer is that point's y value — the calculator returns it exactly, which is a useful check that you entered the points the right way round.

Check the slope's sign before you trust the answer: if y₂ is bigger than y₁, the interpolated value must sit between them, so an answer outside that range means the points were entered backwards. A linear equation calculator is a good cross-check when the input comes from a measurement or a table rather than from a textbook problem.

A worked example

Take the default numbers on this page. You know that at x = 0 the value is 0, and at x = 10 the value is 100, and you want the value at x = 4.

The slope is (100 − 0) ÷ (10 − 0) = 10, so the value rises by 10 for each unit of x. Four units along from x = 0, the value is 0 + 10 × 4 = 40.

The answer sits between 0 and 100, closer to the low end because 4 is closer to 0 than to 10 — exactly what you would expect from a straight line. If the true relationship were curved, the real value at x = 4 could differ, but with only two points the straight line is the honest estimate. Check the endpoints: at x = 0 the formula gives 0, and at x = 10 it gives 100, so both known points are reproduced exactly.

Where the Linear Interpolation Calculator is used

In science, interpolation reads values off published tables: the density of water at 37 °C from a table that lists 30 °C and 40 °C, or the vapour pressure at a temperature between two listed rows.

In engineering, it estimates material properties between tested temperatures or loads, where testing every value would take too long and cost too much. A average calculator often sits next to it in the same workflow, because the two answers answer different halves of the same question.

In everyday life, it fills gaps in bills and records — estimating a mid-month meter reading from the readings at the start and end of the month, for example.

It also helps to keep the units consistent from the first number to the last. Mixing units — metres with centimetres, degrees with radians, seconds with minutes — is the quietest way to get an answer that looks plausible and is wrong by a large factor. Write the unit next to every number you enter, and check the result's unit against the unit you expect before you use the answer anywhere else.

Linear Interpolation Calculator vs Slope Calculator

A slope calculator finds the rate of change between two points, and this calculator uses that rate to estimate a value in between. The slope is the middle step of interpolation, not the answer itself — interpolation adds the step of applying the slope from the first point to your x.

Use the slope calculator when the rate itself is what you need, such as the gradient of a road or the rate a tank is filling. Use interpolation when you need the value at a point in between, and the slope is just the working. The scientific calculator covers the other side of the same problem, so the two tools complement each other rather than compete.

Both tools need the same two points, and both break if the two x values are equal. If you already know the slope, you can still check an interpolation by hand: y = y₁ + slope × (x − x₁).

Common mistakes with the Linear Interpolation Calculator

The first mistake is interpolating across a huge gap when nearer points exist. The wider the interval, the more room there is for the true curve to bend away from the straight line, so always use the closest known points on either side.

The second mistake is mixing up which point is which — entering y₂ where y₁ belongs, or swapping x₁ and x₂. The formula still returns a number, but it is the wrong number, so check that the answer lies between y₁ and y₂ before you use it.

The third mistake is treating an interpolated value as a measured one. It is an estimate built on the assumption of a straight line, so quote it as an estimate and keep the two known points beside it, especially in a lab report or a bill.

A last mistake is trusting the first answer without a rough check. Before you accept a result, estimate it by hand to one significant figure: if the calculator says 400 and your rough estimate says 40, something is off — usually a misplaced decimal point or a wrong unit. The calculator does the arithmetic; the judgement about whether the answer makes sense still belongs to you.

How to use this Linear Interpolation Calculator

Open the page and enter the two known points (x₁, y₁) and (x₂, y₂), plus the x value you want to estimate y at. Enter the lower point first and the higher point second, then the x you want. The order of the two points does not change the answer, but keeping them in order makes mistakes easier to spot.

Read the interpolated y as the straight-line estimate at your x, and read the slope as the rate the value changes per unit of x. If your x lies outside the interval between x₁ and x₂, the calculator still returns a number, but that is extrapolation — treat it with much more suspicion than an estimate inside the interval.

Everything runs in your browser. No account, no upload, no data sent anywhere — your numbers never leave your device. If a result looks wrong, re-check the inputs first: a single mistyped number is the usual cause, and a slope calculator will confirm the arithmetic.

Frequently Asked Questions

The interpolated value is 40, and the slope between the points is 10. Four units along a line that rises 10 per unit gives 0 + 10 × 4 = 40.

y equals y₁ plus the fraction (x − x₁) ÷ (x₂ − x₁) times the gap (y₂ − y₁) The fraction (x − x₁) ÷ (x₂ − x₁) is 0 at the first point and 1 at the second, so the formula returns exactly y₁ at x₁ and exactly y₂ at x₂, and scales smoothly in between. The slope (y₂ − y₁) ÷ (x₂ − x₁) is the rate of change per unit of x.

It is exact when the true relationship is a straight line, and a good approximation when the interval is small and the relationship bends only gently. The error grows with the width of the interval and with how much the true curve bends, so use the closest known points you have and treat wide-gap estimates as rough.

Interpolation estimates a value between two known points, where the straight line is anchored at both ends. Extrapolation estimates a value outside the known range, where the line is anchored at one end only and can drift far from reality. Interpolation is usually safe; extrapolation is a guess that gets worse the further out you go.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.