Linear Interpolation Calculator

Find an intermediate value on a straight line between two known points. Solve for an interpolated y at x, or interpolated x at y.

Configuration

Choose which value you want to interpolate.

Known Points

Enter the two points that define the straight line.

Target Value

Enter the known value at the point you’re interpolating.

Result

Practical Guide

Linear Interpolation Calculator

A clear, engineering-first walkthrough of linear interpolation: what the calculator is doing, how to use it safely, and how to interpret results for design, analysis, and everyday problem solving.

6–8 min read Updated 2025

Quick Start

Linear interpolation assumes the relationship between two known points is a straight line. This calculator automates the algebra and keeps your inputs organized. Use it like this:

  1. 1 Enter your two known points: \((x_1, y_1)\) and \((x_2, y_2)\).
  2. 2 Choose Solve For: either interpolate \(y\) at a target \(x\), or interpolate \(x\) at a target \(y\).
  3. 3 The calculator will hide the row for the variable you are solving for. Confirm you’re filling in the remaining visible “given” values.
  4. 4 Enter the target value: \(x\) (if solving for \(y\)) or \(y\) (if solving for \(x\)).
  5. 5 Check that your known points bracket the target. If the target lies outside \([x_1, x_2]\) (or \([y_1,y_2]\)), you’re extrapolating.
  6. 6 Read the result and Quick Stats. Verify the slope sign and magnitude are reasonable for your context.
  7. 7 Toggle Show Steps to see the exact substituted numbers and equations used.

Tip: Sort inputs so \(x_1 \ne x_2\). If \(x_1 = x_2\), the line is vertical and \(y\) is not uniquely defined for a given \(x\).

Biggest mistake: Mixing units between points (e.g., one point in seconds and another in minutes). Convert first.

Choosing Your Method

“Linear interpolation” gets used in a few slightly different ways in engineering. The calculator implements the standard two-point straight-line approach, but it’s useful to understand the common alternatives and when they’re appropriate.

Method A — Two-Point Line Equation (Default)

This is the classic approach: assume a straight line between two known points and solve directly.

  • Fast and transparent; easiest to audit.
  • Exactly matches many code/handbook interpolations.
  • Works for interpolate-\(y\) and interpolate-\(x\).
  • Only valid if the true relationship is close to linear across the interval.
  • Sensitive to noisy points if the interval is small.
\[ y = y_1 + \frac{(y_2-y_1)(x-x_1)}{(x_2-x_1)} \]

Method B — Normalized Parameter \(t\)

Instead of solving directly for \(y\), compute a fractional position along the interval: \[ t=\frac{x-x_1}{x_2-x_1} \] then blend the outputs: \[ y=(1-t)y_1 + ty_2. \]

  • Great for repeated interpolations on the same interval (same \(x_1,x_2\)).
  • More intuitive for “percentage along a line” problems.
  • Still assumes linearity; just a different form.
  • Requires care when extrapolating (\(t<0\) or \(t>1\)).
\[ y=y_1 + t(y_2-y_1) \]

Method C — Piecewise/Table Interpolation

If you have multiple tabulated points (e.g., material properties vs temperature), the engineering standard is to interpolate between the two points surrounding your target. This calculator can still be used—just pick the bracketing pair first.

  • Matches how most design tables are meant to be read.
  • Reduces error compared with forcing a single line over a wide range.
  • You must choose the correct bracketing interval.
  • If tables are curved, linear segments can under/overestimate.
“Pick adjacent rows → interpolate.”

What Moves the Number

Linear interpolation is simple, but a few variables strongly control results and error. These are the levers to think about before trusting the output.

Spacing between known points

The wider the interval, the more likely the true relationship is curved. Narrow bracketing generally reduces interpolation error.

Slope magnitude

A steep slope \(\left(m=\frac{y_2-y_1}{x_2-x_1}\right)\) amplifies small input uncertainty. If your points are noisy, the output will be too.

Target inside vs outside interval

Interpolation (inside) is usually safe; extrapolation (outside) can be badly wrong if the trend changes.

Ordering and units

The math only cares about differences, but you do. Mixed units or swapped coordinates are the most common human error.

Vertical or horizontal special cases

If \(x_1=x_2\), the line is vertical and \(y\) is not unique for a given \(x\). If \(y_1=y_2\), the line is horizontal; solving for \(x\) gives many possible solutions when \(y=y_1\).

Physical realism

Always sanity-check against the real system: monotonic behavior, bounds, and known asymptotes.

Worked Examples

Below are fully worked problems matching typical engineering use. You can follow the same steps with the calculator, then verify the result by hand.

Example 1 — Interpolate \(y\) at a Known \(x\)

  • Known point 1: \((x_1, y_1) = (2.0,\; 5.0)\)
  • Known point 2: \((x_2, y_2) = (8.0,\; 17.0)\)
  • Target: \(x = 5.0\)
  • Solve for: Interpolated \(y\)
