Skip to content

Interpolation Calculator

Fill a missing y on the straight line between two known points. A point outside the span is marked as extrapolation.

Result

Enter two points and an x value

How to Use

  1. 1 Enter the first point as x0 and y0.
  2. 2 Enter the second point as x1 and y1.
  3. 3 Enter the x you want a y for.

Example Output

  • From (0, 0) to (10, 100), x = 4 gives y = 40.
  • The same line at x = 12 is extrapolation and gives y = 120.

About This Tool

This page uses linear interpolation only. It does not fit a curve through more than two points. y = y0 + (x − x0) × (y1 − y0) / (x1 − x0).

Using the Interpolation Calculator

This page fills a missing y on the straight line through two known points. You enter x0, y0, x1, y1, and the x you want a y for. The formula is y = y0 + (x − x0) × (y1 − y0) / (x1 − x0). From (0, 0) to (10, 100), x = 4 returns 40. The same line at x = 12 returns 120, and the label says extrapolated because 12 is outside the span from 0 to 10.

The two x values must be different. If they are equal, the page rejects the input instead of dividing by zero. The page does not fit a curve through more than two points. It is linear interpolation only.

What the Five Fields Are

x0 and y0 are the first known point. x1 and y1 are the second. The fifth field is the x you want a y for. None of them has to be positive. A negative coordinate is a real number and is accepted. A blank field is rejected.

The headline is the y. The label is “Interpolated y” when x lies between the two known x values, including the endpoints, and “Extrapolated y” when it does not. The lines show the slope and a short position note. The summary sentence states y at that x.

Order of the two points does not matter. Swapping (x0, y0) with (x1, y1) produces the same line and the same y. The slope changes sign in the intermediate step and the two sign changes cancel. You do not have to sort the points before you type them.

How (0, 0) and (10, 100) Give 40

The rise is 100 − 0 = 100. The run is 10 − 0 = 10. The slope is 10. From x = 0 to x = 4 is 4 units of run. 4 times the slope is 40. Add the starting y, which is 0, and the result is 40. The label is interpolated because 4 sits between 0 and 10.

At x = 12 the same slope gives 120. The arithmetic is identical. The label changes because 12 is not between 0 and 10. The page still returns the number. It does not refuse an extrapolation. It names it.

A second linear tool uses the same formula under a longer name. The Linear Interpolation Calculator also returns y on the line through two points. Use either page for this arithmetic. Do not expect a different curve from the other one. They are the same line. This page is the shorter slug for the same operation.

Endpoints and a Flat Line

At x = x0 the result is y0. At x = x1 the result is y1. Those two checks confirm the page honors the points you typed. If x = 0 does not return 0 in the worked example, the formula is not being applied to your fields.

A flat line is allowed. From (0, 5) to (10, 5), every x returns 5. The slope is 0. Inside or outside the span, the y stays 5, and the label still says whether x was inside. A flat line is not an error.

Equal x values are the error. From (4, 1) to (4, 2) the run is 0. The page rejects the pair. It will not return an infinite slope or a quiet average of the two y values.

A Temperature-Style Table

Suppose at 0 minutes a reading is 0 and at 10 minutes a reading is 100, and you need the value the straight line would have at 4 minutes. The page returns 40. The assumption is the straight line, not a measurement at minute 4. If the real process curves, 40 is only the line’s opinion.

Write the note as “line from (0, 0) to (10, 100), x = 4, interpolated y = 40.” A later reader can see both points and the label. “About 40” loses the points and the fact that you interpolated rather than measured.

Comparing two results after you have them is a different operation. The Percentage Difference Calculator expresses the gap between two positive numbers as a percent of their average. It does not draw the line. Use it only when a percent gap is the question, after both y values exist.

Reading the Slope Line

The slope is (y1 − y0) / (x1 − x0), printed so you can see the division before the final multiply. A surprising y is often a surprising slope. Check the slope against a hand division before you retype everything.

Units do not appear. If x is minutes and y is degrees, the slope is degrees per minute and the headline is degrees. The page will not print those words. Your note should. A unitless headline is a number that becomes meaningful only beside the units you recorded.

Extrapolation is labeled and still easy to misuse. A line that fit two nearby points can be nonsense far away. The label is a warning, not a confidence interval. The page does not estimate an error bar.

Mistakes that Move the Y

Swapping x and y is a different line. If you type the minutes in the y fields and the readings in the x fields, the headline is not a reading. Keep x as the known independent value and y as the value you are filling.

Rounding the slope early changes the last digits. This page divides and multiplies at its working precision and trims trailing zeros when the result is exact, which is why 40 stays 40. If you round the slope to 10.0 and the points were not so tidy, type the page’s headline rather than a shortened slope times a delta.

