Interpolation Calculator
Linear interpolation between two points: y at any x, x for a given y and the line y = mx + b, with a note when x lies outside them (extrapolation). How it works
Use the Interpolation Calculator
About the Interpolation Calculator
Between (0, 32) and (100, 212), the value at x = 37 is y = 98.6 by y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁). This interpolation calculator finds y at any x on the straight line through two points, finds x for a given y, writes the line as y = mx + b, plots the points, the line and the target, and says when x lies outside the two points.
Worked linear interpolations
| Point 1 | Point 2 | Target x | y | Line | Tool labels it |
|---|---|---|---|---|---|
| (0, 0) | (10, 100) | 5 | 50 | y = 10x | Interpolation |
| (0, 32) | (100, 212) | 37 | 98.6 | y = 1.8x + 32 | Interpolation |
| (2020, 150) | (2025, 210) | 2023 | 186 | y = 12x − 24090 | Interpolation |
| (1, 3) | (4, 9) | 2 | 5 | y = 2x + 1 | Interpolation |
| (3, 12) | (7, 4) | 6 | 6 | y = -2x + 18 | Interpolation |
| (20, 0.9982) | (30, 0.9957) | 25 | 0.99695 | y = -0.00025x + 1.0032 | Interpolation |
| (0, 0) | (10, 100) | 15 | 150 | y = 10x | Extrapolation |
| (0, 0) | (10, 100) | 10 | 100 | y = 10x | Endpoint |
Frequently asked questions
- What is the linear interpolation formula?
- y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁). Between (2020, 150) and (2025, 210), at x = 2023: y = 150 + (2023 − 2020) × (210 − 150)/(2025 − 2020) = 150 + 3 × 12 = 186.
- How do you interpolate to find x for a given y?
- Swap the roles: x = x₁ + (y − y₁)(x₂ − x₁)/(y₂ − y₁). Type the y-value in the Target Y box. Between (0, 32) and (100, 212), y = 98.6 gives x = 37; between (0, 0) and (10, 100), y = 42 gives x = 4.2.
- What is the difference between interpolation and extrapolation?
- Interpolation estimates a value between the two known x-values; extrapolation goes beyond them and assumes the line carries on. Between (0, 0) and (10, 100), x = 5 gives 50 (interpolation) and x = 15 gives 150, which the tool labels extrapolation.
- How do you interpolate between two rows of a table?
- Take the two rows whose x-values bracket your x and enter them as the two points. If a table lists 0.9982 at 20 and 0.9957 at 30, the value at 25 is 0.99695. For a table with two inputs, interpolate along two rows and then between those two results.
- Why does it say X2 must differ from X1?
- Two points with the same x lie on a vertical line, which does not give one y for each x, so there is nothing to interpolate.
Related Tools
View all toolsRREF Calculator
Reduce a matrix of up to 6 × 6 to reduced row echelon form by Gauss-Jordan elimination, with rank, pivot columns and row steps, as decimals or exact fractions.
Slope Calculator
Enter two points for the slope (also as a fraction), y-intercept, distance, angle and line equation, or find a missing coordinate from a point and a slope.
Time Calculator
Add or subtract up to 10 durations in hours, minutes and seconds, or find the hours between two clock times, as HH:MM:SS, decimal hours and minutes.
Right Triangle Calculator
Enter two sides, or one side and an acute angle, to get the other sides, both angles, the area and the perimeter. Legs 3 and 4 give a hypotenuse of 5.
Eigenvalue Calculator
Eigenvalues and eigenvectors of a 2 × 2 or 3 × 3 matrix from its characteristic equation, with the trace and determinant and complex pairs a ± bi.
Linear Regression Calculator
Least-squares line y = mx + b for your (x, y) data, with Pearson r, R², the number of points used and predictions of y from x or x from y.