Linear Interpolation Calculator - Proportion-Based y From Two Points

Use this linear interpolation calculator to estimate y at any target x between two known (x, y) points, with slope and t-fraction shown for each entry.

Updated: June 16, 2026 • Free Tool

Linear Interpolation Calculator

x-coordinate of the first known point (x1, y1).

y-coordinate of the first known point (x1, y1).

x-coordinate of the second known point (x2, y2). Must differ from x1.

y-coordinate of the second known point (x2, y2).

Target x-coordinate where the interpolated y is needed. Any real number is allowed; values outside [x1, x2] extrapolate.

Results

Interpolated y
0
Slope m = (y2 - y1) / (x2 - x1) 0
Position fraction t = (x - x1) / (x2 - x1) 0
x - x1 0
(y2 - y1) 0
t-symmetry check (t + (1 - t)) 0

What Is the Linear Interpolation Calculator?

A linear interpolation calculator estimates the missing y at any target x between two known (x, y) points by drawing a straight line through the two points and reading off the y at the target x. The same routine fills gaps in tables, looks up values between known entries, and steps through time-series data one segment at a time. It is the one-dimensional cousin of bilinear interpolation, which extends the same idea to a 2D rectangle.

  • Fill missing data in a table: Pull the y for an x that sits between two tabulated values when the table is monotonic.
  • Look up values in a chart: Estimate the y for a target x that falls between two known axis points when the chart is too coarse to read.
  • Rescale a measurement grid: Convert measurements on a coarse grid to a finer grid using each pair of coarse samples as endpoints of a line.
  • Verify textbook examples: Check the algebra of homework and exam problems that ask for a missing y from two known points and a single proportion.

Linear interpolation is the simplest member of the interpolation family: it assumes the unknown function is a straight line between the two known points.

Use it whenever you have a clean pair of endpoints, the function is roughly linear on the interval, and you only need one value at one target x.

When the two endpoints come from (x, y) coordinates and you also need the geometric distance between them, the 2D Distance Calculator gives the matching line length on the same coordinate plane.

How the Linear Interpolation Formula Works

The linear interpolation formula reads off the y at the target x on the straight line through the two known points (x1, y1) and (x2, y2). It computes the slope m = (y2 - y1) / (x2 - x1) once, scales that slope by the horizontal distance (x - x1), and adds the result to y1. The position fraction t = (x - x1) / (x2 - x1) gives the same answer in proportion form: y = y1 * (1 - t) + y2 * t.

y = y1 + (x - x1) * (y2 - y1) / (x2 - x1)
  • x1, y1: x and y of the first known point. The two endpoints define the line.
  • x2, y2: x and y of the second known point. Must have x different from x1 or the slope is undefined.
  • x: Target x where the interpolated y is needed. Values outside [x1, x2] extrapolate.
  • y: Interpolated y at the target x. Equals y1 at x1, equals y2 at x2, scales linearly in between.

The slope form y = y1 + m * (x - x1) is the spreadsheet-friendly version. The proportion form y = y1 * (1 - t) + y2 * t is the textbook version because it shows y as a weighted average of the two endpoint y-values.

When the two y-values are equal, the slope is 0 and the formula returns that same y for every x. When x equals x1 or x2, the formula returns y1 or y2 exactly.

Worked example (endpoints (0, 0) and (10, 20), target x = 5)

x1=0, y1=0, x2=10, y2=20, target x=5

Slope m = (20 - 0) / (10 - 0) = 2. Position fraction t = (5 - 0) / (10 - 0) = 0.5. So y = 0 + 2 * (5 - 0) = 10, the midpoint between 0 and 20.

y = 10

This matches the standard midpoint result exactly and confirms the calculator's algebra.

According to Wikipedia - Linear interpolation, the linear interpolation of a function between two known points (x1, y1) and (x2, y2) at a target x is y = y1 + (x - x1) * (y2 - y1) / (x2 - x1), which is the equation of the straight line through the two endpoints read off at x.

