Skip to main content
HSCalculadora

Linear Interpolation Calculator

Estimate a value between two known points.

Results update as you type.

Interpolated y
—

How it works

Linear interpolation estimates an unknown value that falls between two known data points by assuming the quantity changes at a steady, straight-line rate between them. This linear interpolation calculator takes two known points, given as x₁, y₁ and x₂, y₂, along with a target x value, and returns the interpolated y value on the straight line connecting the two points. The method is a workhorse of science, engineering, and data analysis because real measurements are often taken only at certain points, yet you frequently need a value in between. The calculation starts at the first known point and adds a fraction of the total rise, scaled by how far along the interval the target x sits. In formula terms, it computes the slope between the two points, the change in y over the change in x, and applies that slope over the distance from x₁ to the target x. For example, with points (0, 0) and (10, 100), interpolating at x equals 5 gives y equals 50, exactly halfway up because 5 is halfway along the interval. Linear interpolation reads values from tables, fills gaps in datasets, drives smooth animation between keyframes, and estimates readings between calibration points on an instrument. It assumes the relationship is roughly linear over the interval, which is a good approximation when the two points are close together. This calculator requires x₂ and x₁ to differ, because two points with the same x form a vertical line with no single y value to return.

Formula

y = y₁ + (x − x₁) × (y₂ − y₁) ÷ (x₂ − x₁)

Linear interpolation assumes the value changes at a constant rate between two known points, so it follows the straight line joining them. The slope of that line is the change in y divided by the change in x. Starting from the first point's y-value, you add the slope multiplied by how far the target x lies past x₁. This gives the y-value on the line at that x. It requires x₂ and x₁ to differ, otherwise the line is vertical and the slope is undefined.

Source:Standard mathematics

We review all our tools from time to time to ensure accuracy.

Worked example

x₁:0y₁:0x₂:10y₂:100Target x:5
y = 0 + (5 − 0) × (100 − 0) ÷ (10 − 0) = 50, halfway between the points.

How to use this calculator

  1. 1

    Enter your values

    Enter x₁, y₁, x₂, y₂ and target x.

  2. 2

    Adjust the options

    Fine-tune any options to match your situation.

  3. 3

    Read your result

    Interpolated y updates instantly as you type — no button to press.

Frequently asked questions

What is linear interpolation?

Linear interpolation is a method for estimating an unknown value that lies between two known data points, assuming the value changes in a straight line between them. You draw an imaginary line connecting the two points and read off the value at your target position along it. It is the simplest form of interpolation and is widely used when you have measurements at some points but need an estimate for a point in between.

When is linear interpolation accurate?

Linear interpolation is most accurate when the two known points are close together and the underlying relationship is nearly straight over that interval. If the true relationship curves sharply between the points, the straight-line estimate can drift from reality. For smoothly varying quantities sampled at fine intervals, it is usually very reliable. When higher accuracy is needed over curved data, methods like polynomial or spline interpolation are used instead.

What is the difference between interpolation and extrapolation?

Interpolation estimates a value that falls between known data points, while extrapolation estimates a value beyond the range of the known points. Interpolation is generally safer because you are working inside the region your data covers. Extrapolation is riskier, since the trend may not continue past the measured range. This calculator is designed for interpolation, though the same formula will extend a line beyond the points if you enter an x outside the interval.

Why must x₁ and x₂ be different?

The formula divides by the difference between x₂ and x₁ to find the slope of the connecting line. If those two x values were equal, that difference would be zero, making the slope undefined by division by zero. Two points with the same x also form a vertical line, which has no single y value for a given x. The calculator therefore requires the two x coordinates to differ.

Where is linear interpolation used?

Linear interpolation is used to read values from tables, such as tax brackets or engineering charts, to fill missing entries in datasets, and to convert between calibration points on instruments. In computer graphics and animation it blends smoothly between keyframe positions, a technique often called lerp. Scientists use it to estimate readings between measurements, and finance uses it to approximate rates between quoted values. It is a fundamental everyday estimation tool.