1
Compute slope: \[ m=\frac{y_2-y_1}{x_2-x_1}=\frac{17-5}{8-2}=\frac{12}{6}=2. \]
2
Apply interpolation: \[ y = y_1 + m(x-x_1)=5 + 2(5-2)=5+6=11. \]

Result: \(y=11\). The value lies between \(y_1=5\) and \(y_2=17\), which fits expectations because \(x\) is between 2 and 8.

Example 2 — Interpolate \(x\) at a Known \(y\)

  • Known point 1: \((x_1, y_1) = (10,\; 100)\)
  • Known point 2: \((x_2, y_2) = (40,\; 160)\)
  • Target: \(y = 130\)
  • Solve for: Interpolated \(x\)
1
Compute slope: \[ m=\frac{160-100}{40-10}=\frac{60}{30}=2. \]
2
Rearrange for \(x\): \[ x = x_1 + \frac{y-y_1}{m} = 10 + \frac{130-100}{2} = 10 + 15 = 25. \]

Result: \(x=25\). Since \(y=130\) is midway between 100 and 160, \(x\) should be midway between 10 and 40—so 25 checks out.

Common Layouts & Variations

Linear interpolation shows up everywhere. The calculator’s inputs map cleanly to these real-world setups. Use this table to orient your problem type and expectations.

Use Case / ConfigurationWhat \((x, y)\) RepresentWhen Linear Works WellWatch Outs
Material properties from design tables\(x\)=temperature, \(y\)=property (E, k, μ, etc.)Adjacent rows with small ΔTStrongly nonlinear regions (phase changes)
Station–elevation profiles\(x\)=station, \(y\)=elevationShort segments between surveyed pointsSharp grade breaks; use more points
Calibration curves\(x\)=sensor reading, \(y\)=true valueLocally linear calibration intervalsHysteresis and drift
Time-series filling\(x\)=time, \(y\)=measured variableSmooth trends over short gapsStep changes or cyclic signals
Load–deflection checks\(x\)=load, \(y\)=deflection (or vice-versa)Elastic range, small incrementsYielding/nonlinear stiffness
Cost or quantity estimates\(x\)=size, \(y\)=cost/quantityNarrow range between known quotesEconomies of scale (curvature)

If your application looks like one of the “watch out” cases, linear interpolation still has value as a first pass, but consider a nonlinear fit or smaller intervals.

Specs, Logistics & Sanity Checks

Think of this section as your “engineering QA” before you ship a number into a report, spreadsheet, or design decision.

Assumptions Built In

  • The relationship between points is linear over the interval.
  • Both points are accurate and represent the same physical system.
  • No discontinuities exist between \(x_1\) and \(x_2\).

Field / Data Checks

  • Confirm units are consistent across all values.
  • Verify your target is within bounds for interpolation.
  • Check sign conventions (positive direction, datum, etc.).
  • Use adjacent bracketing points for table lookups.

Sanity Testing

  • The result should fall between endpoints when interpolating.
  • Slope direction should match the trend you expect.
  • If you double the interval spacing, error risk rises—tighten it.
  • Cross-check with a sketch of the two points and target.

Design codes and tables: Many standards expect linear interpolation between rows unless stated otherwise. Do not use a curved fit unless the code allows it.

Safety note: If the interpolated value governs capacity or safety (e.g., allowable stress), build in the conservative direction if uncertainty exists.

Frequently Asked Questions

What is linear interpolation?
Linear interpolation estimates an intermediate value by assuming a straight-line relationship between two known points. Given \((x_1,y_1)\) and \((x_2,y_2)\), the interpolated value at \(x\) is \[ y = y_1 + \frac{(y_2-y_1)(x-x_1)}{x_2-x_1}. \]
When is it okay to extrapolate instead of interpolate?
Extrapolation means your target lies outside the known interval. It can be acceptable for short distances when you know the trend remains linear, but it is riskier because real systems often curve or change regime. If the stakes are high, use more data or a model that matches the physics.
What happens if x₁ equals x₂?
If \(x_1=x_2\), the line is vertical. You cannot uniquely compute \(y\) for a given \(x\) (many \(y\) values share the same \(x\)). If you solve for \(x\) at a given \(y\), then \(x\) is constant and equals \(x_1\).
Why does the calculator hide one input row?
To prevent accidental double-entry. The hidden row is the variable being solved for, so only known values remain editable. This reduces mistakes and ensures the equations shown match your selection.
How accurate is linear interpolation?
Accuracy depends on how linear the true relationship is over your interval and how far apart the points are. If the underlying curve is smooth but curved, error grows with interval width. Tight bracketing typically yields good results.
Can I use this for multiple points or a full table?
Yes—choose the two adjacent points that bracket your target and run the calculator on that pair. This matches the standard “piecewise linear” assumption used in many engineering tables.
What if my data isn’t monotonic?
Linear interpolation still works mathematically, but interpretation can be tricky if the variable reverses direction. In that case, interpolate only within intervals that are locally monotonic, or use a more appropriate curve fit.
Scroll to Top