Linear Interpolation Calculator
Enter two known points, (x0, y0) and (x1, y1), then a list of x values to find the matching y, or a list of y values to find x. The result table shows each answer and marks the ones that lie outside the two points as extrapolated. The line is also given as an equation with its slope and intercept. Everything runs in your browser.
| x | y |
|---|---|
| 3 | 20 |
| 7 | 40extrapolated |
| 0 | 5extrapolated |
Linear interpolation assumes that the value changes at a steady rate between two known points, so the value at x is y0 plus (x - x0) times (y1 - y0) divided by (x1 - x0). The fraction (x - x0) / (x1 - x0), shown as the way along, is 0 at the first point and 1 at the second. A value outside the two points is an extrapolation: the line is extended on the same slope, which is a guess that gets worse the further you go, and the table marks those rows. The result is exact only if the real relationship is a straight line. For a curve, pick two points that are close to the value you want. Everything runs in your browser.
Related Tools
[5 suggestions]Slope Calculator
Find the slope, equation, intercepts, distance and midpoint of the line through two points, with exact fractions.
Student ToolsLinear Regression Calculator
Fit the least squares line through your points and get the slope, intercept, correlation r, R squared, standard errors, a chart and a prediction.
Math & MoneyDistance and Midpoint Calculator: Between Two Points in 2D or 3D
Find the distance and the midpoint between two points in the plane or in space, with the exact radical form, the taxicab distance, and the other endpoint from a midpoint.
Student ToolsRatio Calculator
Simplify a ratio, list equivalent ratios, solve A : B = C : D for the missing term, and scale or split a total in a ratio.
Math & MoneyPercentage Calculator
Find a percentage of a number, what percent one number is of another, a percentage increase or decrease, or a number raised or lowered by a percentage.
Math & MoneyAbout the Linear Interpolation Calculator
Linear interpolation assumes the value changes at a steady rate between two known points, so the value at x is y0 plus (x minus x0) times (y1 minus y0) divided by (x1 minus x0). With the points (1, 10) and (5, 30), the value at x = 3 is 20, because 3 is halfway between 1 and 5. The fraction (x minus x0) divided by (x1 minus x0), shown as how far along the way you are, is 0.5 here. Asking for x = 7 gives 40, but 7 is outside the two points, so the tool marks it as extrapolated: the line is extended on the same slope, which is a guess that gets worse the further you go. The line through these points is y = 5x + 5, with a slope of 5 and an intercept of 5. To find x for a given y the same line is run backwards, so y = 25 gives x = 4. A table of temperatures is a classic use: 20 C is 68 F and 30 C is 86 F, so 25 C is 77 F. The result is exact only if the real relationship is a straight line, so for a curve pick two points that are close to the value you want. If the two x values are equal there is no single line, and if the two y values are equal no x can be found for a different y.
What is the linear interpolation formula?▾
y = y0 + (x - x0) times (y1 - y0) divided by (x1 - x0). It finds the point on the straight line through (x0, y0) and (x1, y1). For (1, 10) and (5, 30) at x = 3 the answer is 10 plus 2 times 5, which is 20.
What is the difference between interpolation and extrapolation?▾
Interpolation finds a value between the two known points, which is usually safe if the data is close to a line. Extrapolation extends the line beyond them, which is a guess that gets worse with distance. The tool marks those rows as extrapolated.
How do I find x for a given y?▾
Choose Find x for a y and type the y values. The same line is run backwards: x = x0 + (y - y0) times (x1 - x0) divided by (y1 - y0). With (1, 10) and (5, 30), y = 25 gives x = 4.
How do I interpolate in a table?▾
Pick the two table rows on either side of your value and use them as the two points. For a table with 20 C at 68 F and 30 C at 86 F, the value for 25 C is 77 F.
Is my data uploaded?▾
No. The calculation runs in your browser and nothing you enter is sent anywhere.