Linear Interpolation Calculator: Find Values in Seconds
A steam table lists the pressure at 35 degrees C and 40 degrees C, but the question asks for 38 degrees C. The value you need falls between the two known rows and is not listed in the table. A linear interpolation calculator fills this gap by drawing a straight line between the two known values and estimating the missing value. It also shows the working so you can follow how the answer is calculated.
This page provides a free tool with five calculation modes, the formula shown with every answer, and the exact numbers behind each result. The linear interpolation calculator on this page gives you the answer with t, the slope, and the line equation together, making it easier to check homework quickly and understand each step.
Two points (0, 0) and (10, 100), target x = 5, gives y = 50.
Using the Linear Interpolation Calculator
The linear interpolation calculator on this page is a general interpolation calculator that covers five kinds of questions. Each calculation takes a few seconds, and every answer shows the working so you can see how the result is reached.
Single Value
Enter two points and a target x value. The tool uses them to interpolate between two points and find y. This linear interpolation solver also shows t, the slope, the intercept, and the line equation. The default values are (0, 0) and (10, 100) at x = 5, which give y = 50.
Reverse Lookup
Enter two points and a target y value. The tool finds the corresponding x value. The default values are (0, 10) and (10, 20), with y = 16, which gives x = 6.
From a Table
Enter a small table of x and y values along with a target x value. The tool selects the two rows that bracket the target and calculates the result between them. The default steam-pressure table uses 38 degrees C and gives 6.682 kPa.
Two-Way Table
Enter four corner values and a target pair. The tool interpolates in two directions and displays all three calculation steps. The default Rose-Hulman grid uses 2.0 bar and 215 degrees C, giving 1.241 cubic metres per kg.
A Whole List
Enter two points and a list of x values. The tool calculates y and t for every x and flags any row outside the interval. The default points are (0, 10) and (10, 20), with x values of 0, 2.5, 5, 7.5, 10, and 12, giving 10, 12.5, 15, 17.5, 20, and 22.
Mode Comparison
| Mode | What you enter | What you get |
|---|---|---|
| Single Value | two points and a target x | y, t, slope, intercept and the line equation |
| Reverse Lookup | two points and a target y | x for that y |
| From a Table | a small x-y table and a target x | the bracketing pair and the interpolated y |
| Two-Way Table | four corner values and a target pair | the two-way result with the three steps shown |
| A Whole List | two points and a list of x values | y and t for every x, with extrapolation flagged |
Worked Examples
These linear interpolation examples are the same ones the tool uses as defaults.
| Example | Answer |
|---|---|
| (0, 0) to (10, 100) at x = 5 | y = 50 |
| (1, 2) to (5, 10) at x = 3 | y = 6 |
| Steam pressure at 38 degrees C | 6.682 kPa |
| Two-way grid at 2.0 bar, 215 degrees C | 1.241 cubic metres per kg |
| (0, 10) to (10, 20), x = 0, 2.5, 5, 7.5, 10, 12 | 10, 12.5, 15, 17.5, 20, 22 |
Reading the Result
Every answer here is an interpolation between two values, and the tool shows t, the fraction of the way from the first point to the second, so you can see exactly where the answer sits. A t between 0 and 1 means interpolation, while a value outside that range is flagged as extrapolation.
What Is Linear Interpolation
Linear interpolation estimates a value between two known points by assuming the change between them is steady. It draws a straight line from the first point to the second and reads the value at the target point.
The linear interpolation calculator on this page takes the two points and the target value, then gives the estimated result with the working shown. You can check each step by hand to see how the answer was calculated.
The key number is t, which represents the fraction of the distance from the first point to the second point. Its value is 0 at the first point and 1 at the second point.
The Straight-Line Assumption
The estimate is exact only when the true function is a straight line between the two points. When the function curves, the straight line provides an estimate, and the wider the interval, the further that estimate can be from the true value.
How to Do Linear Interpolation
Start by picking the two points that bracket the target value. Find t, the fraction of the way from the first point to the second, using (x - x1) divided by (x2 - x1). Multiply t by (y2 - y1), then add the result to y1. The linear interpolation calculator on this page follows the same steps and shows each one.
The slope between two points is (y2 - y1) divided by (x2 - x1). The formula uses that slope to move from the first point toward the target.
The Linear Interpolation Formula
The formula is y = y1 + t times (y2 - y1), where t = (x - x1) divided by (x2 - x1). For example, the points (0, 0) and (10, 100) at x = 5 give t = 0.5 and y = 50, with slope 10 and intercept 0, while the points (1, 2) and (5, 10) at x = 3 give t = 0.5 and y = 6, with slope 2 and intercept 0.
The Inverse Formula
To find x for a given y, work the formula backwards using x = x1 + (y - y1) times (x2 - x1) divided by (y2 - y1). For example, the points (0, 10) and (10, 20) with y = 16 give x = 6.
If x1 equals x2, the formula divides by zero, which is undefined. The tool refuses this case with an explicit error instead of returning a number.
Inverse Interpolation: Finding x for a Given y
The linear interpolation calculator on this page also works backwards. Enter a y value, and the tool finds the x value that gives that result.
Work the formula backwards using x = x1 + (y - y1) times (x2 - x1) divided by (y2 - y1). For the points (0, 10) and (10, 20), a y value of 16 gives x = 0 + 6/10 times 10 = 6.
When Inverse Has No Answer
If y1 equals y2, the line is flat, and no single x matches the given y, so the tool refuses that case with an explicit error instead of returning a number. For the temperatures (8, 68) and (12, 82) in degrees F, a y value of 75 gives x = 8 + 7/14 times 4 = 10, which is 10:00 AM.
Reading a Value from a Table
The linear interpolation calculator on this page reads a table by finding the two rows that bracket the target value. It then uses those rows to estimate the missing value.
The table approach is simple: find the row just below the target and the row just above it, then follow the straight line between those two rows.
Linear Interpolation Table
| Age | Expectation of life |
|---|---|
| 15 | 30 |
| 20 | 29 |
| 25 | 27 |
| 30 | 24 |
| 35 | 20 |
Age 26 sits between 25 (27 years) and 30 (24 years), so the answer is 27 + 1/5 times (-3) = 26.4 years.
The same reading works for a census table. The population in 2007 sits between 2000 (140) and 2010 (210), so it is 140 + 7/10 times 70 = 189.
Steam Table Interpolation
A steam table lists values at set temperatures and pressures. When the required value falls between two listed rows, interpolation estimates the missing value using the two surrounding entries.
The linear interpolation calculator on this page follows the same working a thermodynamics student does by hand. It picks the two rows that bracket the target and follows the straight line between them to estimate the result.
For saturated pressure at 38 degrees C, the value sits between 35 degrees C (5.628 kPa) and 40 degrees C (7.384 kPa). The calculation is 5.628 + 3/5 times 1.756 = 6.682 kPa. For specific volume at 9 degrees C, the value sits between 8 degrees C (121.0) and 10 degrees C (106.4 cubic metres per kg). The calculation is 121.0 + 0.5 times (-14.6) = 113.7 cubic metres per kg.
Double Interpolation
The linear interpolation calculator on this page handles values that depend on two inputs by interpolating twice. First, it calculates values along one input on both bracketing rows, then interpolates along the other input between those two results.
Bilinear Interpolation in One Formula
The formula is f(x, y) = [Q11 times (x2 - x) times (y2 - y) + Q21 times (x - x1) times (y2 - y) + Q12 times (x2 - x) times (y - y1) + Q22 times (x - x1) times (y - y1)] divided by [(x2 - x1) times (y2 - y1)]. The denominator covers the entire four-term sum, not just the last term.
For the Rose-Hulman grid, the value at 2.0 bar and 215 degrees C takes three steps. First, along the temperature at 1.5 bar: 1.444 + 15/40 times 0.126 = 1.49125. Second, along the temperature at 3.0 bar: 0.716 + 15/40 times 0.065 = 0.740375. Third, along the pressure between those two results: 1.49125 + 1/3 times (-0.750875) = 1.240958, about 1.241 cubic metres per kg.
A smaller example uses corner values 12, 0, -4, and 8 on x from 0 to 4 and y from 1 to 3. At the point (1, 2), the three steps give R1 = 9, R2 = -1, then P = 9 + 0.5 times (-10) = 4.
Interpolation vs Extrapolation
The linear interpolation calculator on this page performs the same arithmetic for both, but it flags the difference. Interpolation stays between the two known points, while extrapolation estimates a value beyond them.
This page does not have a separate extrapolation calculator. Instead, the Single Value mode flags any target outside the interval, so the warning appears directly in the result.
The number t tells you which one is happening. A t between 0 and 1 means interpolation, while a t outside that range means extrapolation. For the points (2, 6) and (5, 9), x = 8 gives t = 2 and y = 12, which is extrapolation.
When Linear Interpolation Goes Wrong
The linear interpolation calculator on this page gives an exact answer only when the true function is a straight line between the two points. Otherwise, the answer is an estimate, and the wider the interval, the further the estimate can be from the true value.
For y = x to the power 2, the points (1, 1) and (2, 4) give 2.5 at x = 1.5, while the true value is 2.25, an error of 0.25. Extrapolating the same line to x = 3 gives 7, while the true value is 9, an error of 2, which is eight times larger.
A best-fit line for CD singles, y = 14x + 2.4, predicted 72.4 for 1998 against an actual value of 56, and 100.4 for 2000 against an actual value of 34. The further outside the data you go, the worse the estimate becomes.
An interpolated value always lies between the two y values. If a result falls outside them, the working is wrong. Interpolating across a sudden jump, such as a phase change in a steam table, also produces a meaningless result.
Why Your Results May Differ
- A page that says superheated steam at 750 degrees F has a specific volume of 0.21545 is wrong. The correct answer is 0.147545, because 0.14000 + (10 times 0.01509) divided by 20 = 0.147545. The wrong answer is also impossible because 0.21545 is larger than both bracketing values, 0.14000 and 0.15509, and an interpolated value must lie between them.
- A thread that calls y at x = 8 from the points (2, 6) and (5, 9) interpolation is wrong. Since x = 8 is outside [2, 5], it is extrapolation, not interpolation. The arithmetic gives 12, but the label is wrong.
- A thread that answers a one-point question, y = -18 when x = 9, find y at x = 7, is wrong. One point cannot define a line, and calculating the slope from the unknown y itself is circular and never produces a valid value.
- An answer that gives 26.1632 for life expectancy at age 26 is not linear interpolation. That number comes from Newton's forward-difference formula, which uses all five table points. The linear answer is 26.4.
- A page that says checking the cookie line at zero flour might yield a negative value is wrong for its own example. With its slope 0.05 and intercept 5, y at zero flour is 5, not negative.
Questions Students Ask While Solving
These are real questions students ask while solving interpolation problems. The linear interpolation calculator on this page helps check each answer and follow the working step by step.
What is the value of 8 using the Interpolation Method? Some sets of values are given (2, 6), (5, 9).
12. The working is y = 6 + (8 - 2) / (5 - 2) times 3 = 12, but x = 8 is outside [2, 5], so this is extrapolation, not interpolation.
Find the value of f(2). Given that f(-1) = 4 and f(3) = 6.
5.5. The working is 4 + (2 - (-1)) / (3 - (-1)) times 2 = 4 + 3/4 times 2 = 5.5.
The table shows the expectation of life at different ages. Interpolate the expectation of life at the age 26. Age 15 20 25 30 35; Expectation 30 29 27 24 20.
26.4 years. The age 26 sits between 25 (27 years) and 30 (24 years), so the answer is 27 + 1/5 times (-3) = 26.4.
What is the final temperature of steam that is compressed from 4 MPa and 300 degrees C to 9 MPa isentropically?
About 419 degrees C. The entropy 6.3639 falls between 400 degrees C (6.2876) and 450 degrees C (6.4872) at 9 MPa, so the temperature is 400 + 0.0763 / 0.1996 times 50 = 419.11, about 419 degrees C.
How to find sine values using log book?
By interpolating the table, use the nearest values and work halfway between them. Sin 37.5 degrees sits between sin 37 degrees (0.6018) and sin 38 degrees (0.6157), so it is 0.6018 + 0.5 times 0.0139 = 0.60875. Sin 22.5 degrees is 0.3746 + 0.5 times 0.0161 = 0.38265, about 0.3827.
For the following data, draw a scatter plot. If we wanted to know when the population would reach 15,000, would the answer involve interpolation or extrapolation? Eyeball the line, and estimate the answer.
Extrapolation, because 15,000 is outside the data range. The average rate is 2250 / 20 = 112.5 people per year, so 1250 / 112.5 = 11.11 years after 2010, which is about 2021.
If y = -18 when x = 9, find y when x = 7.
There is no answer. One point cannot define a line, so y at x = 7 cannot be found from (9, -18) alone. The thread's answer works the slope out from the unknown y itself, which is circular and never gives a value.
Linear Interpolation and Other Methods
Newton's forward-difference formula uses all five life-table points and gives 26.1632 for age 26, while the two-point straight-line answer is 26.4. The two methods answer different questions, so the numbers differ.
A spline is a smooth curve through the points rather than a straight line, so it gives yet another answer. This page uses the two-point straight-line rule only, because it is the one a student can check by hand.
Frequently Asked Questions
Final Thought
Interpolation turns two known values into every value between them, and the answer is only as good as the straight line behind it. The linear interpolation calculator on this page shows the working with every answer, so you can check the number. Check that your result falls between the two known values, because an interpolated value outside that range means the working went wrong. Keep the target inside the bracket formed by your points, and treat any value beyond the ends as an estimate from an extended line rather than a true interpolation.
