Linear Interpolation Calculator

Estimate an unknown value between two known data points in seconds. Enter your two anchor points and a target x, or paste a full data table for piecewise lookup. Every result includes the step-by-step derivation, an interactive chart, and an extrapolation warning when your query falls outside the known range.

Linear Interpolation Calculator

Estimate an unknown value between two known data points — or interpolate across a full dataset

Known Point 1
Known Point 2

Can be inside or outside the known interval (extrapolation will be flagged).

Quick examples:

How to Use This Calculator

1

Choose a Mode

Use Single Value for a quick one-off estimate, Multiple Values to interpolate several x values at once, or From Table when you have a full dataset and need automatic segment selection.

2

Enter the Data

Type the known x and y values, then add the x you want to estimate. You can paste table data directly from Excel — commas, tabs, and spaces all work as separators.

3

Read the Results

See the interpolated y value, a step-by-step derivation, and a chart with the anchor points and the result highlighted. Any extrapolation is flagged with a warning.

Tip: The parameter t in the step-by-step solution tells you where your x falls within the interval — t = 0 means you are at x₀, t = 1 means you are at x₁, and t = 0.5 means you are exactly in the middle. When t is outside [0, 1], you are extrapolating.

Understanding Linear Interpolation

Linear interpolation answers one of the most common questions in applied mathematics: if you know a quantity at two specific points, what is a reasonable estimate for its value somewhere in between? The technique assumes that the change from one point to the next is proportional — that the relationship traces a straight line. In reality, most natural and financial processes are curved, but over a small enough interval, a straight line is a very good approximation. That is why linear interpolation appears in everything from engineering handbooks to game engine animation systems to financial forecasting.

The word "interpolation" comes from Latin roots meaning "to polish" or "to insert between." In mathematics it means to insert estimated values between known values. "Linear" specifies the shape of the estimate — a straight line. When you need estimates that follow a curve, you turn to polynomial or spline interpolation, but for quick, practical work, linear interpolation is almost always the first tool people reach for.

The Linear Interpolation Formula

The formula is y = y₀ + (x − x₀) × (y₁ − y₀) / (x₁ − x₀). Breaking it down: the term (y₁ − y₀) / (x₁ − x₀) is simply the slope of the line through the two known points. The term (x − x₀) is the horizontal distance from the first known point to your target x. Multiplying the slope by that distance and adding the starting y value gives the estimated height at x. The formula can also be written as y = y₀ + t × (y₁ − y₀) where t = (x − x₀) / (x₁ − x₀). The parameter t is a fraction that tells you where x sits within the interval: 0 is at the first point, 1 is at the second, and 0.5 is exactly halfway.

This second form, using t, is called the "lerp" (linear interpolation) form and is especially common in computer graphics. When an animation engine moves an object smoothly from position A to position B, it computes lerp(A, B, t) as t increases from 0 to 1 over the duration of the movement. The same idea works in three dimensions and with colours, rotations, and any other quantity that can be represented as a number.

A Worked Example

Suppose a pressure sensor reads 1.2 bar at 20 °C and 1.8 bar at 30 °C. You need to know the pressure at 24 °C. Applying the formula: the slope is (1.8 − 1.2) / (30 − 20) = 0.6 / 10 = 0.06 bar per degree. The distance from 20 to 24 is 4 °C. The estimated pressure is 1.2 + 4 × 0.06 = 1.2 + 0.24 = 1.44 bar. Using the t form: t = (24 − 20) / (30 − 20) = 0.4, so y = 1.2 + 0.4 × (1.8 − 1.2) = 1.2 + 0.24 = 1.44 bar. The two approaches always give the same answer — they are algebraically identical.

Interpolation vs. Extrapolation

Interpolation and extrapolation use the same formula but differ in where x sits relative to the known points. When x falls between x₀ and x₁, you are interpolating — the parameter t is between 0 and 1 and you are staying within the region where the straight-line assumption is most defensible. When x is outside the interval — below x₀ or above x₁ — you are extrapolating, and t falls below 0 or above 1. Extrapolation is not wrong, but it carries a higher risk of error because the straight-line trend may not hold beyond the observed range.

This calculator always tells you which case you are in. When the result is extrapolated, the amber warning badge appears below the main value. In practice, extrapolation a short distance beyond the known data is often acceptable — if you have pressure readings at 20 °C and 30 °C, a quick estimate at 31 °C is usually reasonable. Extrapolating to 50 °C or 100 °C would be far less reliable unless you know from physical principles that the relationship stays linear that far out.

Piecewise Linear Interpolation

When you have a full table of measurements rather than just two points, the best approach is piecewise linear interpolation. Instead of drawing a single line through the first and last points — which could be miles off the middle of the data — you draw a separate line segment between each consecutive pair of points and use whichever segment brackets the target x. This produces a connected path that hugs the data closely, and each small segment has a much shorter span over which the linearity assumption needs to hold.

