Skip to main content
CalcChef

Interpolation Calculator

Linear interpolation between two points: y at any x, x for a given y and the line y = mx + b, with a note when x lies outside them (extrapolation). How it works

Use the Interpolation Calculator

Y at the target X
50

Interpolation: the target X lies between X1 and X2.

P1P2Target
The two known points (P1, P2) and the line through them, solid between the points and dashed beyond them; the ring marks the target.

Line through the two points

Slope m = 10

Intercept b = 0

y = 10x

About the Interpolation Calculator

Between (0, 32) and (100, 212), the value at x = 37 is y = 98.6 by y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁). This interpolation calculator finds y at any x on the straight line through two points, finds x for a given y, writes the line as y = mx + b, plots the points, the line and the target, and says when x lies outside the two points.

Worked linear interpolations

Point 1Point 2Target xyLineTool labels it
(0, 0)(10, 100)550y = 10xInterpolation
(0, 32)(100, 212)3798.6y = 1.8x + 32Interpolation
(2020, 150)(2025, 210)2023186y = 12x − 24090Interpolation
(1, 3)(4, 9)25y = 2x + 1Interpolation
(3, 12)(7, 4)66y = -2x + 18Interpolation
(20, 0.9982)(30, 0.9957)250.99695y = -0.00025x + 1.0032Interpolation
(0, 0)(10, 100)15150y = 10xExtrapolation
(0, 0)(10, 100)10100y = 10xEndpoint

Frequently asked questions

What is the linear interpolation formula?
y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁). Between (2020, 150) and (2025, 210), at x = 2023: y = 150 + (2023 − 2020) × (210 − 150)/(2025 − 2020) = 150 + 3 × 12 = 186.
How do you interpolate to find x for a given y?
Swap the roles: x = x₁ + (y − y₁)(x₂ − x₁)/(y₂ − y₁). Type the y-value in the Target Y box. Between (0, 32) and (100, 212), y = 98.6 gives x = 37; between (0, 0) and (10, 100), y = 42 gives x = 4.2.
What is the difference between interpolation and extrapolation?
Interpolation estimates a value between the two known x-values; extrapolation goes beyond them and assumes the line carries on. Between (0, 0) and (10, 100), x = 5 gives 50 (interpolation) and x = 15 gives 150, which the tool labels extrapolation.
How do you interpolate between two rows of a table?
Take the two rows whose x-values bracket your x and enter them as the two points. If a table lists 0.9982 at 20 and 0.9957 at 30, the value at 25 is 0.99695. For a table with two inputs, interpolate along two rows and then between those two results.
Why does it say X2 must differ from X1?
Two points with the same x lie on a vertical line, which does not give one y for each x, so there is nothing to interpolate.

Related Tools

View all tools