Linear Interpolation Calculator
Estimate a missing value on a straight line using two known points, with reverse interpolation, extrapolation warnings, graphing, optional axis labels, and solution steps.
Calculator is for informational purposes only. Terms and Conditions
Choose what to solve for
Select the unknown value. The target input and equation update automatically.
Enter the known values
Coordinates may be positive, negative, or zero. The two x-values cannot be equal or nearly equal.
Visual Check
The graph shows the two known points, the line, and the calculated target point without overlapping labels.
Solution
Live result, quick checks, warnings, and full solution steps.
Quick checks
- Check—
Show solution steps See the equation, substitutions, assumptions, and result path
- Enter values to see the full calculation steps and checks.
Source, Standards, and Assumptions
Calculation basis, constants, assumptions, and limitations.
Source/standard: Standard mathematical linear interpolation method. No single governing code standard is required for this simplified calculation.
- Assumes the relationship between the two known points is linear over the interval.
- Uses direct coordinate values with no built-in unit conversions.
- Extrapolated results are less reliable because they extend the trend outside the known range.
On this page
Calculator Guide
How to Use the Linear Interpolation Calculator
The Linear Interpolation Calculator above estimates a value between two known data points by assuming the change between them is linear. Enter \(x_1\), \(y_1\), \(x_2\), \(y_2\), and a target \(x\) to find an interpolated \(y\), or switch the solve mode to estimate \(x\) from a target \(y\).
Use the guide below to understand the formula, check your inputs, interpret the graph, interpolate from a table, and avoid common mistakes.
Quick Answer
Linear interpolation is the most common way to interpolate between two points when a straight-line estimate is reasonable. If the target is halfway between \(x_1\) and \(x_2\), the answer will also be halfway between \(y_1\) and \(y_2\). If the target is outside the known range, the result becomes extrapolation and should be treated with more caution.
When not to rely on linear interpolation alone
Do not rely on a simple linear interpolation result when the real data is strongly curved, discontinuous, affected by a phase change, based on poor measurements, or far outside the known data range. In those cases, use a more detailed model, more data points, manufacturer data, or qualified engineering judgment.
Inputs and Outputs Used by the Calculator
The calculator needs two known points and one target value. The most common use is solving for \(y\) from a target \(x\), but reverse interpolation can solve for \(x\) from a target \(y\).
| Value | Type | What It Means | Example |
|---|---|---|---|
| \(x_1\) | Input | The x-value for the first known point. | 10 |
| \(y_1\) | Input | The y-value paired with \(x_1\). | 50 |
| \(x_2\) | Input | The x-value for the second known point. It cannot equal \(x_1\). | 20 |
| \(y_2\) | Input | The y-value paired with \(x_2\). | 80 |
| \(x\) or \(y\) | Target | The known target value where the missing value should be estimated. | \(x = 15\) |
| Interpolated result | Output | The estimated value on the straight line between the two known points. | \(y = 65\) |
Linear Interpolation Formula
The standard linear interpolation formula estimates \(y\) at a target \(x\) using two known points. It is the same as finding the slope between the points and moving along that straight line to the target value.
Find \(y\) from \(x\)
Use this when you know the target \(x\)-value and need the corresponding estimated \(y\)-value.
Find \(x\) from \(y\)
Use this reverse interpolation formula when you know the target \(y\)-value and need the corresponding estimated \(x\)-value.
Ratio form
The ratio \(t\) shows how far the target value is between the two known points. When \(0 \lt t \lt 1\), the result is interpolation. When \(t \lt 0\) or \(t \gt 1\), the result is extrapolation.
Lerp formula used in programming
In programming and computer graphics, “lerp” is shorthand for linear interpolation between two values \(a\) and \(b\).
What the Variables Mean
The variables describe two known points and one target value. Use consistent units for all x-values and consistent units for all y-values.
\(x_1, y_1\)
The first known point. In a table, this is usually the row just below or just above the target value.
\(x_2, y_2\)
The second known point. It should be the other row surrounding the target value, not a distant value unless no better data exists.
\(x\)
The target x-value where you want to estimate the matching y-value.
\(y\)
The interpolated result when solving for \(y\), or the target value when reverse-solving for \(x\).
\(t\)
The position ratio. \(t = 0\) is the first point, \(t = 1\) is the second point, and \(0 \lt t \lt 1\) is interpolation.
Slope
The rate of change between the two known points: \(m = (y_2-y_1)/(x_2-x_1)\).
How to Use the Calculator
Use the calculator by choosing the solve mode, entering the two known points, entering the target value, and checking whether the target is inside the known range.
Select the solve mode
Choose Find y from x for the standard interpolation problem. Choose Find x from y when the target output value is known and the matching input value is needed.
Enter the two known points
Enter \(x_1\), \(y_1\), \(x_2\), and \(y_2\). If you are interpolating from a table, use the two rows that directly surround the target value.
Enter the target value
For standard interpolation, enter the target \(x\). For reverse interpolation, enter the target \(y\).
Review the result and graph
Check the interpolated value, slope, line equation, position ratio, and warning messages. If the target is outside the known range, the calculation is extrapolation.
Important unit note
The optional unit labels help display the result clearly, but they do not automatically convert mixed units. Convert all x-values to the same x-unit and all y-values to the same y-unit before entering them.
How to Interpret the Result
A good interpolation result should fall between the two known y-values when the target x-value falls between the two known x-values. If the target is outside the known range, the result may still be mathematically valid, but it is less reliable.
What to do with the result
Use the interpolated value as a quick estimate, table lookup value, calibration point, or check against a more detailed model.
What changes the result most?
The target position between \(x_1\) and \(x_2\) controls how much weight is placed on each known point.
Sanity check
If \(x\) is halfway between \(x_1\) and \(x_2\), then \(y\) should be halfway between \(y_1\) and \(y_2\).
Quick plausibility check
For interpolation, the result should stay between \(y_1\) and \(y_2\). If it does not, recheck whether the target value is actually outside the known range or whether the x-values were entered in the wrong order.
Input Checklist Before You Trust the Answer
Most interpolation mistakes come from choosing the wrong surrounding points, mixing units, or treating extrapolation as if it were interpolation.
Use surrounding points
When working from a table, choose the two rows that directly bracket the target value.
Check \(x_1 \ne x_2\)
If \(x_1\) and \(x_2\) are equal or nearly equal, the slope is undefined or unstable.
Keep units consistent
Do not mix °C with °F, seconds with minutes, feet with meters, or pressure units without converting first.
Watch the target range
If the target is outside the known interval, the result is extrapolated and should be treated cautiously.
Step-by-Step Linear Interpolation Example
This example follows the most common use of the calculator: finding an estimated \(y\)-value from a target \(x\)-value.
Formula
Substitution
Simplify
Final answer
The interpolated value is \(y = 65\). This is reasonable because \(x = 15\) is halfway between 10 and 20, and 65 is halfway between 50 and 80.
Example: Interpolating from a Table
Suppose a table gives density as \(998\ \text{kg/m}^3\) at \(20^\circ C\) and \(996\ \text{kg/m}^3\) at \(30^\circ C\). To estimate density at \(25^\circ C\), use \(20\) as \(x_1\), \(998\) as \(y_1\), \(30\) as \(x_2\), \(996\) as \(y_2\), and \(25\) as \(x\).
Table result
The estimated density at \(25^\circ C\) is \(997\ \text{kg/m}^3\). This is reasonable because 25°C is halfway between 20°C and 30°C, and 997 is halfway between 998 and 996.
Reverse Interpolation Example
Reverse interpolation estimates \(x\) when the target \(y\)-value is known. Using \(x_1 = 10\), \(y_1 = 50\), \(x_2 = 20\), \(y_2 = 80\), and \(y = 65\):
Reverse result
The estimated input value is \(x = 15\). This matches the standard example because \(y = 65\) is halfway between 50 and 80.
How to Visualize Linear Interpolation
Linear interpolation places the target point on the straight line between two known points. The closer the target is to one known point, the more the answer is weighted toward that point.
The target point is calculated by moving along the straight line between Point 1 and Point 2. Text labels are placed in open space so they do not overlap the line, points, or arrows.
Reference Checks for Linear Interpolation
Linear interpolation does not have universal reference values because the result depends entirely on the two known points. Instead, use relationship checks to decide whether the answer is plausible.
Target at \(x_1\)
If \(x = x_1\), the result should equal \(y_1\).
Target at \(x_2\)
If \(x = x_2\), the result should equal \(y_2\).
Target halfway
If \(x\) is halfway between \(x_1\) and \(x_2\), the result should be halfway between \(y_1\) and \(y_2\).
Design Notes and Practical Ranges
For engineering and science work, linear interpolation is usually best for short intervals where the data changes smoothly. The wider the interval or the more curved the real relationship, the less confidence you should place in a simple straight-line estimate.
Engineering tables
Use interpolation to estimate values between tabulated temperature, pressure, density, fluid property, or material property rows.
Calibration and sensors
Estimate an output between two calibration points, such as signal level, measured depth, concentration, or instrument response.
Programming and lerp
Blend between two values using the ratio \(t\), which is common in animation, graphics, simulation, and numerical tools.
Practical rule of thumb
Use the closest surrounding data points available. If the target sits far from both known values, look for more data or use a model that better matches the behavior of the system.
Units and Conversions
Linear interpolation works with any consistent x-unit and y-unit. The calculator’s optional unit labels help make the result readable, but they do not convert mixed units automatically.
Common unit trap
Do not enter \(x_1 = 20^\circ C\), \(x_2 = 86^\circ F\), and \(x = 25^\circ C\). Convert all temperature values to the same unit first, then interpolate.
Do
- Use °C with °C, seconds with seconds, and feet with feet.
- Add unit labels when working with real-world data.
- Convert table values before entering them if the table uses mixed units.
Don’t
- Do not mix °C and °F in the x-values.
- Do not mix meters and feet in the same axis.
- Do not interpolate across values that represent different conditions or datasets.
Linear Interpolation vs Related Methods
Linear interpolation is one of the simplest interpolation methods. It is fast and easy to check, but it is not always the best fit for curved or complex data.
Linear interpolation
Uses one straight line between two known points. Best for short, smooth intervals.
Extrapolation
Extends the same line outside the known data range. Useful for rough estimates but less reliable.
Curve fitting
Uses more data and a selected model. Better when the relationship is nonlinear.
Common Linear Interpolation Mistakes
The formula is simple, but small setup mistakes can produce a confident-looking wrong answer. Most errors happen before the calculation begins.
Do
- Choose the closest surrounding table rows.
- Check whether the target is interpolation or extrapolation.
- Use reverse interpolation only when \(y_1\) and \(y_2\) are different.
- Verify that a straight-line assumption is reasonable.
Don’t
- Do not enter \(x_1 = x_2\).
- Do not use distant data points when closer values are available.
- Do not treat extrapolation as equally reliable as interpolation.
- Do not interpolate across a discontinuity or sudden change.
Troubleshooting Unrealistic Results
If the result looks too high, too low, negative, or outside the expected range, check the target value, known points, units, and whether the calculation is actually extrapolation.
Result is outside both y-values
The target is probably outside the x-range, or the known points may have been entered incorrectly.
Slope looks extreme
\(x_1\) and \(x_2\) may be too close together, or the units may be inconsistent.
Reverse result seems impossible
Check whether \(y_1\) and \(y_2\) are equal or nearly equal. A horizontal line does not produce a unique reverse-interpolated x-value.
Table result seems wrong
Confirm that you selected the two rows surrounding the target, not the first and last rows of the entire table.
Assumptions and Limitations
This calculator uses a simplified mathematical method: it assumes a straight-line relationship between two known points. It does not prove that the underlying system is truly linear.
Linear behavior
The method assumes the change between the two known points is approximately constant.
No code compliance
This is a mathematical estimate, not a code-based design verification.
Input quality
The result is only as good as the known data points, target value, and unit consistency.
Calculation basis
Linear interpolation is a standard numerical method used to estimate values between known data points. No material-specific code, safety factor, or manufacturer standard is built into this calculation.
Key Terms
These terms help connect the calculator inputs, formula, graph, and result.
Interpolation
Estimating a value inside the range of known data points.
Extrapolation
Estimating a value outside the range of known data points.
Slope
The rate of change between two known points.
Target value
The known value where the missing value should be estimated.
Lerp
A common programming abbreviation for linear interpolation.
Linear Interpolation Calculator FAQs
What is linear interpolation?
Linear interpolation estimates a value between two known data points by assuming the change between the points follows a straight line.
What is the linear interpolation formula?
The common formula is \(y = y_1 + (x – x_1)(y_2 – y_1)/(x_2 – x_1)\), where \(x\) is the target x-value and \(y\) is the estimated result.
Can linear interpolation solve for x instead of y?
Yes. Reverse interpolation can solve for \(x\) when \(y\) is known, as long as \(y_1\) and \(y_2\) are not equal.
What is the difference between interpolation and extrapolation?
Interpolation estimates inside the known data range. Extrapolation estimates outside the known data range and is usually less reliable.
How do you interpolate from a table?
Find the two table rows that surround the target value, use those rows as \((x_1,y_1)\) and \((x_2,y_2)\), then enter the target value into the interpolation formula.
Why can linear interpolation be wrong?
Linear interpolation can be wrong when the real relationship is curved, discontinuous, noisy, outside the known data range, or based on incorrect units.