Skip to main content
Skip to calculator
Advertisement

Last updated: July 31, 2026

Linear Interpolation Calculator

Helpful
Not helpful
Save as image
Share
Embed
Cite
Write feedback

Formula

y = y0 + (x - x0) × (y1 - y0) / (x1 - x0), t = ((x - x0) / (x1 - x0)) × 100%

Where:

  • x₀=First known x-value
  • y₀=Output at x₀
  • x₁=Second known x-value
  • y₁=Output at x₁
  • x=Target x-value
  • y=Interpolated output
  • t=Interpolation position as a percentage
(x₀, y₀)(x₁, y₁)(x, y)

Worked Examples

Estimate between two rising points

Use two known points on a line to estimate an interior value.

  1. 1Compute the slope: (50 - 10) / (20 - 0) = 2
  2. 2Measure the horizontal change: 5 - 0 = 5
  3. 3Add the change to y₀: 10 + 5 × 2 = 20
  4. 4Compute t = (5 / 20) × 100 = 25%
Final Answer: y = 20 and t = 25%

Decimal interpolation

Linear interpolation also works cleanly with decimal coordinates.

  1. 1Slope = (20 - 4) / (6 - 2) = 4
  2. 2Horizontal shift = 3.5 - 2 = 1.5
  3. 3Interpolated y = 4 + 1.5 × 4 = 10
  4. 4t = (1.5 / 4) × 100 = 37.5%
Final Answer: y = 10 and t = 37.5%

Extrapolation beyond the second point

If x falls outside the interval, the same line formula produces an extrapolated result.

  1. 1Slope = (30 - 0) / (10 - 0) = 3
  2. 2Horizontal shift = 12 - 0 = 12
  3. 3Interpolated/extrapolated y = 0 + 12 × 3 = 36
  4. 4t = (12 / 10) × 100 = 120%
Final Answer: y = 36 and t = 120%

Invalid when x₀ equals x₁

The formula is undefined if both known points share the same x-coordinate.

  1. 1Check the denominator x₁ - x₀
  2. 2Here the denominator is 5 - 5 = 0
  3. 3Division by zero makes the interpolation undefined
  4. 4Choose two points with different x-values
Final Answer: Error: x0 and x1 must be different

Introduction

The Linear Interpolation Calculator estimates a y-value on the straight line passing through two known points. It is useful when you know measurements, prices, temperatures, or engineering values at two x-locations and need a quick estimate in between. The calculator also shows the interpolation factor as a percentage, so you can see exactly where the target x sits relative to the original interval.

What Linear Interpolation Does

Linear interpolation assumes the change between two known points is straight and uniform. That makes it one of the fastest and most transparent estimation tools in algebra, spreadsheets, chart reading, and engineering approximations.

  • Uses exactly two known points

  • Builds the straight-line equation between them

  • Estimates y for any target x-value

  • Reports position within the interval as a percentage

  • Can also extend outside the interval for extrapolation

Interpolation is usually most reliable when x lies between x₀ and x₁.

Formula Breakdown

The interpolation formula starts with y₀, then adds the horizontal change scaled by the slope between the two points. The factor t measures the relative horizontal position and turns that proportion into a percentage.

  • Slope = (y₁ - y₀) / (x₁ - x₀)

  • Horizontal change = x - x₀

  • Scaled rise = (x - x₀) × slope

  • Interpolated output = y₀ + scaled rise

  • t = 0% at x₀ and t = 100% at x₁

How to Use This Calculator

Enter the two known points and then enter the target x where you want the estimate. The calculator instantly returns the interpolated y and the factor t so you can verify whether the target is inside the original range or outside it.

  • Enter x₀ and y₀ for the first point

  • Enter x₁ and y₁ for the second point

  • Enter the target x-value

  • Read the computed y-value

  • Check t to understand the relative position

Understanding the Percentage Factor

The t output is more than a helper value. It tells you where the target x lies on the line segment when measured from x₀ toward x₁, which is especially helpful in reporting, calibration, and quality-control workflows.

  • 0% means x equals x₀

  • 50% means x is halfway between x₀ and x₁

  • 100% means x equals x₁

  • Negative values mean x lies before x₀

  • Values above 100% mean extrapolation beyond x₁

Validation Rules

Interpolation only works when every input is a finite number and the denominator is not zero. If x₀ and x₁ are equal, the line would be vertical, so the formula for y as a function of x is undefined.

  • All five inputs must be numeric and finite

  • x₀ and x₁ must be different

  • Decimal and negative values are allowed

  • The method supports interpolation and extrapolation

  • Undefined cases return a clear error message

A vertical line cannot be expressed with the given y(x) formula.

Common Mistakes to Avoid

Most wrong answers come from swapping coordinates, using inconsistent units, or treating nonlinear data as if it were linear. A quick check of the slope and the t value usually catches these issues early.

  • Swapping x-values and y-values

  • Using x-values with different units

  • Assuming curved data is linear

  • Ignoring that t above 100% is extrapolation

  • Forgetting to verify x₁ - x₀ before calculating

Practical Applications

Linear interpolation appears anywhere people estimate a value between two measured points. It is common in finance, sensor calibration, property tables, statistics, digital graphics, and scientific tables.

  • Estimating values from charts or lookup tables

  • Interpolating temperatures or pressures

  • Approximating prices between breakpoints

  • Calibrating instruments from test data

  • Checking spreadsheet or code outputs quickly

FAQs

What is linear interpolation?

It is a method for estimating a value between two known points by assuming the relationship between them is a straight line.

What does the t output mean?

t shows how far the target x lies between x₀ and x₁ as a percentage. For example, 25% means the point is one quarter of the way from x₀ to x₁.

Can the calculator handle extrapolation?

Yes. If x is outside the interval [x₀, x₁], the same straight-line formula still works and t will fall below 0% or above 100%.

Why must x₀ and x₁ be different?

Because the denominator x₁ - x₀ appears in the formula. If both x-values are equal, the calculation would divide by zero.

Can I use negative or decimal numbers?

Yes. Any finite numbers are allowed as long as x₀ and x₁ are not the same.

Is interpolation always accurate?

It is accurate when the relationship between the two points is approximately linear over the interval. If the data curves strongly, the estimate may be less reliable.

What is the difference between interpolation and extrapolation?

Interpolation estimates within the known interval, while extrapolation estimates beyond it. Extrapolation usually carries more uncertainty.