Linear interpolation calculator

Enter two known points (x₁, y₁) and (x₂, y₂), then either an x to get y or a y to get x. The result comes with the slope, the line equation and a note when your value lies outside the two points.

The x when finding y, or the y when finding x.
y15
Slope
5
y-intercept
5
Line
y = 5x + 5
Type
Interpolation (between the two points)

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Enter the two known points.
  2. Choose whether you know x or y.
  3. Type the known value and read the result.

How it works

The line through the points has slope m = (y₂ − y₁) / (x₂ − x₁). A value at x is y₁ + m × (x − x₁). Going the other way, x = x₁ + (y − y₁) / m, which this tool computes by swapping the roles of x and y.

Worked example

Points (1, 10) and (3, 20), x = 2: the slope is 10 / 2 = 5, so y = 10 + 5 × 1 = 15. Going backwards, y = 15 gives x = 2. The line is y = 5x + 5.

Tips

  • For table lookups, pick the two table rows that bracket your value.
  • A result marked as extrapolation deserves extra caution.

Frequently asked questions

What is the formula?

y = y₁ + (x − x₁) × (y₂ − y₁) / (x₂ − x₁). To find x from y the roles of x and y are swapped.

What is the difference between interpolation and extrapolation?

Interpolation estimates a value between the two known points, extrapolation beyond them. Extrapolation is less reliable because the true relationship may not stay straight.

When is linear interpolation accurate?

When the quantity changes roughly steadily between the two points, as in a table with close entries. For curved data, closer points give a better estimate.

Why is the line vertical error shown?

If both points have the same x, the slope would need a division by zero and y is not a function of x.

More in Math

All tools in this category: Math ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.