Because the formula is the equation of a line, the Slope Percentage Calculator takes the same (y2 - y1) / (x2 - x1) slope and converts it to a rise-over-run percentage for grade or pitch work.

Key Concepts Behind Linear Interpolation

Four ideas make the result straightforward to read and verify.

Straight-line assumption

Linear interpolation assumes the unknown function is a straight line between the two endpoints and never tries to model curvature.

Slope m and position fraction t

The slope m is the rise-over-run on the segment, and t is how far the target x has traveled from x1 toward x2.

Weighted average form

Rearranging the formula gives y = y1 * (1 - t) + y2 * t, a weighted average of the two endpoint y-values with weights that sum to 1.

Interpolation vs extrapolation

When t is in the 0..1 range the target x sits between the two known points. When t is outside that range, you are extrapolating past the data.

These four concepts line up with the calculator's output panel: the slope, the position fraction, and the t-symmetry check are the diagnostic numbers that confirm the algebra.

The same weighted-average view is what makes linear interpolation safe to chain across a long table: each segment has its own slope and its own t, and the result inside that segment is a convex combination of the two endpoint y-values.

Because the position fraction t is just a ratio of the form (x - x1) : (x2 - x1), the Ratio Calculator can reduce the same proportion to its lowest terms and surface the matching scaling factor.

How to Use This Linear Interpolation Calculator

Five quick steps take you from two known (x, y) points to a verified interpolated estimate.

  1. 1 Enter the first known point: Type x1 and y1 for the first endpoint. This anchors the left side of the segment.
  2. 2 Enter the second known point: Type x2 and y2 for the other endpoint. x2 must differ from x1 or the calculator will show a divide-by-zero error.
  3. 3 Enter the target x: Type the x where you want the interpolated y. Values outside [x1, x2] extrapolate and t will fall outside the 0..1 range.
  4. 4 Read the result and diagnostics: Check the interpolated y, the slope m, the position fraction t, and the t-symmetry check. The symmetry check is always exactly 1.000000 whenever x2 != x1.
  5. 5 Iterate with new endpoints or target: Change any input to update the result on the fly. The position fraction t is the cleanest signal of whether the target is inside the segment.

Try the Wikipedia midpoint example: x1=0, y1=0, x2=10, y2=20, target x=5. The calculator returns y=10 with slope 2, t=0.5, and the t-symmetry check at 1.000000.

If you also want the geometric length of the line between (x1, y1) and (x2, y2) so you can place the interpolation on a sketch, the Length of a Line Segment Calculator returns that hypotenuse length in the same units as your x and y.

Benefits of Using This Linear Interpolation Calculator

Six practical reasons to use this calculator instead of recomputing the proportion by hand.

  • Get the answer in seconds: Skip the handwritten algebra; the calculator applies the closed-form proportion on every keystroke.
  • See the slope and position fraction: The slope m and position fraction t are shown next to y so you can see how the value is built from the two endpoints.
  • Catch divide-by-zero early: Validation stops the calculation when x2 equals x1, so you never see a NaN result from a vertical-line input.
  • Free sanity check with the t-symmetry sum: The t-symmetry check is always exactly 1.000000 whenever x2 != x1, giving a free sanity check that the formula is wired up right.
  • Handle interpolation and extrapolation together: The same calculator returns a clean result when the target x is inside the segment (t in 0..1) and when it is outside (t outside 0..1).
  • Chain segments across a long table: Walk a piecewise-linear path through a table of measurements, with each segment contributing its own slope and t.

These benefits turn the linear interpolation proportion into a one-line operation. Chain the calculator with the related tools to extend the result into slope percentages, line-segment geometry, and best-fit lines.

Watching the position fraction t is the right way to tell whether a target is inside the segment: t in the 0..1 range is an interpolation, t outside that range is an extrapolation.

When the table is too noisy for a single segment and you want a best-fit line through many points instead of a strict pass-through, the Linear Regression Calculator fits that line by least squares and reports the matching slope and intercept.

