Linear Interpolation Calculator
- Linear interpolation estimates a value between two known points by travelling along the straight line that joins them: y = y1 + (x - x1) x slope, where the slope comes from the two known points.
- The two known points are (2, 10) and (6, 26), so the slope of the line is (26 - 10) / (6 - 2) = 4.00.
- The target x = 4 sits 50.00% of the way from the first point to the second.
- Interpolated value = 10 + (4 - 2) x 4.00 = 18.00.
- Interpolation assumes the trend between the points is straight; outside the two points the same formula becomes extrapolation, and the further you go the less the straight-line assumption can be trusted.
A linear interpolation calculator estimates a value between two known points by travelling along the straight line joining them. You supply the two points and the x value you want to look up, and the calculator returns the interpolated y value along with the formula and the arithmetic behind it. For example, between the points (0, 10) and (10, 30), the value at x = 4 is 18.00. A calibration table running from (2, 5) to (8, 29) reads 17.00 at x = 5. And between quotes of (100, 25) and (200, 45), x = 150 lands halfway at 35.00. Each result comes with the step-by-step workings so you can check every figure yourself.
The straight-line method is the accepted standard for this kind of calculation because it is the simplest assumption that fits both known points exactly, and it is easy to reproduce by hand, in a spreadsheet or in code. The same formula used outside the two points is extrapolation, where the straight-line assumption weakens quickly, so treat results beyond your known range with caution. This page shows the formula, the step-by-step workings, worked examples and sources, so you can follow the method rather than just accept the answer.
Worked examples
Table lookup
Between (0, 10) and (10, 30), the value at x = 4 is 18.00. (2 · 10 · 6 · 26 · 4)
| Interpolated value | 18.00 |
| Slope | 4.00 |
| Position along interval | 50.00% |
| Interval span | 4.00 |
Sensor calibration
A calibration table from (2, 5) to (8, 29) reads 17.00 at x = 5. (0 · 5 · 10 · 45 · 3)
| Interpolated value | 17.00 |
| Slope | 4.00 |
| Position along interval | 30.00% |
| Interval span | 10.00 |
Price between quotes
Between quotes (100, 25) and (200, 45), x = 150 lands halfway at 35.00. (1.5 · 20 · 4.5 · 50 · 3)
| Interpolated value | 35.00 |
| Slope | 10.00 |
| Position along interval | 50.00% |
| Interval span | 3.00 |
What interpolation is
Linear interpolation is the practice of estimating an unknown value that falls between two values you already know. You do it by drawing a straight line from one known point to the other and reading off the value that sits on that line at the position you care about. No curve, no fitting, no guesswork about the shape of the data — just the simplest possible assumption that the change from one point to the next is steady. A linear interpolation calculator takes two known points and a target position and returns the value on that straight line, so you do not have to work through the arithmetic by hand.
The idea is easiest to see with numbers. Suppose you know a value is 10 when x is 0, and 30 when x is 10. The straight line between those points rises by 20 over a run of 10, so each step of 1 in x adds 2. At x = 4, the estimate is 18.00. The same logic handles real tables. A calibration table that runs from (2, 5) to (8, 29) reads 17.00 at x = 5. And when the gap is a clean halfway point, the answer is the midpoint: between quotes of (100, 25) and (200, 45), x = 150 lands halfway at 35.00. In every case the method does one thing — it walks along the line joining two known points and reports where you end up.
This is why interpolation is so useful for filling gaps in tables and data. Reference tables, calibration sheets, and price schedules often list values at fixed intervals, and you need a number in between. Interpolation gives you a defensible answer without collecting new measurements, and it is transparent: anyone can check the straight line you used. It is also quick, which matters when you are filling many gaps at once.
The honest part is knowing when the assumption holds. A straight line is a good stand-in when the underlying change is roughly steady across the interval and the two known points are close together. It is weaker when the data bends sharply, when the points are far apart, or when the quantity you are estimating cannot move in a straight line. Interpolation also only speaks to the space between the two points. The same formula used outside the two points is extrapolation, where the straight-line assumption weakens quickly. Used inside the gap, linear interpolation is a clear, checkable estimate; used beyond it, it is a guess dressed up as a calculation.
The interpolation formula
The linear interpolation calculator rests on a single, short formula. You start with two known points, call them (x1, y1) and (x2, y2), and find the slope of the straight line that joins them: slope = (y2 − y1) ÷ (x2 − x1). From there, the estimate at any x between the two points is y = y1 + (x − x1) × slope. In words: begin at the first known value y1, then add the slope multiplied by how far x has travelled past x1. Every result below comes from that one line.
Take the points (0, 10) and (10, 30). The slope is (30 − 10) ÷ (10 − 0) = 20 ÷ 10 = 2 per unit of x. To estimate at x = 4, move 4 units past x1 = 0 and add 4 × 2 = 8 to y1 = 10. The estimate is 18.00. Notice the order of operations: the slope is fixed by the two known points, and the only thing that changes from one x to the next is the distance (x − x1). That is why the method is so quick to apply by hand or with a linear interpolation calculator.
A second check uses a calibration table running from (2, 5) to (8, 29). The slope is (29 − 5) ÷ (8 − 2) = 24 ÷ 6 = 4 per unit. At x = 5, the distance past x1 = 2 is 3, so the estimate is 5 + 3 × 4 = 17.00. The table reads 17.00, which matches the formula exactly.
The halfway case is the easiest to sanity-check. Between quotes (100, 25) and (200, 45), the slope is (45 − 25) ÷ (200 − 100) = 20 ÷ 100 = 0.2 per unit. At x = 150, the distance past x1 = 100 is 50, so the estimate is 25 + 50 × 0.2 = 25 + 10 = 35.00. Because 150 sits exactly halfway between 100 and 200, the answer is exactly halfway between 25 and 45. Whenever x is the midpoint of the two known x-values, the estimate is the midpoint of the two known y-values — a fast way to confirm the arithmetic before trusting a result.
- Find the slope: (y2 − y1) ÷ (x2 − x1).
- Measure the distance: (x − x1).
- Add the rise to the first value: y = y1 + (x − x1) × slope.
- Check: at the midpoint of x1 and x2, the result is the midpoint of y1 and y2.
Interpolation vs extrapolation
Linear interpolation estimates a value between two known points by travelling along the straight line joining them. That word "between" is doing a lot of work. Inside the interval, the line is pinned at both ends: whatever the true relationship looks like, you know it passes through both known points, so the straight line is a reasonable stand-in over that stretch. A linear interpolation calculator simply reads the height of that line at the x you ask for. Between (0, 10) and (10, 30), the value at x = 4 is 18.00 — the line rises 20 units over 10, so at 4 it has climbed 8. A calibration table from (2, 5) to (8, 29) reads 17.00 at x = 5. And between quotes (100, 25) and (200, 45), x = 150 lands halfway at 35.00. In each case the answer is held in place by two real measurements.
Step outside the interval and the situation changes. The same formula used outside the two points is extrapolation, where the straight-line assumption weakens quickly. The line is now anchored at one end and free at the other, drifting into territory where nothing you measured restrains it. If the underlying relationship curves, bends, or levels off just past your last data point, the straight line keeps going anyway, confidently and possibly wrongly. Nothing in the arithmetic signals that the answer has left solid ground — the output looks exactly as tidy as an interpolated one.
This asymmetry explains why engineers interpolate freely and extrapolate cautiously. Interpolation is a form of reading between the lines: the endpoints bracket the answer, so errors stay bounded by how far the true curve strays from a straight segment over a short span. Extrapolation is a guess about the unseen. A pump curve, a sensor's response, or a price trend may behave very differently one step beyond the table than it did between the last two entries. The further out you go, the more the line's slope — a detail of the last measured pair — gets amplified into the answer.
The practical habit is straightforward. Use a linear interpolation calculator with confidence when your x falls between your two known points, and treat any result beyond them as a first estimate that deserves a second look. When you must extrapolate, keep the distance short, check whether the trend plausibly continues, and prefer a model that reflects the actual shape of the data over a straight line stretched past its evidence.
A quick way to keep the distinction in mind: interpolation is supported at both ends, extrapolation at only one. The math is identical; the confidence is not.
Everyday uses
Linear interpolation shows up in more places than most people expect, and a linear interpolation calculator makes each of those jobs quick and consistent. The idea is always the same: estimate a value between two known points by travelling along the straight line joining them. Once you see that pattern, you start noticing it in calibration tables, tax brackets, price ladders, and lab notebooks alike.
Sensor and thermocouple work is a classic case. Manufacturer tables list readings at fixed intervals, but your instrument may sit between two of those rows. Suppose a calibration table runs from (2, 5) to (8, 29). At x = 5, the table reads 17.00, and that figure comes straight from drawing the line between the two known entries. The same approach lets you convert a raw voltage or resistance into a temperature reading without hunting for a denser table.
Money matters follow the same logic. Tax and tariff brackets often specify a rate at a low threshold and another at a high one, and the amount owed in between moves along a straight line. Price ladders work the same way: a supplier might quote 25 at a quantity of 100 and 45 at a quantity of 200. Between quotes (100, 25) and (200, 45), x = 150 lands halfway at 35.00. Currency conversion tables with fixed rate steps are another everyday example, since an amount between two listed figures can be estimated the same way.
In lab work and coursework, reading between plotted points is a daily task. A graph may show measurements at a handful of x-values, and you need a value at an x that falls between two of them. Take points (0, 10) and (10, 30): the value at x = 4 is 18.00. That is the kind of quick estimate a linear interpolation calculator handles in seconds, and it keeps your arithmetic consistent whether you are checking a trend line or filling in a missing reading.
FAQs
What is linear interpolation?
Linear interpolation estimates a value between two known data points by assuming the straight line between them. The formula is y = y1 + (x - x1) x slope. In plain terms, you take the known starting value and add the change that occurs at your position along the line, based on how steep that line is.
How do you interpolate between two points?
First find the slope from the known points, then step from the first point. For example, between (0, 10) and (10, 30), x = 4 gives 18.00. The slope here is 2 per unit of x, so moving 4 units from the first point adds 8 to the starting value of 10.
What is the difference between interpolation and extrapolation?
Interpolation estimates a value inside the known interval, between your existing data points. Extrapolation extends the same line beyond that interval to predict values outside the known range. Errors grow fast with extrapolation, because the straight-line assumption is stretched past the region where your data actually supports it.
When is linear interpolation accurate?
Linear interpolation is accurate when the underlying relationship is nearly straight between the points. Dense tables and short intervals interpolate well, since the curve has little room to bend away from the line. If the data curves sharply between known points, the straight-line estimate can miss the true value noticeably.
What is lerp?
Lerp is the programmer's name for the same operation, short for linear interpolation. It is used constantly in graphics and animation to blend values smoothly, such as fading between colors or moving an object gradually from one position to another. The math is identical to the two-point interpolation method described above.
Can I interpolate with more than two points?
Yes. Piecewise-linear interpolation chains the two-point method across a table, connecting each adjacent pair of points with its own straight segment. Splines give smoother curves when the data bends, since they avoid the sharp corners that piecewise-linear segments create at each known data point.