Linear Interpolation Calculator
Enter two known points and a query point x to estimate the matching y on the straight line that joins them — the fast way to read between two data points.
Read between two points
Give the calculator two known points (x1, y1) and (x2, y2) plus a query x, and it returns the y value that sits on the line connecting them.
Straight-line assumption
Interpolation assumes the relationship is linear between your two points. A query x outside the range [x1, x2] is extrapolation — use it with care.
What is linear interpolation?
Reading between two known points
The linear interpolation calculator estimates an unknown value that falls between two points you already know. Imagine a table that lists y for x = 0 and for x = 10, but you need the value at x = 5. Linear interpolation draws a straight line between the two known points and reads the y value off that line at your query x. It is one of the most widely used techniques in engineering, statistics, and everyday data work — filling gaps in lookup tables, estimating sensor readings between calibration points, and smoothing animations or charts. All it needs is two points and the x you care about.
Enter two known points and a query x to get the interpolated y on the line between them instantly.
Linear interpolation walks the fraction of the way from the first point to the second and adds that same fraction of the rise in y.
y = y1 + (x − x1) × (y2 − y1) / (x2 − x1)Take two points (0, 0) and (10, 100) and ask for y at x = 5. The run from x1 to x2 is 10, and your query x is 5 units along it — exactly halfway. The rise from y1 to y2 is 100, so half of that rise, 50, is added to y1 = 0, giving y = 50. The term (y2 − y1) / (x2 − x1) is just the slope of the line; multiplying it by how far x sits past x1 scales the change in y to match.
The formula is exact for a straight line, but a couple of practical points are worth keeping in mind.
It assumes a straight line — and watch for extrapolation
Linear interpolation assumes the value changes at a constant rate between your two points; if the true relationship curves, the estimate drifts from reality, so keep the two known points close together where you can. Querying an x outside the range [x1, x2] is extrapolation rather than interpolation and is far less reliable. The two x values must also differ — when x2 equals x1 the line is vertical and the slope is undefined, so no single y can be returned.