Linear Interpolation Calculator

Enter two known points, or a table of x and y values, and the x where you need y. You get y, the slope of the piece used, every step, and a warning when x lies outside the data.

Free Runs in your browser Checked Tuesday, November 10, 2026

Data

Two known points, or a table of several points.

The horizontal value of the first known point.

The value at the first known point.

The horizontal value of the second known point. It must differ from the first.

The value at the second known point.

The point between or beyond the known points at which the value is wanted.

Result

Interpolated value y — The value at x. It is exact when it has a decimal or fraction form; otherwise a fraction with an approximation.
Inside the data? — Green when x lies between the smallest and largest x of the data.

Graph of the line

Straight pieces of the table

How it is worked out

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Choose Data: two known points, or a table of points.
  2. Type the x and y of each point into the fields for x of the first point and the following ones, or one point per line into Table of points (x and y on each line).
  3. Type the x value you need into x, where you need y.
  4. Read Interpolated value y and Inside the data?. For a table, Straight pieces of the table shows which piece was used.

How linear interpolation works

Interpolation estimates a value between known values by assuming a straight line between neighbouring points. The slope of the line between (x1, y1) and (x2, y2) is the change in y divided by the change in x, and the y value at any x follows from one of the points and that slope.

m = (y2 − y1) ÷ (x2 − x1)
y = y1 + m × (x − x1)
  • For a table, x is placed in the piece between two neighbouring points, and the straight line of that piece is used.
  • At a point of the table the value is that point's own y value.
  • The numbers are exact: a decimal is read as written, so 0.1 is one tenth, and the answer is exact when the inputs are.

Extrapolation and what it does not cover

When x lies outside the data, the nearest piece is extended. This is extrapolation: a straight-line guess that the page flags. Real curves often bend, so an extrapolated value can be far from the true one.

  • A straight line between points does not model a curve. For a curve, use more points and a method such as cubic spline interpolation.
  • Two points with the same x have no single y value, so they are refused.
  • The calculator uses only straight pieces; it does not fit a curve through the points.

Worked example: y at x = 3 between (2, 4) and (5, 7)

The slope is m = (7 − 4) ÷ (5 − 2) = 1, and the value at x = 3 is y = 4 + 1 × (3 − 2) = 5.

With the table (0, 0), (2, 4), (5, 7), (8, 6), x = 3 lies in the piece from (2, 4) to (5, 7), so the answer is also 5. At x = 6 the piece from (5, 7) to (8, 6) has slope −1/3 and gives 20/3, about 6.6667. At x = 10 the last piece is extended and gives 16/3, which is flagged as extrapolated.

Case Result
Two points, x = 3 y = 5
Table, x = 6 y = 20/3 ≈ 6.6667
Table, x = 10 (extrapolated) y = 16/3 ≈ 5.3333

Frequently asked questions

What is linear interpolation?

It is a way to estimate a value between two known values by drawing a straight line between them. The estimate is the height of that line at the x you need.

What does extrapolated mean on this page?

It means x lies outside the range of your data, so the line of the nearest piece was extended beyond its points. The estimate is less reliable than one inside the data, so the page flags it.

How do I enter decimal numbers?

Use the decimal mark of your language: a dot in English (0.5) and a comma in Turkish (0,5). Decimals are read exactly, so 0.1 is taken as one tenth.

Why can I not use two points with the same x?

Each x value needs one y value in a function. Two points at the same x with different y values make the line vertical, and then no single y exists at that x.

Is the calculation done on a server?

No. The values are calculated in your browser, and nothing you type is sent to us.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.