What Is Linear Extrapolation?
Linear extrapolation estimates an unknown value that lies outside the range of your known data by extending the straight line defined by two points. If you know two points, \((x_1, y_1)\) and \((x_2, y_2)\), you can project the trend forward (or backward) to find y at any chosen x. This calculator does that instantly and also reports the slope of the line.
How to Use This Calculator
Enter the coordinates of your two known points — x₁, y₁ and x₂, y₂ — then type the x value you want to estimate y for. Press calculate and you'll get the extrapolated y value plus the slope of the trend line. The same tool works for interpolation (an x between the points) too, but it is most useful for projecting beyond your data.
The Formula Explained
The line through two points has slope \(m = \dfrac{y_2 - y_1}{x_2 - x_1}\). Starting from the first point, the y value at any x is:
$$y = y_1 + \left(x - x_1\right) \cdot \frac{y_2 - y_1}{x_2 - x_1}$$
The term \((x - x_1)\) is how far you move along the x-axis from the first point, and multiplying by the slope tells you how much y changes over that distance.
Worked Example
Suppose sales were 2 units in week 1 (\(x_1=1, y_1=2\)) and 6 units in week 3 (\(x_2=3, y_2=6\)). The slope is $$\frac{6 - 2}{3 - 1} = \frac{4}{2} = 2 \text{ units per week}.$$ To predict week 5 (\(x=5\)): $$y = 2 + (5 - 1)\cdot 2 = 2 + 8 = \textbf{10 units}.$$
Interpreting Your Extrapolated Result
The calculator draws a straight line through your two known points \((x_1, y_1)\) and \((x_2, y_2)\) and extends it to the x value you enter. The slope of that line, \(m = \frac{ y_2 - y_1}{x_2 - x_1}\), tells you how to read the prediction:
- Positive slope: y rises as x rises, so extrapolating to a larger x gives a larger y than your known points.
- Negative slope: y falls as x rises, so extrapolating to a larger x gives a smaller y.
- Zero slope: \(y_1 = y_2\), so y is constant and the predicted y equals that same value for every x.
Example: with points (2, 10) and (4, 18), the slope is \(\frac{18 - 10}{4 - 2} = 4\), so at x = 6 the line gives \(y = 10 + (6 - 2)\cdot 4 = 26\).
When the result can be trusted
- The relationship must really be linear. The formula assumes a constant rate of change. If the true relationship is not a straight line, the output is only a rough guide.
- Reliability drops with distance. The further x lies beyond your two known points, the more any small departure from linearity, or any measurement error in the inputs, gets magnified.
- Two points cannot reveal curvature. Any two points can be joined by a straight line, so the data itself gives no warning if the real trend is curved. Extra data points or knowledge of the underlying process are needed to check linearity.
Watch for implausible values
Projecting a line far out can produce impossible results, such as negative quantities, populations, prices or lengths, or percentages above 100%. If the answer does not make physical or practical sense, the linear assumption has probably broken down at that x.
When to use a different model
Exponential growth or decay (for example compounding or radioactive decay), logistic growth that levels off at a limit, and seasonal or cyclical data all need different models. A straight line through two points will usually mislead for these patterns, especially when extrapolating well outside the observed range.
FAQ
What's the difference between interpolation and extrapolation? Interpolation estimates within the known range; extrapolation projects outside it. The math here is identical, but extrapolation carries more uncertainty.
Why is extrapolation risky? It assumes the linear trend continues unchanged. Real-world data often curves or shifts, so values far beyond your range can be unreliable.
Can x₁ equal x₂? No — a vertical line has an undefined slope, so the two x values must differ for a valid calculation.