Linear Extrapolation Calculator

Linear Extrapolation Calculator

Popular AI Skill PRO

Enter Calculation

Formula

y=y1+(x−x1)·y2−y1x2−x1y = {{\text{y}_1}} + \left(\text{x} - {{\text{x}_1}}\right) \cdot \frac{{{\text{y}_2}} - {{\text{y}_1}}}{{{\text{x}_2}} - {{\text{x}_1}}}

Example

y=2+(5−1)·6−23−1=10y = 2 + \left(5 - 1\right) \cdot \frac{6 - 2}{3 - 1} = 10
Usage stats

Advertisement

Results

Extrapolated Value (y)
10
at x = 5
Slope (y2−y1)/(x2−x1) 2

Report an error on this page

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.

Line through two known points extended beyond the data range to predict a new y value
Linear extrapolation extends the line through two known points to predict y beyond the known range.

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.

Advertisement
Right triangle on a line showing horizontal run and vertical rise between two points
The slope \((y_2-y_1)/(x_2-x_1)\) is the rise over run between the two known points.

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}.$$

Advertisement

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.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators