Linear Interpolation Calculator
Enter two known points and a target x to estimate y on the line between them. The calculator flags extrapolation when x is outside the interval.
Linear interpolation estimates a y value at a target x between two known points, assuming the change between those points is linear.
Linear interpolation from two known points
Linear interpolation estimates a y value for a target x when two known points are assumed to be connected by a straight line.
y is the estimated value, x is the target coordinate, and x1, y1, x2, y2 are the two known points.
The same line can be shown with slope and intercept, which is useful for checking the result by hand.
Slope, fraction, and line equation
k is the slope, and x1, y1, x2, y2 are the known point coordinates.
The slope shows how much y changes for one unit of x.
t is the fraction of the interval, x is the target coordinate, and x1 and x2 are the interval endpoints.
The fraction t shows where the target x sits between the two selected points.
b is the intercept, k is the slope, and x and y are coordinates on the line.
The intercept form is another way to check the line through the two points.
| t | Meaning |
|---|---|
| 0 | x equals x1 |
| 0.5 | x is halfway between x1 and x2 |
| 1 | x equals x2 |
| less than 0 | extrapolation to the left of the selected interval |
| greater than 1 | extrapolation to the right of the selected interval |
Table lookup example
Suppose a table gives 999.7 at and 998.2 at. To estimate the value at, use those two neighboring points.
y is the estimate at x = 15; x = 10 and x = 20 are the neighboring points.
The numbers are neutral examples for the method, not a reference table.
- Choose the two neighboring table rows around the target x.
- Make sure both rows use the same units.
- Enter the two points and the target x.
- Check whether the result is interpolation or extrapolation.
Interpolation and extrapolation
Interpolation stays inside the interval between the selected points. If x falls outside that interval, the calculator can still extend the line, but the result is extrapolation.
Use cases
- Table values - estimate between two adjacent rows.
- Measurements - estimate an intermediate reading between two observations.
- Engineering profiles - interpolate along a simple linear segment.
- Graphics and animation - move smoothly between two states.
- School problems - check a value on a straight line.
Method limits
- If x1 and x2 are equal, the two points form a vertical line and y as a function of x is not defined.
- The calculator does not choose rows from a larger table automatically.
- For nonlinear data, a straight-line estimate may be rough even inside the interval.
- Displayed results are rounded; use enough significant digits in the inputs.
Frequently Asked Questions
Sources and References
Calculations are based on the listed reference sources. Links open in a new tab.
Related Tools
Plot formula. Add up to 5 functions, use common math functions, and compare curves on one graph.
Calculate an arithmetic sequence from the first term and common difference, or from the first two terms. See the nth term, the sum of the first terms, and the generated sequence.
Calculate percent of a number, what percent one number is of another, reverse percentage, percentage change, and add or subtract a percentage.