Linear interpolation
Estimate Y from two known X/Y points and a target X.
- 1Add input
- 2Review and run
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Enter two known X/Y pairs and a target X to estimate Y on the straight line between them. The result is extrapolation when the target lies outside the known X interval.
How to use this tool
- Enter two known X/Y coordinate pairs and keep each axis in consistent units.
- Enter the target X and check the live estimate and any extrapolation warning.
- Calculate, copy Y or the full JSON, or download the JSON with the exact rational result.
Supported inputs and limits
One pair of known points and one target X; X₁ must differ from X₂. No table lookup, curve fitting or inverse X-at-Y mode.
Plain decimal values within ±1 trillion, at most 12 decimal places and 40 characters each. Y is rounded to 12 places when its exact decimal repeats.
Inputs remain in this browser; measurement uncertainty and the physical validity of a linear assumption are not assessed.
Worked example
Example input
5
Example options
{"x1":"0","y1":"0","x2":"10","y2":"100"}Example output
{
"x1": "0",
"y1": "0",
"x2": "10",
"y2": "100",
"x": "5",
"y": "50",
"exactYFraction": "50/1",
"exactToTwelvePlaces": true,
"position": "0.5",
"slope": "10",
"extrapolated": false
}When something does not work
Check both X values, units and target X. If the target is outside the interval, decide whether a straight-line extrapolation is justified.
Frequently asked questions
What happens if the two X values are the same?
A vertical line has no unique Y for a target X, so the tool asks for two different X values.
Can I use a target outside the known X interval?
Yes. The formula continues the same slope and clearly labels the result as extrapolation. Check whether that assumption fits your data.
Why might Y be rounded?
The exact rational value may have a repeating decimal. The visible Y is rounded to 12 decimal places; the downloaded JSON includes the exact fraction for the entered decimals.
Is my input sent to a server?
No. The calculation runs in your browser. A refresh or closed tab clears temporary workspace state; save the result you need.
Documentation & further reading
Related tools
Unit converter
Convert length, area, mass, volume and temperature with compatible units side by side.
Percentage calculator
Find a share, calculate an amount from a percent, or measure percentage change.
Aspect ratio calculator
Reduce a width and height to a ratio, then plan a proportional pixel size.
Data size converter
Convert bit and byte amounts across decimal MB/GB and binary MiB/GiB units.