Find an estimated y-value between two known points and see the slope, interpolation fraction and working.
Enter two points and a target x-value
Linear interpolation formula
The formula assumes a straight-line change between the two known points. It first finds how far the target x-value lies between x₁ and x₂, then applies the same fraction of the total change from y₁ to y₂.
How to use the calculator
- Enter the first known coordinate, x₁ and y₁.
- Enter the second known coordinate, x₂ and y₂.
- Enter the target x-value and the number of decimal places.
- Select calculate to see y, the slope, position percentage and full substitution.
Worked example
For points (10, 20) and (30, 60), with x = 18, the position fraction is (18 − 10) ÷ (30 − 10) = 0.4. The change in y is 40, so the estimated value is 20 + 0.4 × 40 = 36.
| Output | Example result |
|---|---|
| Interpolated y | 36 |
| Slope | 2 |
| Position | 40% |
| Line equation | y = 2x |
Interpolation versus extrapolation
Interpolation estimates a value inside the interval between the two known x-values. If the target lies outside that interval, the calculation is extrapolation and the result is usually less reliable. NIST notes that prediction error and misinterpretation can occur with either method, even though interpolation is generally safer than extrapolation. Read the NIST guidance on interpolation and extrapolation.
When linear interpolation is appropriate
Use it when two nearby observations can reasonably be treated as following a straight-line relationship. It is common for table lookups, calibration, engineering estimates and time or rate conversions. It may be unsuitable when the relationship is curved, discontinuous, seasonal or changes sharply between the known points.
Related calculators
- Convert changes and ratios with the Percentage Calculator.
- Estimate transfer durations with the Download Time Calculator.
- Scale heating times with the Microwave Cooking Time Calculator.
- Browse more tools on the United Kingdom Calculator homepage.
Frequently asked questions
What is linear interpolation?
It estimates a value between two known points by assuming the change between them follows a straight line.
Can the target x-value be outside the two points?
Yes, but that becomes extrapolation. The calculator labels it because estimates outside the known interval carry more uncertainty.
Can I use negative or decimal numbers?
Yes. All coordinate inputs accept negative values, zero and decimals.
Why must x₁ and x₂ be different?
The formula divides by x₂ − x₁. Equal x-values would make that denominator zero, so a unique slope cannot be calculated.
Does swapping the two known points change the answer?
No. Swapping both coordinate pairs leaves the same line and produces the same interpolated value.
