Estimate a value between two known points by assuming a straight line between them. Enter two points or paste a whole table of x, y values, then get the interpolated (or extrapolated) result with the formula worked out and a plot of the data.
Last updated:
Data
Find
Separate x and y with a comma, space or tab. You can paste two columns from a spreadsheet. Rows are sorted by x automatically.
Enter your values to see the result.
Advertisement
Advertisement
How to use the Linear Interpolation Calculator
Choose your data: two points, or a data table with one x, y pair per line.
Choose what to find: y for a given x, or x for a given y.
Enter the known points (x₁, y₁) and (x₂, y₂), or paste the table.
Enter the x (or y) value you want to look up.
Read the result, check the working and the plot, and copy the results if needed.
How linear interpolation works
Linear interpolation assumes the values change at a constant rate between two known points. The fraction of the way your x lies between x₁ and x₂ is t = (x − x₁) ÷ (x₂ − x₁), and the answer is the same fraction of the way from y₁ to y₂: y = y₁ + t × (y₂ − y₁). When t is between 0 and 1 you are interpolating; below 0 or above 1 you are extrapolating.
Situation
Known points
Look up
Result
Water density table (g/cm³)
(20 °C, 0.998), (30 °C, 0.996)
25 °C
0.997
Celsius to Fahrenheit table
(20, 68), (30, 86)
27
80.6 (exact, the relationship is linear)
Sensor calibration
(100 units, 4.2 mA), (200 units, 7.8 mA)
150 units
6.0 mA
Trend extrapolation
(2020, 150), (2024, 190)
2027
220 (extrapolated)
Inverse lookup
(2, 10), (6, 30)
y = 22
x = 4.4
Tips for accurate results
Always use the two table rows that bracket your value most tightly; skipping rows adds error when the data is curved.
Keep units consistent: interpolate in the same units the table uses, then convert the answer.
For data that grows exponentially (populations, compound interest, decibels), interpolating the logarithm of y is often more accurate than interpolating y itself.
Treat extrapolated values as rough estimates. The further outside the data, the less reliable the straight-line assumption.
If many points roughly follow a line but do not sit exactly on it, a best-fit line from linear regression is a better model than connecting the dots.
Frequently asked questions
What is the linear interpolation formula?
y = y₁ + (x − x₁) × (y₂ − y₁) ÷ (x₂ − x₁). It draws a straight line through (x₁, y₁) and (x₂, y₂) and reads off the y value at your x. For example, between (20, 0.998) and (30, 0.996), the value at x = 25 is 0.998 + 5 × (−0.002) ÷ 10 = 0.997.
What is the difference between interpolation and extrapolation?
Interpolation estimates a value inside the range of your known data (between x₁ and x₂). Extrapolation extends the line beyond that range. The formula is the same, but extrapolation is less reliable because the trend may not continue.
How do I interpolate from a table?
Find the two rows whose x values surround your x, then apply the formula to those two rows only. This calculator does that automatically: paste the table, enter x, and it picks the bracketing rows (highlighted in the table and plot).
Can I find x when I know y?
Yes. Choose 'x for a given y' to use the inverse formula x = x₁ + (y − y₁) × (x₂ − x₁) ÷ (y₂ − y₁). If the table goes up and down, the same y may occur more than once; the calculator lists the other matching x values.
How accurate is linear interpolation?
It is exact when the relationship really is a straight line, and a good approximation when the points are close together. For strongly curved data, such as exponential growth, the error grows with the distance between the two points, so use rows that are as close to your x as possible.
What is double interpolation?
When a table depends on two variables (for example temperature and pressure in a steam table), you interpolate in one direction to get two intermediate values, then interpolate between those. You can do this by running this calculator three times.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.