Calculator
Fill the two known points, pick a mode, and compute. Enable extrapolation if your input falls outside the segment range.
Example Data Table
Using points (2, 5) and (10, 21). For x = 6, the interpolated y equals 13.
| Input | Value | Meaning |
|---|---|---|
| x₁, y₁ | (2, 5) | First known point |
| x₂, y₂ | (10, 21) | Second known point |
| x | 6 | Query x |
| y | 13 | Interpolated y |
| m | 2 | Slope between points |
Formula Used
t = (x − x₁) / (x₂ − x₁)
y = y₁ + t (y₂ − y₁)
x = x₁ + t (x₂ − x₁)
y(t) = y₁ + t (y₂ − y₁)
How to Use This Calculator
- Enter the two known points: (x₁, y₁) and (x₂, y₂).
- Select a mode: find y at x, find x at y, or compute a point at t.
- Fill the matching input (x, y, or t). You can leave others blank.
- Choose decimals and how many table points you want.
- Press Calculate. Results appear above the form.
- Use Download CSV or Download PDF to export.
1) Overview of two-point interpolation
Linear interpolation estimates an unknown value between two measured points. If you know (x₁, y₁) and (x₂, y₂), the calculator assumes the change is straight and constant. This is common in calibration tables, sensor scaling, and quick engineering estimates.
2) Slope and line equation
The core rate is the slope m = Δy/Δx. For the default example (2, 5) and (10, 21), Δx = 8 and Δy = 16, so m = 2. The calculator also reports the line form y = mx + b, where b = y₁ − m x₁ = 1.
3) Finding y at a chosen x
To find y at a given x, it computes the interpolation factor t = (x − x₁)/(x₂ − x₁). With x = 6, t = 0.5, meaning you are halfway along the segment, and y = y₁ + tΔy = 13. The same t drives the generated table. The table uses evenly spaced t values: 0, 0.1, …, 1 when you choose 11 points. Increasing points gives smoother intermediate values without changing the endpoints. Many workflows use this to build lookup tables for spreadsheets, PLCs, or plotting. Always confirm units for x and y so the slope has meaningful physical interpretation. If your data is noisy, consider averaging before interpolating for stability.
4) Solving for x when y is known
You can also invert the process and find x at a given y. This uses t = (y − y₁)/(y₂ − y₁) and then x = x₁ + tΔx. This is useful when a target output is known, such as a required temperature, voltage, or concentration level.
5) Handling special cases safely
Edge cases are handled carefully. If x₁ equals x₂, the line is vertical and y-at-x is impossible. If y₁ equals y₂, the line is horizontal and x-at-y is impossible. The calculator flags these conditions instead of returning misleading numbers.
6) Interpolation versus extrapolation
Interpolation is intended for inputs inside the endpoint range. When x or y is outside that range, you are extrapolating. This tool lets you block extrapolation for safety, or enable it when you intentionally project trends beyond the known segment.
7) Precision, tables, and exports
Precision options matter. Choose decimals from 0 to 10 to match your reporting needs, and set table points from 2 to 200 to control resolution. After calculating, you can export a clean CSV or a compact PDF report for sharing or record keeping.
What is linear interpolation in this tool?
Linear interpolation estimates a value on the straight line joining two points. The calculator assumes a constant rate of change between (x₁, y₁) and (x₂, y₂), then returns y at x, x at y, or a point at parameter t.
What does the interpolation factor t mean?
t measures position along the segment. t = 0 gives point 1, t = 1 gives point 2, and t = 0.5 is the midpoint. Values outside 0–1 indicate extrapolation beyond the endpoints.
Why can’t I compute y when x₁ equals x₂?
If x₁ equals x₂, the line is vertical and there is no single y for a given x on that segment. The calculator blocks y-at-x in this case to avoid undefined division by zero in Δy/Δx.
When should I enable extrapolation?
Enable extrapolation only when you intentionally project beyond the known range and the trend is reasonable. For safety, keep it off when values must stay within a calibrated interval, such as sensor limits or specification tables.
How is the generated table created?
The table samples evenly spaced t values from 0 to 1, then computes x(t) and y(t). Increasing the number of points improves resolution but does not change the endpoints or the underlying line equation.
How do the CSV and PDF exports work?
After you calculate, the page stores the latest results in your session. The export buttons download the same summary and table as a CSV file or a compact one‑page PDF, ready for sharing or saving.