Linear Interpolation Calculator

Find the value between two known points on a straight line: y from x, or x from y, with a warning when the value lies outside the points. Paste a table of x, y rows to look a value up between the two rows that bracket it.

Calculator Numbers & Math Updated Oct 3, 2026
How to Use
  1. Choose Find y (you know x), Find x (you know y) or Table (you have several rows).
  2. Type the two known points (x₁, y₁) and (x₂, y₂). Decimals and fractions such as 3/8 or 1 1/2 are fine.
  3. Type the value to look up and read the answer, the slope and how far along the line it is.
  4. For a table, paste one x, y pair per line (space, tab, comma or semicolon between them). The rows are sorted if needed and a header line is skipped.
  5. If the value is outside the points, the answer is an extrapolation and is marked as one. The graph shows the line, the pair used and the answer.
Input
x and y, one row per line
Presets
Between the points
Result
—
Slope
—
Fraction along
—
Type
—

Worked Example

A steam table. Water boils at 101.42 kPa at 100 °C and 143.38 kPa at 110 °C. The slope is (143.38 − 101.42) ÷ (110 − 100) = 4.196 kPa per °C, so at 105 °C: 101.42 + (105 − 100) × 4.196 = 122.40 kPa. The table’s own 105 °C row gives 120.90 kPa; the straight line is 1.50 kPa high because the real curve bends upward, which is why tables are printed with closely spaced rows.

Fractions of an inch. Steel plate weighs 10.21 lb/ft² at 1/4 inch and 20.42 lb/ft² at 1/2 inch. 3/8 inch is (3/8 − 1/4) ÷ (1/2 − 1/4) = 1/2 of the way along, so it weighs 10.21 + ½ × 10.21 = 15.315 lb/ft².

The common mistake: measuring from the wrong end. With (0, 32) and (100, 212), 37 °C is 32 + (37 − 0) × 1.8 = 98.6 °F. Taking the distance from the other point, 32 + (100 − 37) × 1.8 = 145.4, is wrong: the step (x − x₁) must be measured from the same point as the y₁ you start from.

Show Work

Enter two points and a value to see the step-by-step working.

Formulas

Find y
y = y₁ + (x − x₁)(y₂ − y₁) ÷ (x₂ − x₁)
Find x
x = x₁ + (y − y₁)(x₂ − x₁) ÷ (y₂ − y₁)
Fraction along (lerp)
t = (x − x₁) ÷ (x₂ − x₁), y = (1 − t)y₁ + t·y₂
Slope
m = (y₂ − y₁) ÷ (x₂ − x₁)
Error on a curve
|error| ≤ (x₂ − x₁)² × max|f″| ÷ 8

Reading Between the Lines

Interpolation is as old as tables. Babylonian astronomers used it in their planetary tables in the last centuries BC, and Ptolemy’s Almagest (about AD 150) tells the reader to interpolate in proportion between the entries of his table of chords. Around AD 600 Liu Zhuo in China, and in 665 Brahmagupta in India, went a step further, to second-order interpolation that follows a curve rather than a straight line.

For centuries afterwards, anyone using logarithm, trigonometry or steam tables interpolated by hand, and tables were printed with rows close enough that a straight line between them was accurate to the last digit shown. The error is set by how much the curve bends between rows: it shrinks with the square of the row spacing, so halving the spacing cuts it to about a quarter.

About This Calculator

This calculator finds a value on the straight line between two points, in either direction, and looks values up in a pasted table by finding the two rows that bracket them. It works in exact fractions, so inputs such as 3/8 stay exact, warns when the answer is an extrapolation, and shows the slope, the line’s equation and every step of the working.

Everything runs in your browser; nothing is sent anywhere.

Related calculators: Slope Calculator, Data Regression Tool, and Numerical Methods Lab.

Frequently Asked Questions

What is the linear interpolation formula?

y = y₁ + (x − x₁)(y₂ − y₁) ÷ (x₂ − x₁). Start at the first point and add the slope times how far x is past x₁. On the line through (0, 32) and (100, 212), which converts °C to °F, the slope is 180 ÷ 100 = 1.8, so 37 °C gives 32 + 37 × 1.8 = 98.6 °F.

What is the difference between interpolation and extrapolation?

Interpolation estimates a value between the two known points; extrapolation goes beyond them and assumes the line carries on. A 4–20 mA transmitter scaled 0–100 psi reads 75 psi at 16 mA, inside the range. Extrapolating to 22 mA gives 112.5 psi, a pressure the sensor was never calibrated for.

How accurate is linear interpolation in a steam table?

Close, but not exact, because the properties curve. The saturation pressure of water is 101.42 kPa at 100 °C and 143.38 kPa at 110 °C. A straight line gives 122.40 kPa at 105 °C, while the table’s own 105 °C row says 120.90 kPa: 1.2% high. Interpolating between closer rows reduces the error.

How do I interpolate backwards, to find x from y?

Swap the roles: x = x₁ + (y − y₁)(x₂ − x₁) ÷ (y₂ − y₁). For a 4–20 mA signal that covers 0–100 psi, 75 psi is 4 + 75 × 16 ÷ 100 = 16 mA. It needs y₁ and y₂ to differ, or the line is flat and every x gives the same y.

How do I interpolate in a table?

Find the two rows that bracket the value and interpolate between just those two. In a steam table with rows at 110 °C (143.38 kPa) and 115 °C (169.18 kPa), 112 °C is 2/5 of the way along, so the pressure is 143.38 + 0.4 × 25.80 = 153.70 kPa.

How do I use the Linear Interpolation Calculator?

Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.

Do I need to install or sign up for anything?

Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.

Is my information private?

Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.

Common Use Cases

Steam and property tables

112 °C between the 110 °C and 115 °C rows: 153.70 kPa.

Sensor scaling

A 4–20 mA, 0–100 psi transmitter at 12.5 mA reads 53.125 psi.

Reverse look-ups

The same transmitter sends 16 mA at 75 psi.

Unit lines

37 °C on the line through (0, 32) and (100, 212) is 98.6 °F.

Engineering sizes

3/8-inch steel plate, between 1/4 inch (10.21 lb/ft²) and 1/2 inch (20.42 lb/ft²), is 15.315 lb/ft².

Animation and colour

Halfway from 0 to 255 is 127.5, the “lerp” used for blends and keyframes.

Last updated: