MATH CALCULATOR

Linear Interpolation Calculator

Enter two known pairs and a target x to estimate y along the straight line joining them. Targets outside the known interval are labeled as extrapolation.

Calculator

YOUR RESULTS
Estimated y130
Slope
6
Position from first to second point
50 %
Calculation type
Interpolation

Known points and target
Known points and target
xy
10100
15130
20160

Understanding your result

The position expresses how far the target lies from the first point toward the second. A value of 50% is halfway; negative values or values above 100% are outside that interval.

The formula

y = y₁ + (x − x₁) × (y₂ − y₁) ÷ (x₂ − x₁). Slope = (y₂ − y₁) ÷ (x₂ − x₁).

First compute the target’s fraction of the horizontal interval. Apply the same fraction to the change in y, then add the first y value. Both endpoints must use compatible units, and the two x values must differ.

Worked example

Suppose a table gives y = 100 at x = 10 and y = 160 at x = 20. At x = 15, the interval fraction is 0.5, so y = 100 + 0.5 × 60 = 130. The slope is 6 y-units per x-unit.

How to use this calculator

  1. Enter the two known x and y pairs in consistent units.
  2. Enter the target x, keeping each y paired with its original x.
  3. Read the estimate and check whether it is inside or outside the known interval.

When a straight line is a reasonable approximation

Interpolation fills a gap under an explicit model; it does not reveal an unknown physical law. A narrow interval in a smooth table may be well approximated by a line, while a sharp bend or threshold may not. If the underlying table specifies logarithmic interpolation or another method, this linear calculation is not interchangeable with it.

Extrapolation deserves separate interpretation

Outside the endpoints, the same algebra extends the line indefinitely. The displayed label makes that distinction visible, but it does not measure the uncertainty. Reversing the order of the two pairs produces the same estimate. This tool handles one segment; it does not select surrounding points automatically from a larger dataset or fit a regression to noisy observations.

Assumptions & limitations

What this calculation assumes

  • The change in y is linear over the chosen x interval.

What to keep in mind

  • No uncertainty bounds, polynomial interpolation, logarithmic scale, or regression fitting.

Common questions

Can the slope be negative?

Yes. A decreasing y value produces a negative slope. The interpolation equation still applies.

Why are equal x values rejected?

They make the horizontal interval zero. Two points with the same x cannot define a single-valued line y(x) through this formula.

Sources & further reading