Calcoid

Linear Interpolation Calculator

Find y at any x (or x at any y) between two known points using y = y1 + (x - x1) * (y2 - y1) / (x2 - x1). Returns slope, intercept, and flags extrapolation beyond the known range.

Two known points and a query

Point 1 (x1, y1)

Point 2 (x2, y2)

The x value where you want to read y off the line.

Interpolated y

50

Formula used

y = 0 + (5 - 0) * (100 - 0) / (10 - 0)

Slope (m)

10

Intercept (b)

0

Query

5

Line equation

y = 10x + 0

Frequently Asked Questions about the Linear Interpolation Calculator

What is linear interpolation?
Linear interpolation estimates a value between two known points by assuming the function is a straight line through them. With points (x1, y1) and (x2, y2), the value of y at any query x is y = y1 + (x - x1) * (y2 - y1) / (x2 - x1). It is the simplest interpolation method and the one engineers, scientists, and spreadsheets reach for first when a quick estimate matters more than perfect accuracy.
What is the difference between interpolation and extrapolation?
Interpolation reads a value that lies between the two known points, where the straight-line assumption is at its safest because you are bracketed by real data. Extrapolation reads a value outside that range, where the line keeps going but the real relationship may bend, plateau, or break. The calculator flags an extrapolation warning whenever your query falls outside [min, max] of the known x or y, so you can decide whether to trust the result or collect more data first.
How do I solve for x given a known y (inverse interpolation)?
Switch to find-x mode. The calculator inverts the formula to x = x1 + (y - y1) * (x2 - x1) / (y2 - y1) and returns the x value on the same line at your target y. This only works when y1 and y2 differ, because a horizontal line maps every x to the same y and the inverse is undefined. Use this mode for problems like reading the temperature at which a thermistor outputs a specific resistance, or finding the dose that produces a target response.
What happens when the two points form a vertical line?
If x1 equals x2, the points form a vertical line. Along that line, x stays fixed while y can vary, so y is not a single-valued function of x and the usual slope formula divides by zero. This calculator represents the line as y = mx + b, so it rejects vertical inputs. A parametric line model is needed to handle every orientation.
How accurate is linear interpolation?
Accuracy depends entirely on how close the real function is to a straight line over the interval. Between two nearby points on a smooth curve, the error is small and the method is excellent. Across a wider gap or near a peak, valley, or inflection, the line can miss badly. The two safest moves are to keep the bracketing points as close to the query as possible, and to never trust an extrapolation result without checking it against another method or fresh data.

Related Calculators

More calculators in "Math"

See all 202 calculators in "Math"