Linear Interpolation Calculator
Interpolated value, slope, and fraction between two points.
What it does
Printed tables leave gaps: tide heights between hours, steam values between pressures, taxes between brackets. Linear interpolation bridges each gap with a straight line drawn between the two nearest rows.
The tool above takes two points with a query x. It returns the interpolated y, the slope, and the fraction along the interval.
The default (10,100) to (20,200) at x = 15 gives 150 at slope 10 per x, exactly halfway. The 0 to 10 case at x = 3 gives 30 with the same slope at 0.3 along.
Calculus texts frame this as point slope linearization, and LibreTexts mirrors the construction for approximation between tabulated values. Tide and engineering tables assume readers interpolate exactly this way.
Straight lines serve short gaps well and punish long ones. Check the fraction first: inside 0 to 1 reads interpolation, outside reads extrapolation with growing risk.
How to use
- Type the first point.
- Type the second point.
- Type the query x.
- Read y first.
- Read slope beside it.
- Read the fraction last.
Formula
- (x0,y0),(x1,y1)
- Known endpoints of the interval.
- x
- Query point on the x axis.
- fraction
- Position of x between x0 and x1.
LibreTexts mathematics and OpenStax calculus carry linear approximation with the same point slope build. The fraction (x minus x0)/(x1 minus x0) marks position along the run; y follows proportionally. Equal x inputs have no defined slope, so the tool refuses them.
Worked example
Example: halfway between points
Defaults: (10,100) to (20,200) at x = 15.
- Points: (10, 100) and (20, 200), ask x = 15.
- Fraction: (15 minus 10) / (20 minus 10) = 0.5.
- Value: 100 + 0.5 x (200 minus 100) = 150.
- Slope: (200 minus 100) / (20 minus 10) = 10 per x.
- Check: midpoint of a straight run splits evenly.
- Tool shows 150, 10 per x, 0.5 of the way.
Reference table
| Points and x | y | Fraction |
|---|---|---|
| (10,100)-(20,200), x=15 | 150 | 0.5 |
| (0,0)-(10,100), x=3 | 30 | 0.3 |
| (5,20)-(15,60), x=10 | 40 | 0.5 |
| (0,10)-(4,30), x=1 | 15 | 0.25 |
Limits
- Straightness assumed between points.
- Curves need more rows or methods.
- Equal x inputs refused.
- Garbage rows give garbage y.
Common mistakes
- Extrapolating far past the interval.
- Swapping x and y columns.
- Dividing by zero width intervals.
- Trusting curved tables blindly.
- Rounding inputs before math.
Try it yourself
Quick checks. Answers sit tucked under each question.
(0,0) to (10,100) at x = 3?
y = 30, slope 10 per x, 0.3 of the way.
(5,20) to (15,60) at x = 10?
y = 40, slope 4 per x, 0.5 of the way.
x0 = x1 = 5?
x0 equals x1: no slope exists, widen the interval.
Questions
The formula?
y = y0 + (x minus x0)(y1 minus y0)/(x1 minus x0). Straight line between two known points.
Extrapolate outside?
Yes, but error grows past the interval. Curves punish long reaches fast.
Same x twice?
Equal x values give no slope. The tool asks for differing x0 and x1.
Used where?
Tide tables, steam tables, tax brackets, and sensor calibration between printed rows.
Curved data?
No. It assumes straightness; curves need spline or fit methods.
Fraction meaning?
Fraction under 0 or over 1 flags outside the interval. Read it before trusting y.