Linear Interpolation Calculator
Estimate a y-value on the straight line through two known points. Enter (x₁, y₁), (x₂, y₂) and the target x-value; the calculator returns y, slope, intercept and the target’s fractional position along the interval. A target between the known x-values is interpolation. A target outside them is clearly marked as extrapolation, where the straight-line assumption is usually less reliable.
How it works
-
1
Enter the first point
Provide x₁ and y₁ with matching real-world units. Negative and decimal values are supported.
-
2
Enter the second point
Provide x₂ and y₂. The two x-values must differ, or a unique slope cannot be calculated.
-
3
Choose the target x-value
Review the calculated y-value, slope, formula substitution and interpolation or extrapolation status.
How linear interpolation works
Two points with different x-values define one straight line. For a target x, this calculator uses:
y = y₁ + (x − x₁) × (y₂ − y₁) / (x₂ − x₁)
The slope is m = (y₂ − y₁) / (x₂ − x₁). The position fraction t = (x − x₁) / (x₂ − x₁) shows where the target lies relative to the first point: t = 0 is point 1, t = 1 is point 2, and 0 < t < 1 is between them. NIST describes interpolation as estimating values at unobserved regions between design points and distinguishes it from extrapolation beyond them in its Engineering Statistics Handbook. NIST also gives the straight-line model as f(x) = β₀ + β₁x in its straight-line reference.
Worked example
Suppose the known points are (10, 25.5) and (20, 40.5), and the target is x = 14.
- Slope:
(40.5 − 25.5) / (20 − 10) = 1.5 - Position fraction:
(14 − 10) / (20 − 10) = 0.4 - Result:
25.5 + 0.4 × 15 = 31.5
Because 14 lies between 10 and 20, this is interpolation.
| Position fraction | Target location | Tool status |
|---|---|---|
| Less than 0 | Before point 1 along the directed line | Extrapolation |
| 0 to 1 | Between the two x-values, including endpoints | Interpolation |
| Greater than 1 | Beyond point 2 along the directed line | Extrapolation |
When the estimate can mislead
Linear interpolation assumes the relationship is adequately straight over the interval. It does not discover curvature, discontinuities, thresholds or measurement error from only two points. Keep x-units consistent with each other and y-units consistent with each other; the x- and y-units do not need to match. Extrapolation extends the same slope beyond observed data and deserves extra caution. SciPy’s official extrapolation guidance likewise notes that out-of-domain behaviour requires deliberate handling. For safety-critical, financial, scientific or engineering decisions, confirm that a linear model is justified and use appropriate source data and uncertainty analysis.
Frequently Asked Questions
Interpolation evaluates the straight line at an x-value within the range of the two known x-values. Extrapolation extends that line outside the known range and is usually more uncertain.
The slope divides by x₂ − x₁. Equal x-values make that denominator zero and describe a vertical line, which does not assign one y-value to every target x.
Yes. Signed finite numbers and the active locale’s decimal mark are accepted. Do not include thousands separators, units or scientific notation in the fields.
The five values may pass through this site in requests to our servers or funnel URLs so the result can be calculated and restored. The tool does not send them to a third-party service, but you should not enter confidential information.
Related Tools
Social Security Calculator
Estimate a US Social Security retirement benefit from your PIA and claiming age. Compare monthly and annual amounts at 62, FRA 67 and 70.
BMI Calculator
Calculate body mass index from height and weight. Shows WHO category, healthy-weight range and limitations of BMI.
Age Calculator
Calculate exact age in years, months and days from a birth date, plus total days, hours and the next birthday countdown.
Dog Age Calculator
Convert your dog's age to human years using modern veterinary research. Breed-size aware: small, medium and large dogs age differently.
Fahrenheit to Celsius Converter
Convert Fahrenheit temperatures to Celsius with the exact formula, Kelvin output and common reference points for weather, cooking and health.
Time Zone Converter
Convert a time between any two time zones, with daylight-saving shifts applied automatically.
Tool available in other languages
- Kalkylator för linjär interpolation [SV]
- حاسبة الاستيفاء الخطي [AR]
- Calculateur d'interpolation linéaire [FR]
- Kalkulator interpolasi linear [ID]
- Rechner für lineare Interpolation [DE]
- 선형 보간 계산기 [KO]
- Kalkulator interpolacji liniowej [PL]
- เครื่องคำนวณการประมาณค่าในช่วงเชิงเส้น [TH]
- Calculator voor lineaire interpolatie [NL]
- Máy tính nội suy tuyến tính [VI]
- 線形補間計算ツール [JA]
- Calculadora de interpolación lineal [ES]
- Calculadora de interpolação linear [PT]
- Calcolatore di interpolazione lineare [IT]
- Калькулятор линейной интерполяции [RU]
- Doğrusal interpolasyon hesaplayıcı [TR]
- 线性插值计算器 [ZH]