Linear Interpolation Calculator
Linear interpolation is a simple technique for estimating an unknown value that lies between two known data points. By assuming the relationship between the points is linear, you can calculate intermediate values with high accuracy for small intervals. This calculator takes two reference points (x1, y1) and (x2, y2), then computes the interpolated y-value at any x you specify. It also shows the slope of the line connecting the points and indicates whether you are interpolating (x between the points) or extrapolating (x outside the range), helping you understand the reliability of your estimate.
Linear interpolation formula
y = y1 + (x - x1) * (y2 - y1) / (x2 - x1)
Slope = (y2 - y1) / (x2 - x1)
Linear interpolation calculator: frequently asked questions
What is linear interpolation?
Linear interpolation estimates an unknown value that falls between two known data points by assuming the points lie on a straight line. If you know (x1, y1) and (x2, y2), you can estimate y at any x between them using the line's equation. It is widely used in data analysis, engineering, and science.
What is the linear interpolation formula?
The formula is y = y1 + (x - x1) * (y2 - y1) / (x2 - x1). This calculates the y-value at any x by finding the slope (y2 - y1) / (x2 - x1) and applying it from the first point (x1, y1) to the target x.
What is extrapolation?
Extrapolation is estimating a value outside the range of your two known points. If x is less than x1 or greater than x2, you are extrapolating rather than interpolating. Extrapolation is generally less reliable than interpolation because you are estimating beyond the data you have.
When should I use linear interpolation?
Linear interpolation is ideal when you have two close data points and want to estimate values in between. It is used in temperature tables, stock prices, survey data analysis, and computer graphics. It assumes a linear relationship between the points, which is accurate for small intervals.
What is the difference between interpolation and curve fitting?
Interpolation estimates values between known points using simple formulas like the line through two points. Curve fitting finds a single equation that best represents all your data points. Interpolation is quick and local; curve fitting is global and more complex.
Official sources
- Khan Academy: Linear interpolation.
- Wolfram MathWorld: Linear interpolation.
Reviewed by the CalculatorHub team, edited by James Graham, 14 June 2026. See our methodology.