Factors That Affect the Linear Interpolation Result

Five factors determine how reliable the result is.

Distance from the endpoints

The closer the target x is to x1 or x2, the more that endpoint pulls the result. Midpoint targets get equal weight from both.

Slope of the segment

Steep segments amplify any rounding error in x. Flat segments (y1 = y2) return the same y regardless of t, a free sanity check.

Smoothness of the underlying function

Linear interpolation assumes the unknown function is roughly linear. If the true function curves, the estimate can drift in the middle.

Position of the target x

Targets inside [x1, x2] give an interpolation with t in 0..1. Targets outside still return a value, but t falls outside 0..1 and you are extrapolating.

Precision of the input endpoints

Each input flows directly into the slope and the position fraction, so noisy endpoint values propagate into y.

  • Linear interpolation cannot follow curves. If the true function bends inside the segment, the linear estimate is only an approximation. Switch to a quadratic or cubic interpolant when curvature matters.
  • Linear interpolation is not the same as linear regression. The line is forced to pass through the two endpoints, so any measurement error in the endpoints goes straight into y.

These factors line up with the same limitations that show up in table lookups and time-series analysis. Linear interpolation is fast and stable, but it cannot recover the shape of a curve the way a higher-order interpolant can.

For a single missing data point on a roughly linear segment, linear interpolation is the right tool. For curves, fit a small model first. For noisy data, switch to linear regression.

According to Omni Calculator - Linear Interpolation, linear interpolation estimates the missing y by drawing a straight line between the two known points and reading off the y at the target x, which is the same as scaling the y-difference by the position fraction (x - x1) / (x2 - x1).

When the same straight-line pattern repeats across many evenly spaced x-values and you want the y at index n rather than at one target x, the Arithmetic Sequence Calculator gives the matching arithmetic-sequence term a + (n - 1) * d in one step.

Linear interpolation calculator - estimate y at any target x between two known (x, y) points with slope and t-fraction shown
Linear interpolation calculator - estimate y at any target x between two known (x, y) points with slope and t-fraction shown

Frequently Asked Questions

Q: What is linear interpolation?

A: Linear interpolation is a one-dimensional method that estimates the missing y at a target x between two known (x, y) points by drawing a straight line through the two endpoints and reading off the y at the target x. It assumes the unknown function is linear on the segment and never tries to model curvature.

Q: What is the formula for linear interpolation?

A: The closed-form formula is y = y1 + (x - x1) * (y2 - y1) / (x2 - x1). The same result can be written y = y1 * (1 - t) + y2 * t where t = (x - x1) / (x2 - x1), which is a weighted average of the two endpoint y-values with weights (1 - t) and t.

Q: How do you interpolate between two points?

A: Find the slope m = (y2 - y1) / (x2 - x1) of the line through the two points, then multiply that slope by the horizontal distance (x - x1) and add the result to y1. The result is the y-value on the line at the target x, and the slope-and-distance view matches the spreadsheet formula =y1 + SLOPE(range_y, range_x) * (x - x1).

Q: When should I use linear interpolation?

A: Use linear interpolation when the unknown function is roughly linear on the segment between the two known points, the two endpoints are trusted, and you only need one value at one target x. For curves, switch to a quadratic or cubic interpolant; for noisy data with many points, switch to linear regression.

Q: What is the difference between interpolation and extrapolation?

A: Interpolation is the case where the target x sits between the two known x-values, so the position fraction t is in the 0..1 range and the result is read off the line inside the segment. Extrapolation is the case where the target x is outside that range, t falls outside 0..1, and the result is a linear projection past the data.

Q: What are the limitations of linear interpolation?

A: Linear interpolation cannot follow curves, so it is only an approximation when the true function bends inside the segment. The line is forced to pass through the two endpoints, so any measurement error in the endpoints flows straight into the result. A best-fit line is more robust when the data is noisy.