CalcSeed

Linear Interpolation Calculator

Enter two known (x, y) points and an x value to interpolate y.

=
Quick answer: with the default inputs (0, 0, 10, 100), the interpolated y is 50. Change any input to update the result.
Interpolated y
—

What linear interpolation does

This calculator estimates y at an x value that falls between two known points by walking the straight line that connects them. The output is the interpolated y at your target x. At the defaults, the points (0, 0) and (10, 100) with target x = 5 return y = 50, the exact midpoint of the line.

y=y1+(y2−y1)(x−x1)x2−x1y = y_1 + rac{(y_2-y_1)(x-x_1)}{x_2-x_1}

How the formula works

Three quantities drive the result. The slope (y2 − y1) ÷ (x2 − x1) says how fast y rises per unit of x: with the defaults it is 100 ÷ 10 = 10. The fraction (x − x1) ÷ (x2 − x1) is the position between the points, running from 0 at the first point to 1 at the second; at x = 5 it is 5 ÷ 10 = 0.5. Multiply that position by the total rise and add y1: 0 + 0.5 × 100 = 50.

Reading it as a weighted average is often clearer: interpolated y is (1 − t) × y1 + t × y2, where t is the fractional position. At t = 0.3 you get 30% of the second point and 70% of the first. This is the same arithmetic a graphics engine runs millions of times per frame to blend colors, and the same arithmetic a lookup table runs when a query lands between two stored rows.

Worked example with the default inputs

Points (0, 0) and (10, 100), target x = 5. Step one, the slope: (100 − 0) ÷ (10 − 0) = 10. Step two, the offset from the first point: 5 − 0 = 5. Step three, the rise over that offset: 10 × 5 = 50. Step four, add the first y: 0 + 50 = 50. Because x = 5 sits exactly halfway, the weighted-average view confirms it: 0.5 × 0 + 0.5 × 100 = 50.

Other targets on the same pair: x = 2 gives y = 20, x = 7 gives y = 70, and x = 5.5 gives y = 55. Every answer stays between 0 and 100 because the target stays between 0 and 10 — that containment is the defining property of interpolation.

Interpolated values from the same two points

Target xFraction between the pointsInterpolated y
10.110
2.50.2525
50.550
7.50.7575

The fraction column is the multiplier applied to the full rise of 100. This is why interpolation errors stay bounded: even if the true curve bends between the points, the worst-case error is capped by the deviation from the chord, unlike extrapolation where error grows without limit as you move out.

Where interpolation bites in practice

  • Steam tables, thermodynamic charts and material property tables: engineers interpolate between printed rows, and a 1-unit x error near a steep region can move y by more than 10 units when the slope is high.
  • Tax brackets and fee schedules: a rate that jumps at fixed thresholds is effectively piecewise linear between them.
  • Game and graphics engines: blending positions, colors and lighting between keyframes is linear interpolation at scale.
  • Missing time-series points: filling a sensor gap of one interval with a straight line is usually defensible; filling a gap of ten intervals with one line usually is not.

How accurate is a straight line between two points

The error depends entirely on curvature. For y = x² between (0, 0) and (10, 100), the chord at x = 5 predicts 50 while the true value is 25, a 100% overestimate at the midpoint. Halving the interval to (0, 0) and (5, 25) cuts the midpoint error to 6.25 against a true 12.5. Dense anchor points, not a better formula, are what make interpolation accurate.

Common mistakes

  • Swapping the point coordinates: entering (0, 10) and (100, 0) instead of (0, 0) and (10, 100) produces a slope of −0.1 and a wildly different answer. Verify that each y belongs to its x.
  • Extrapolating by accident: a target x outside x1–x2 still returns a number, but it is an extrapolation with unbounded error. The extrapolation calculator treats that case explicitly.
  • Dividing by a zero span: if x1 = x2 the slope is undefined and the calculator returns 0, so a 0 output can indicate degenerate inputs rather than a real result.
  • Interpolating across a known kink: if the process has a breakpoint between the two points, such as a price change or a phase transition, the straight line crosses territory the process never visits.
  • Unit mismatch: interpolating a temperature table in °C with a target typed in °F produces a plausible-looking but wrong number. Convert first.

Linear versus other interpolation methods

Choosing between linear, spline and polynomial

Linear interpolation is the fastest and most common choice, but it is not the only one. Polynomial interpolation passes through all points with curves but can oscillate at the edges, and spline interpolation joins points with smooth piecewise polynomials to avoid visible kinks. Between just two points, linear is the only degree-1 polynomial available and is the honest default when you know nothing about curvature. The working rule: if you have three or more points and the output must look smooth, reach for a spline; for a single missing table entry, linear is standard.

Frequently asked questions

What is the interpolated value of the default inputs?

With points (0, 0) and (10, 100) at x = 5, the slope is 10 and y = 0 + 10 × (5 − 0) = 50. The midpoint of the line always gives the average of the two y values.

What is the difference between interpolation and extrapolation?

Interpolation evaluates inside the known range, where both points anchor the estimate and the error is bounded by the curve’s deviation from the chord. Extrapolation evaluates outside the range and its error grows with distance; the same formula powers both, but only interpolation is contained.

Does linear interpolation assume a straight line?

Yes. Between the two points it assumes a constant rate of change. For y = x² on 0–10 the chord predicts 50 at the midpoint against a true 25, so curvature is what limits accuracy.

How do I improve the accuracy of an interpolation?

Add anchor points closer to the target. Halving the interval between known points roughly quarters the maximum error for smooth curves, which is why dense lookup tables beat clever formulas.

Where is this used?

Engineering tables, tax and fee schedules, graphics engines and sensor data repair all rely on it. A graphics pipeline runs the same arithmetic per pixel for color blending, just at frame rates.

What happens if x1 equals x2?

The denominator (x2 − x1) is zero and no unique line exists, so the calculator returns 0. Treat a 0 output with identical x inputs as an input error.

Can I interpolate in reverse, from y to x?

Yes, by swapping roles: x = x1 + (x2 − x1) × (y − y1) ÷ (y2 − y1). For the defaults, y = 50 maps back to x = 0 + 10 × (50 − 0) ÷ 100 = 5.

Is a weighted average the same thing?

Algebraically yes: y = (1 − t) × y1 + t × y2 with t = (x − x1) ÷ (x2 − x1). At x = 2.5, t = 0.25, so y = 0.75 × 0 + 0.25 × 100 = 25, matching the direct formula.

Method and sources

Calculation basis

Results follow exact mathematical definitions; the arithmetic is deterministic and can be verified by hand from the steps shown.

Last updated: November 18, 2026
Formula & data sources
  • Standard linear interpolation formula y = y1 + (y2-y1)(x-x1)/(x2-x1).

Cite this page

Reference formats
APA 7CalcSeed. (2026, November 18). Linear Interpolation Calculator. https://calcseed.com/c/math/linear-interpolation-calculator/
MLA 9"Linear Interpolation Calculator." CalcSeed, 18 Nov. 2026, calcseed.com/c/math/linear-interpolation-calculator/.
ChicagoCalcSeed. "Linear Interpolation Calculator." Last modified November 18, 2026. https://calcseed.com/c/math/linear-interpolation-calculator/

Related calculators

More Math calculators