Navigation
Calculators Pricing Blog About Contact
Get Started
Get Started Login
📈

Interpolation Calculator

Perform linear interpolation between two data points to estimate unknown values.

Known Point 1
Known Point 2
The x value to interpolate at

What Is Linear Interpolation?

Linear interpolation is a mathematical method for estimating an unknown value that falls between two known data points. Given two points (x₁, y₁) and (x₂, y₂), linear interpolation assumes a straight-line relationship between them and calculates the y-value corresponding to any x-value within that range. The technique is one of the simplest and most widely used forms of interpolation, appearing in fields ranging from engineering and physics to computer graphics and financial modeling.

The word "interpolation" comes from the Latin "interpolare," meaning to alter or refurbish. In mathematics, it refers to constructing new data points within the range of known data points. Linear interpolation specifically assumes the function between the two known points is a straight line, which makes it fast and easy to compute but may introduce error when the underlying relationship is actually curved.

The Linear Interpolation Formula

The standard linear interpolation formula is: y = y₁ + t × (y₂ − y₁), where t = (x − x₁) / (x₂ − x₁). The parameter t represents how far along the interval from x₁ to x₂ the target x value falls. When t = 0, the result is y₁; when t = 1, the result is y₂; and when t is between 0 and 1, the result is proportionally between y₁ and y₂.

An equivalent formulation is: y = y₁ × (x₂ − x) / (x₂ − x₁) + y₂ × (x − x₁) / (x₂ − x₁). This form makes it clearer that the result is a weighted average of y₁ and y₂, where the weights depend on how close x is to each endpoint. The closer x is to x₁, the more weight y₁ receives, and vice versa.

How to Use This Calculator

Enter the coordinates of two known data points (x₁, y₁) and (x₂, y₂), then enter the target x value at which you want to estimate y. The calculator instantly computes the interpolated value, shows the step-by-step solution, and displays the slope of the line and the interpolation fraction t.

The fraction t indicates the relative position of your target x between x₁ and x₂. A value of t = 0.5 means x is exactly at the midpoint. Values of t less than 0 or greater than 1 indicate extrapolation (estimating outside the known range), which is generally less reliable than interpolation.

Applications of Linear Interpolation

Engineering tables: Engineers frequently look up values in reference tables (steam tables, material properties, etc.) and need values between listed entries. Linear interpolation provides quick estimates without needing to recalculate from first principles.

Computer graphics: Linear interpolation (often called "lerp" in programming) is fundamental to animation, color blending, texture mapping, and smooth transitions. When a game needs to move an object from point A to point B, lerp calculates all intermediate positions.

Financial analysis: Interpolation is used to estimate bond yields, interest rates, and financial values between known data points on yield curves and pricing tables. The technique helps fill gaps in market data.

Sensor data: When sensors sample data at fixed intervals, interpolation estimates values between sampling points. This is common in weather monitoring, industrial process control, and scientific instrumentation.

Limitations and Alternatives

Linear interpolation assumes a straight-line relationship between data points, which can introduce significant error when the underlying function is highly curved. For more accurate results with curved data, consider polynomial interpolation (using multiple points to fit a polynomial), spline interpolation (using piecewise polynomials that connect smoothly), or cubic interpolation (fitting a cubic polynomial through nearby points).

Extrapolation — using the formula with t values outside [0, 1] — is inherently risky because it assumes the linear trend continues beyond the known data. In reality, the underlying function may change behavior outside the observed range. Always extrapolate with caution and verify results against additional data when possible.

Worked Examples

Example 1: A temperature reading at 2:00 PM was 68°F and at 4:00 PM was 74°F. Estimate the temperature at 3:00 PM. Here x₁=2, y₁=68, x₂=4, y₂=74, x=3. t = (3-2)/(4-2) = 0.5. y = 68 + 0.5 × (74-68) = 68 + 3 = 71°F.

Example 2: A material has tensile strength of 500 MPa at 200°C and 420 MPa at 300°C. Estimate strength at 250°C. t = (250-200)/(300-200) = 0.5. y = 500 + 0.5 × (420-500) = 500 - 40 = 460 MPa.

Frequently Asked Questions

Interpolation estimates values within the range of known data points (between x₁ and x₂). Extrapolation estimates values outside that range. Interpolation is generally more reliable because it stays within observed data, while extrapolation assumes trends continue unchanged.
Linear interpolation is most accurate when the underlying relationship is approximately linear between the two known points, and when the points are close together. For highly curved functions or widely spaced points, polynomial or spline interpolation may give better results.
The parameter t = (x − x₁)/(x₂ − x₁) represents how far along the interval from x₁ to x₂ your target x falls. t = 0 means you are at x₁, t = 1 means you are at x₂, and t = 0.5 means you are exactly at the midpoint between them.
Lerp (linear interpolation) is a common function in game development and computer graphics: lerp(a, b, t) = a + t × (b − a). It smoothly transitions between values a and b as t goes from 0 to 1, used for animations, color blending, and smooth movement.
Yes, with more than two points you can use polynomial interpolation (Lagrange or Newton methods) or spline interpolation. These methods fit curves through multiple points for greater accuracy. Linear interpolation uses only the two nearest bracketing points.
Yes, linear interpolation is essentially proportional reasoning applied to coordinate geometry. If you know two data points and assume a linear relationship, the interpolated value is proportional to the distance from each endpoint — exactly what the formula calculates.

Embed this Calculator

Copy the code below and paste it into your website's HTML. Your visitors can use this calculator for free.

px × px
<iframe src="https://calculatorteam.com/embed/interpolation-calculator" width="100%" height="600" style="border:none;border-radius:12px;" loading="lazy" title="Interpolation Calculator"></iframe>

Report an Issue

Let us know what's wrong with this calculator. We'll review and fix it as soon as possible.