The From Table mode in this calculator implements piecewise interpolation automatically. You paste your dataset, enter the x values you want to estimate, and the calculator identifies the right segment for each one. If your data is already sorted by x, the results are immediate. If not, the calculator sorts it for you before applying the formula. This makes From Table the most useful mode for real-world data analysis, where you often have measurement data from sensors, experiments, or surveys.

Engineering and Scientific Applications

Engineering handbooks — from structural steel tables to thermodynamic steam tables — almost never list values for every possible input. Instead they give values at standard intervals and expect the reader to interpolate between them. A mechanical engineer reading a table of Young's modulus at 100 °C and 200 °C to find the value at 150 °C is doing linear interpolation. A chemical engineer looking up the enthalpy of steam at 1.5 MPa from a table that lists 1.0 MPa and 2.0 MPa is doing the same. Having a calculator that handles the arithmetic instantly removes a common source of error in these lookups.

In meteorology, weather models run on grids with spacing of several kilometres. To estimate conditions at a specific location between two grid points, forecasters interpolate. Similar logic applies to geographic information systems: when a digital elevation model stores heights at a fixed grid, interpolation fills in the heights at all the points in between. The key insight is that measured data is always discrete — it exists only at the points where it was recorded — and interpolation is the tool that bridges the gaps.

Financial and Business Uses

Financial analysts frequently need to estimate values between reported periods. If a company reports annual revenue of $1.2 million in 2022 and $1.8 million in 2024, linear interpolation gives a quick estimate of about $1.5 million for 2023. Bond yield interpolation is another common use: because bonds trade at many different maturities but reference yields are published at standard tenors, traders interpolate to price bonds that mature between the published points. The technique also appears in options pricing, risk management, and budget forecasting.

When Linear Interpolation Is Not Enough

Linear interpolation works well when the underlying relationship is nearly linear over the interval of interest. It breaks down when the data changes direction, has an inflection point, or grows or decays exponentially. For example, interpolating between two points on an exponential growth curve using a straight line will consistently underestimate the true value in the middle of the interval. In those cases, fitting an exponential model or using polynomial interpolation gives better results.

Cubic spline interpolation is a popular alternative when you have many data points and want a smooth curve rather than a piecewise linear path. Unlike straight-line segments, splines are smooth at every join point — they have no sharp corners — and they follow the shape of the data more naturally. However, splines are more computationally expensive and harder to understand intuitively. For most quick calculations where you just need a reasonable estimate between two measurements, linear interpolation remains the right tool for the job.

Frequently Asked Questions

What is linear interpolation?

Linear interpolation is a method for estimating an unknown value that falls between two known data points. It assumes the relationship between the two points is a straight line and finds where a given x would land on that line. The formula is y = y₀ + (x − x₀) × (y₁ − y₀) / (x₁ − x₀). It is one of the most widely used estimation techniques in science, engineering, and finance because it is simple, fast, and reasonably accurate when the known points are close together.

How do I use the linear interpolation formula?

You need four values: x₀ and y₀ (the first known point), x₁ and y₁ (the second known point), and x (the value you want to estimate). Plug them into y = y₀ + (x − x₀) × (y₁ − y₀) / (x₁ − x₀). For example, with points (2, 10) and (6, 30), the slope is (30 − 10) / (6 − 2) = 5. To find y at x = 4: y = 10 + (4 − 2) × 5 = 10 + 10 = 20.

What is the difference between interpolation and extrapolation?

Interpolation estimates a value within the range of the known data points, while extrapolation estimates a value outside that range. Interpolation is generally reliable because you are staying within the observed range of the data. Extrapolation is riskier — the further you go beyond the known points, the more the straight-line assumption can break down and the larger the potential error. This calculator flags extrapolated results with a warning so you are always aware when you are working beyond the known range.

What does the "From Table" mode do differently?

The From Table mode accepts a full dataset of x and y pairs rather than just two points. When you enter an x value to interpolate, the calculator automatically finds the two neighbouring data points that bracket your target x and applies the formula using only that segment. This is called piecewise linear interpolation and it is far more accurate than using the two extreme endpoints when you have many measurements, because each local segment closely approximates the shape of the data nearby.

What are real-world uses of linear interpolation?

Linear interpolation appears in many practical fields. Engineers use it to read values from tables that only list data at specific intervals, such as material property tables or steam tables in thermodynamics. Meteorologists interpolate temperatures and pressures between weather station readings. Financial analysts estimate quarterly earnings between annual reports. Video game developers use it (often called lerp) to smoothly animate objects between two positions. Surveyors use it to estimate ground elevations between measurement points.

When is linear interpolation not accurate enough?

Linear interpolation assumes a straight-line relationship between the two known points. If the actual relationship is curved — as with exponential growth, trigonometric functions, or data with sharp bends — the straight-line estimate will have meaningful error, especially when the known points are far apart. In those cases, polynomial interpolation, spline interpolation, or other curve-fitting methods give better results. A good rule of thumb is to use linear interpolation only when the interval between the known points is small relative to the scale of the variation in your data.