Plain multiplication will not choose the slope for you. The 4-Function Calculator multiplies and divides the numbers you type. You can compute (100 − 0) / (10 − 0) there and then multiply by 4. It will not label the result as interpolated. Use it to see the steps, then compare with the headline.

How Y Moves when X Moves

On a line of slope 10, each extra unit of x adds 10 to y. That is the worked example. On a line of slope 0, moving x changes nothing. On a negative slope, increasing x decreases y. The position label does not depend on the slope. It depends only on whether x is between the two known x values.

Moving one known point changes the slope and every y except the other known point. If you edit y1, re-read both the slope and the headline. The old headline is for the old point.

The page does not remember a previous pair. Each run stands alone. There is no least-squares fit hiding behind a third point you meant to include. A third point requires a different method that this form does not offer.

Choosing the Two Points

Pick the two known points that bracket the x you care about when you can. Bracketing makes the label say interpolated. Points that leave x outside still return a number, and the label tells you that you left the span.

If the table is noisy, two points are a thin basis. A list’s spread is a different summary. The Mean Absolute Deviation Calculator describes how far a list sits from its own mean. It does not interpolate. Use it when the question is scatter, not a missing y on a line.

Write down which point was measured and which y was filled. Mixing them later turns an estimate into a fake observation. The label on this page is the reminder. Copy it with the number.

What the Page Does Not Do

It does not spline, and it does not fit a polynomial. Two points determine one straight line. That is the whole model.

It does not convert units between the fields. If one point is in hours and the other is in minutes, the slope is meaningless and the page will still compute it. Convert first.

It does not decide whether a straight line was a good model. You decide that before you trust the headline outside the narrow span you actually know.

Two Points, an X, and a Labeled Y

Write both points, the x, the y, and the word interpolated or extrapolated. “Line (0, 0) to (10, 100), x = 4, interpolated y = 40” can be recomputed. “40” cannot. The slope belongs in the same note when the points are awkward, because a reviewer will check the slope before the final multiply.

If you extrapolated, say how far outside you went. x = 12 against a span of 0 to 10 is two units past the end, on a slope of 10, which is 20 past y1. That arithmetic is obvious in this example and less obvious on a messy slope. The distance past the end is worth a phrase so nobody treats 120 as a measurement taken at 12.

Keep the rejected case in the checklist. Equal x values must not produce a y. A quiet average would hide a data error, such as two readings recorded at the same time with different values. The rejection forces you to look at the table. Record that you saw the rejection at least once when you started using the page.

A Straight Line Is a Decision

The formula is short, and the decision is the assumption that the quantity moves in a straight line between the two points you trust. Nothing on the page tests that assumption. A smooth curve that passes through the same two points can be far from the line in the middle. If you know the curve, do not use the line and then cite this headline as the curve. Say “straight-line estimate.”

Checking the Line

Enter (0, 0) and (10, 100) with x = 4. Confirm y = 40 and the interpolated label. Change x to 12. Confirm y = 120 and the extrapolated label. Set both x values to 4. Confirm the page rejects them. Those three runs cover the worked point, the warning, and the zero run.

Electrical conversions are a different formula. The Amps to Watts Calculator multiplies current by voltage. It does not interpolate a table. Use it when the inputs are amps and volts, not when the inputs are two points on a line.

Frequently Asked Questions

What formula is used?

y = y0 + (x − x0) × (y1 − y0) / (x1 − x0). It is the straight line through the two points.

What do (0, 0), (10, 100), and x = 4 return?

40, labeled interpolated, because 4 lies between 0 and 10. The slope is 10.

What does x = 12 return on that line?

120, labeled extrapolated. The page still returns the number and marks that x is outside the span.

What if x0 equals x1?

The page rejects the points. The run would be zero and the slope would be undefined.

Does the order of the two points matter?

No. Swapping the points returns the same y.

Can the coordinates be negative?

Yes. Negative numbers are accepted. A blank field is not.

Is an endpoint interpolated?

Yes. x equal to x0 or x1 returns that point’s y and is labeled interpolated.

Will the page fit three points?

No. Two points define the line. A third point is not an input.

Does it draw a curve?

No. The only model is a straight line. A curve through the same points can disagree in the middle.

Why is 40 exact?

The slope is exactly 10 and the step is exactly 4, so the product is 40 and trailing zeros are trimmed.

What does copy return?

The sentence that states y at the x you entered.

Does the page know my units?

No. Convert both points to the same units before you type, and record the units beside the headline.