Linear Extrapolation: Formula, Examples and When It Breaks

Linear extrapolation estimates a value outside the range of your known data by extending the straight line through two known points. The formula is the same as for linear interpolation:

To run the numbers on your own data, use the extrapolation calculator, with a straight line or a best-fit line.

y = y1 + (x − x1) × (y2 − y1) / (x2 − x1)

The only difference is that x lies beyond x2 (or before x1) instead of between them. The maths is easy. The hard part is deciding whether the straight line still holds out there.

You can run the formula in our linear interpolation and extrapolation calculator: enter two known points and an x outside their range.

How the formula works

The two known points (x1, y1) and (x2, y2) define a line with slope

m = (y2 − y1) / (x2 − x1)

Extrapolation walks along that slope from a known point:

y = y1 + m × (x − x1)

If x is greater than x2, you are extrapolating forward. If x is less than x1, you are extrapolating backward. Within the range, the same line gives ordinary linear interpolation.

Worked example 1: projecting monthly revenue

A small online store had revenue of $52,000 in month 3 and $61,000 in month 6. What does a straight-line projection give for month 8?

  • Slope: m = (61 − 52) / (6 − 3) = 9 / 3 = 3 thousand dollars per month
  • Month 8: y = 52 + 3 × (8 − 3) = 52 + 15 = $67,000

Carry the same line to month 12 and you get 52 + 3 × 9 = $79,000. The further you go from month 6, the more you are betting that nothing changes: no seasonality, no price change, no new competitor.

Check it with the calculator On the calculator, enter X1 = 3, Y1 = 52, X2 = 6, Y2 = 61, X3 = 8 and leave Y3 empty. It returns 67.00, with slope m = 3.00 and intercept b = 43.00. Change X3 to 12 to see 79.00.

Worked example 2: extrapolating backward

A spring stretches to 12.4 cm under a 2 N load and to 15.1 cm under a 5 N load. What is its unloaded length?

  • Slope: m = (15.1 − 12.4) / (5 − 2) = 2.7 / 3 = 0.9 cm per newton
  • At 0 N: y = 12.4 + 0.9 × (0 − 2) = 12.4 − 1.8 = 10.6 cm

This is a reasonable extrapolation. Hooke’s law says a spring’s extension is proportional to the load within its elastic range, so a straight line is the right model, and 0 N is close to the measured range.

Worked example 3: when extrapolation breaks

A child is 86 cm tall at age 2 and 102 cm tall at age 4.

  • Slope: (102 − 86) / (4 − 2) = 8 cm per year
  • Age 5: 86 + 8 × 3 = 110 cm, which is plausible
  • Age 30: 86 + 8 × 28 = 310 cm, which is absurd

The formula did nothing wrong. Growth slows and then stops, so the line that fits ages 2 to 4 says nothing about adulthood. This is the core risk of extrapolation: the data cannot tell you when the pattern changes, because you have no data there.

Use more than two points when you can

Two points give a line that passes through both of them exactly, including any noise in either one. With more data, fit a least-squares trend line and extrapolate that instead.

Six months of revenue (thousand $):

Month 1 2 3 4 5 6
Revenue 48.2 49.9 52.0 54.6 56.1 61.0
  • Least-squares line: revenue = 45.113 + 2.434 × month
  • Month 8 from the trend line: 45.113 + 2.434 × 8 ≈ 64.59
  • Month 8 from only the last two points (56.1 and 61.0): 70.8

The last month jumped, and the two-point line treats that jump as the new normal. The trend line smooths it out. Neither is guaranteed to be right, but the trend line is less sensitive to one unusual month. The NIST Engineering Statistics Handbook covers least-squares fitting in detail. In Excel, the TREND and FORECAST.LINEAR functions do the same job, as shown in our guide to linear interpolation in Excel.

Interpolation vs extrapolation

Interpolation Extrapolation
Where x is Between known points Outside known points
Formula Same straight-line formula Same straight-line formula
Error Usually small if data is smooth Grows with distance from the data
Main risk Curvature between points The pattern changing beyond the data

For a fuller side-by-side comparison with more examples, see interpolation vs extrapolation.

The error of interpolation is bounded by how much the data curves between the two points. Extrapolation has no such bound, because the curve can do anything past the last measurement.

When linear extrapolation is reasonable

  • The underlying law is linear. Springs in their elastic range, distance at constant speed, cost at a fixed unit price.
  • You stay close to the data. One step beyond the last point is much safer than ten.
  • The data has no visible curvature. Plot it first. If the points bend, a straight line will under- or overshoot.
  • You treat the result as an estimate. Report it with the assumption behind it, for example “if growth stays at 3k per month”.

How to extrapolate, step by step

  1. Plot the data. Check that the points look like a straight line and note any bend near the end.
  2. Pick the points. For a clean linear relationship, use the two points closest to the target. For noisy data, fit a trend line to all of them.
  3. Compute the slope m = (y2 − y1) / (x2 − x1) and keep its units, for example “thousand dollars per month”.
  4. Apply y = y1 + m(x − x1) with your target x.
  5. Sanity-check the answer against physical or business limits. A negative price, a height of 3 metres or a share above 100 percent means the line has gone past where it is valid.
  6. State the assumption with the number, so whoever uses it knows what it depends on.

When to avoid it

  • Growth that speeds up or levels off (population, adoption, biology).
  • Seasonal data (retail, energy use, travel).
  • Physical limits (a tank cannot fill past 100 percent, a percentage cannot exceed 100).
  • Long horizons from short histories.

For curved data, a polynomial or cubic spline fits the known range better, but those methods extrapolate even worse than a straight line, because their curvature keeps going. Outside the data, a simple, defensible model usually beats a flexible one.

FAQ

What is the formula for linear extrapolation? y = y1 + (x − x1)(y2 − y1)/(x2 − x1), using two known points and a target x outside their range.

Is extrapolation the same as forecasting? Linear extrapolation is the simplest forecasting method. Real forecasts usually add seasonality, uncertainty ranges or a model of what drives the numbers.

Can I extrapolate backward? Yes. Use an x smaller than both known x values. Example 2 above finds a spring’s unloaded length this way.

Why is extrapolation less reliable than interpolation? Between known points, the data limits how far off the estimate can be. Beyond them, nothing limits it. See Wolfram MathWorld’s note on extrapolation for the formal definition.

Does the calculator work for extrapolation? Yes. The interpolation calculator accepts any X3, inside or outside the range of X1 and X2.

Soren Vance
Soren Vance

Soren Vance is the Director of Quantitative Analysis & Algorithms at Interpolation Calculator, where he leads the design and optimization of the company’s core interpolation engines and data processing frameworks.

With a master’s in Computational Mathematics and over 8 years of experience in analytical modeling and numerical computing, Soren oversees the development of high‑performance methods — from spline interpolation and polynomial regressions to multidimensional estimators for real‑world datasets.

Known for his clarity of thought, Soren builds systems that balance mathematical rigor with computational efficiency. He collaborates closely with product, engineering, and UX teams to ensure users get reliable, transparent, and fast results. Outside of work, he contributes to open‑source math libraries and teaches data science workshops at local universities.

Articles: 21

Interpolation Calculator is a mathematical method used to estimate an unknown value between known data points.

Privacy

Disclaimer

Terms

GDPR

Affiliate

Refund

Company

About Us

Contact Us