Linear Interpolation Calculator
Solution
Show Your Work
Interpolation Plot
Two known points (red) connected by a straight line; the green point marks the interpolated value at x.
Two known points (red) connected by a straight line; the green point marks the interpolated value at x.
Linear interpolation estimates an unknown value between two known data points by assuming the data changes at a constant rate between them. You enter the two known points (x1, y1) and (x2, y2), then provide the interior x-value where you want the estimated result y.
A steam table shows temperature 20°C at depth 10 m and 28°C at depth 30 m. Estimate the temperature at 18 m.
Linear interpolation treats the segment between two known points as a straight line. The estimate is proportional to how far x lies between x1 and x2, so the result is most reliable when the underlying data changes smoothly and almost linearly over that interval.
Use the formula y = y₁ + (x − x₁)(y₂ − y₁) / (x₂ − x₁). You need two known points (x₁, y₁) and (x₂, y₂), then plug in your target x value. The result y is the estimated value at that point assuming a straight line between the two knowns.
The linear interpolation formula is y = y₁ + (x − x₁)(y₂ − y₁) / (x₂ − x₁). It calculates the y-value at any x between two known data points (x₁, y₁) and (x₂, y₂) by assuming the values change at a constant rate along a straight line connecting them.
Interpolation estimates a value between known data points. Extrapolation estimates beyond the known range and is generally less reliable because it assumes the same trend continues outside the measured data. Linear interpolation is safest when the target value lies inside the known range.
Yes — lerp is just a common shorthand used in computer graphics and game programming for linear interpolation. Both compute the same value on a straight line between two points. Programmers often write lerp(a, b, t) = a + t × (b − a), where t is the normalized position from 0 to 1 between the two endpoints.
The same formula works when x is outside the range [x₁, x₂], but you are extrapolating rather than interpolating. This is mathematically valid but less reliable because it assumes the linear trend continues unchanged beyond the data you measured. Use with caution and cross-check with additional data when possible.
Linear interpolation is exact when the underlying relationship is truly linear, and very accurate for data that changes at a nearly constant rate over small intervals. It becomes less accurate for strongly curved or exponential data, especially over wide intervals. For nonlinear data, polynomial, spline, or cubic interpolation methods give better results.
It provides only an approximation. Linear interpolation works best when the data changes at a nearly constant rate over the interval. For strongly curved data — exponential, logarithmic, or oscillating — polynomial, spline, or cubic methods give noticeably better results, especially when data points are widely spaced.
The linear interpolation formula estimates the value of y at any point x between two known data points (x₁, y₁) and (x₂, y₂):
Where:
The formula assumes the value changes at a constant rate between the two known points. It works for any x value, but is most accurate when x lies between x₁ and x₂ and the data is approximately linear over that range.
Engineering
The thermal expansion coefficient of aluminum is 23.1 × 10⁻⁶/°C at 25°C and 24.9 × 10⁻⁶/°C at 100°C. Estimate the coefficient at 60°C for a heat-exchanger design calculation.
Thermal expansion varies nearly linearly with temperature over this range, so linear interpolation gives a reliable estimate to three significant figures.
Finance
A bank's yield curve shows a 3-year Treasury yield of 4.25% and a 5-year Treasury yield of 4.80%. What is the estimated 4-year yield for use in a bond valuation model?
Yield curves are usually smooth and nearly linear between adjacent tenors, making linear interpolation a standard technique in fixed-income analysis for missing tenors.
Data Science
A daily sensor reading shows 15.2°C on Monday and 17.4°C on Wednesday, but Tuesday is missing due to sensor downtime. Estimate the Tuesday reading using linear interpolation between the two known days.
Linear interpolation is a common imputation technique in data cleaning when gaps are short and the underlying variable changes smoothly. For longer gaps or strongly nonlinear data, spline interpolation or a model-based approach gives better results.