Linear Interpolation Calculator

Compute an interpolated value y at a target x between two known points (x0, y0) and (x1, y1).

Lower x value.
Value of y at x0.
Upper x value.
Value of y at x1.
Point between x0 and x1 where you want y.
Type a expression using variables x, x0, x1, y0, y1. The exact formula with your numbers substituted will appear in the results. Use the pad below to insert quickly.
Use the pad to insert variables/operators at the cursor in the Equation textarea.

Result

This is the interpolated y-value at your chosen x.

Exact Formula (with values)

Rendered and simplified representations are shown below.

Calculation Steps

    What is a Linear Interpolation Calculator?

    A Linear Interpolation Calculator computes an intermediate value of a function that lies between two known data points by assuming the function behaves approximately like a straight line in that interval. If \((x_0,y_0)\) and \((x_1,y_1)\) are known with \(x_0\neq x_1\), and you need \(y\) at some \(x\) where \(x_0\le x\le x_1\), linear interpolation connects the points by a chord and reads the corresponding value on that line. This technique is widely used in engineering tables, physics experiments, finance yield curves, thermodynamic properties, and computer graphics, offering a fast, transparent approximation that is easy to audit and explain.

    $$\textbf{Point–slope form:}\quad y = y_0 + \frac{y_1 - y_0}{x_1 - x_0}\,(x - x_0),\qquad x\in[x_0,x_1].$$

    About the Linear Interpolation Calculator

    The calculator takes two anchor points and returns the interpolated value (or, inversely, the abscissa corresponding to a target ordinate). It also reports the segment slope and can extend to piecewise interpolation when multiple tabulated points are supplied by selecting the bracketing interval. Internally, the core computation is a simple affine combination:

    $$\lambda=\frac{x - x_0}{x_1 - x_0},\qquad y=(1-\lambda)\,y_0+\lambda\,y_1.$$

    For inverse interpolation (find \(x\) given \(y\)), the calculator rearranges the same relationship:

    $$x = x_0 + \frac{y - y_0}{y_1 - y_0}\,(x_1 - x_0).$$

    When embedded in a live page, formulas render responsively with MathJax, and numerical steps can be performed precisely with math.js while preserving the same formulas you see here.

    How to Use this Linear Interpolation Calculator

    1. Enter two known points \((x_0,y_0)\) and \((x_1,y_1)\) with \(x_0\neq x_1\).
    2. Choose your mode:
      • Forward: supply \(x\) to compute \(y\) with \(y = y_0 + \dfrac{y_1-y_0}{x_1-x_0}(x-x_0)\).
      • Inverse: supply \(y\) to compute \(x\) with \(x = x_0 + \dfrac{y-y_0}{y_1-y_0}(x_1-x_0)\).
    3. If you have a table, select the two adjacent points bracketing your query (piecewise linear interpolation).
    4. Review slope, ratio \(\lambda\), and the interpolated result.

    Examples (using the same formulas)

    Example 1 (forward): \((x_0,y_0)=(10,100)\), \((x_1,y_1)=(20,160)\), find \(y\) at \(x=14\).
    \(\lambda=\dfrac{14-10}{20-10}=0.4,\ \ y=(1-0.4)\cdot 100+0.4\cdot 160=124.\)

    Example 2 (inverse): \((x_0,y_0)=(2,5)\), \((x_1,y_1)=(6,17)\), find \(x\) for \(y=11\).
    \(x=2+\dfrac{11-5}{17-5}\,(6-2)=2+\dfrac{6}{12}\cdot 4=4.\)

    Example 3 (piecewise): Table: \((0,0)\), \((3,12)\), \((8,20)\). For \(x=5\), bracket with \((3,12)\) and \((8,20)\):
    \(y=12+\dfrac{20-12}{8-3}(5-3)=12+\dfrac{8}{5}\cdot 2=15.2.\)

    FAQs

    Q1: What is the difference between interpolation and extrapolation?
    Interpolation estimates within known data bounds; extrapolation predicts outside the range and is typically less reliable.

    Q2: Does linear interpolation preserve curvature?
    No. It assumes a straight line between points. For curved behavior, consider spline or polynomial interpolation.

    Q3: How accurate is linear interpolation?
    Accuracy is high for small intervals or nearly linear segments; error grows with nonlinearity and wider spacing.

    Q4: Can I interpolate from unevenly spaced data?
    Yes. Choose the two nearest points surrounding your query value; spacing need not be uniform.

    Q5: Will the calculator handle units?
    Yes, as long as inputs share consistent units (e.g., all times in seconds). The linear formula remains the same.

    More Math & Algebra Calculators