Extrapolation Calculator
Enter two known (x, y) points and an x value outside that range.
What linear extrapolation does
This calculator takes two known (x, y) points, draws the straight line through them, and evaluates that line at an x value you choose outside the known range. The output is the extrapolated y, a single number that estimates what the trend would produce beyond your data. At the default inputs, the line through (0, 0) and (10, 100) evaluated at x = 15 returns y = 150.
How the formula works
The formula is the two-point line equation. The fraction (y2 − y1) ÷ (x2 − x1) is the slope: how much y changes per unit of x. With the defaults, the slope is (100 − 0) ÷ (10 − 0) = 10, so every step in x adds 10 to y. The term (x − x1) counts how many of those steps separate your target x from the first point.
Because the same slope is applied outside the data range, extrapolation is mechanically identical to interpolation. The only difference is where you evaluate: an x between x1 and x2 is interpolation and stays anchored by data on both sides, while an x outside that interval trusts a trend with no data beyond it. That is why the same formula can be safe one step past the data and reckless ten steps past it.
The formula works in both directions. A target x smaller than x1 produces a backward extrapolation, which is just as valid arithmetically. If x = −5 with the defaults, y = 0 + 10 × (−5 − 0) = −50.
Worked example with the default inputs
Start with the two points (0, 0) and (10, 100) and the target x = 15. First compute the slope: (100 − 0) ÷ (10 − 0) = 100 ÷ 10 = 10 units of y per unit of x. Next compute the horizontal distance from the first point: 15 − 0 = 15. Multiply: 10 × 15 = 150. Add the first y value: y = 0 + 150 = 150.
The same arithmetic shows how quickly values grow as you move out. At x = 12 the line gives y = 120, one step past the data. At x = 20 it gives y = 200, ten steps past the last point. Every extra unit of x adds exactly 10 to the prediction, whether or not the real process still grows at that rate.
Extrapolations from the same two points
| Target x | Steps beyond the data | Extrapolated y |
|---|---|---|
| 11 | 1 past x2 | 110 |
| 15 | 5 past x2 | 150 |
| 20 | 10 past x2 | 200 |
| −5 | 5 before x1 | −50 |
The table makes the trade-off visible: each additional step multiplies your exposure to the trend not actually holding. A one-step projection (110 at x = 11) is usually defensible; a ten-step projection (200 at x = 20) assumes the slope survives unchanged for a full doubling of the observed range.
What moves the result
- The slope (y2 − y1) ÷ (x2 − x1): every unit of distance beyond the data multiplies this, so a slope error grows with reach. A slope of 10 versus 12 changes the x = 15 prediction from 150 to 180, a 20% swing.
- The distance |x − x2|: doubling the reach doubles the accumulated slope error.
- The quality of the two anchor points: with only two points, any measurement error in either one tilts the entire line with no averaging to absorb it.
- The direction: forward and backward extrapolation carry the same risk; extrapolating before the first data point (x = −5 giving −50 here) is neither safer nor less safe than extrapolating after the last.
How far can you safely extrapolate
A common working rule is to stay within about 10–20% of the observed range. With data spanning x = 0 to 10, projections up to roughly x = 12 stay close enough that curvature in the real process has little room to matter. Beyond about x = 15 you are trusting the slope across half again the observed span, and beyond x = 20 the prediction is dominated by assumptions rather than data.
Common mistakes
- Reversing the points: entering (10, 100) as (x1, y1) and (0, 0) as (x2, y2) gives the same line here, but with sloppy data entry the mix-up produces a negative slope and a wildly wrong prediction. Always check that y increases in the same direction as x.
- Extrapolating a curved process with a line: fuel use, compound growth and depreciation all curve, so a linear projection that looks reasonable at one step out is badly wrong at five.
- Using units inconsistently: if x is in months and you type a target in years, the answer is off by a factor of 12. Convert before entering.
- Forgetting the returned y = 0 when x1 = x2: identical x values make the slope undefined, and the calculator reports 0 rather than an error, so a 0 output can mean a vertical-line input problem rather than a genuine result.
Spotting the inputs that break the line
Before trusting an output, check two things. First, (x2 − x1) must not be zero; equal x values mean there is no line at all. Second, sanity-check the slope against what you know: a calibration curve that gains 10 units per step is plausible, one that gains 10,000 per step usually signals a typo in a decimal place.
Extrapolation versus interpolation
Use the same formula for both, but treat the outputs differently. Interpolated values sit between measurements and inherit error bounds from both neighbors; extrapolated values inherit error from one side only and add trend risk on top. If you need a value at x = 15 but your data stops at x = 10, the honest move is to say the estimate is linear-based, or to collect one more point past x = 10 and re-run the calculation. The linear interpolation calculator handles the between-points case with the same inputs.
When a linear model breaks down
Three situations make any linear extrapolation unreliable. Processes with a ceiling or floor, such as market saturation, flatten out, so the line keeps climbing past the point where reality stops. Processes with compounding, such as interest or viral growth, curve upward, so the line understates them increasingly fast: 5% growth over 10 periods is 63% total, not 50%. And processes with a regime change, such as a price drop or a policy shift, invalidate the old slope entirely. In each case, extrapolate at most one short step, or fit a curve to more than two points before projecting.
Frequently asked questions
How is extrapolation different from interpolation?
Both use the same line through two points, but interpolation evaluates inside the known range (x between 0 and 10 here) while extrapolation evaluates outside it (x = 15). Extrapolated values are less reliable because no measured data anchors them on the far side.
What does the default example produce?
With points (0, 0) and (10, 100) and target x = 15, the slope is 10 and the result is y = 0 + 10 × (15 − 0) = 150. Each extra unit of x adds another 10.
Should I trust extrapolated values?
Treat them as estimates that degrade with distance. A projection 1–2 steps past the data (x = 11 or 12 here) is usually reasonable; 10 steps out (x = 20, y = 200) assumes the slope holds across a span you never measured.
What if x1 equals x2?
The slope (y2 − y1) ÷ (x2 − x1) divides by zero, so no line exists. The calculator returns y = 0 rather than an error, so a 0 result with a vertical pair of inputs signals a broken input, not a real answer.
Can I extrapolate backwards, below the first point?
Yes. The formula handles x smaller than x1: at x = −5 with the defaults, y = 10 × (−5 − 0) = −50. The risk profile is identical to forward extrapolation.
How many points do I need for a reliable projection?
Two points define a line but cannot reveal curvature. With three or more points you can check whether the slope is changing: if the slope between points 1 and 2 differs from the slope between points 2 and 3, a linear extrapolation will mislead you.
Why does my extrapolated value look unreasonable?
Usually the slope is inflated by a data problem. A 10% data error in y2 at (10, 100) shifts the slope from 10 to 11 and moves the x = 15 prediction from 150 to 165, so small input slips compound with distance.
Is linear extrapolation ever exact?
Only when the underlying process truly is linear, such as a fixed-rate conversion or a calibrated sensor with proven linearity. For growth, decay and saturation processes, the linear estimate is an approximation whose error grows roughly in proportion to how far you extrapolate.
Method and sources
- Linear extrapolation via the two-point line equation.