Linear Interpolation Calculator

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free linear interpolation calculator. Enter two known points and an x value to find y in between, or beyond, with the slope and formula shown.

Slope
0
Position between the points
0

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the linear interpolation calculator

  1. Enter the first known point as x₁ and y₁.
  2. Enter the second known point as x₂ and y₂.
  3. Enter the x value where you want to estimate y.

The linear interpolation calculator shows the estimated y, the slope of the line between the two points, and how far x lies between them as a percentage. If x is outside the two points, it warns you that the result is an extrapolation.

What is linear interpolation?

Linear interpolation estimates a value between two known points by assuming the change between them follows a straight line. If you know that a quantity is 50 when x is 10 and 80 when x is 20, linear interpolation estimates that it's 62 when x is 14, because 14 is 40% of the way from 10 to 20, and 40% of the way from 50 to 80 is 62.

It's one of the oldest and most widely used numerical methods. Before electronic calculators, people used it to read values between the rows of printed tables of logarithms, trigonometric functions and steam properties. It's still used every day in engineering, science, finance, data analysis and computer graphics.

The linear interpolation formula

y = y₁ + (x − x₁) × (y₂ − y₁) ÷ (x₂ − x₁)

The fraction (y₂ − y₁) ÷ (x₂ − x₁) is the slope of the line. Multiplying it by the distance from x₁ gives how much y has changed, which is added to y₁.

An equivalent way to write it uses the fraction t of the way from the first point to the second:

t = (x − x₁) ÷ (x₂ − x₁), then y = y₁ + t × (y₂ − y₁)

With the default values, t = (14 − 10) ÷ (20 − 10) = 0.4, and y = 50 + 0.4 × 30 = 62. The slope is 30 ÷ 10 = 3.

Interpolation and extrapolation

When x lies between x₁ and x₂, the method is interpolation. When x lies outside them, it's extrapolation: you're extending the straight line beyond the data. Extrapolation is much less reliable, because the real relationship may curve or change outside the range you've measured. The linear interpolation calculator still computes a result, but warns you so you can treat it with caution.

A worked example from a table

Engineering and science tables often list values at fixed intervals. Suppose a table gives a property of 0.0023 at 20 °C and 0.0032 at 25 °C, and you need it at 22 °C.

  1. Fraction of the way: t = (22 − 20) ÷ (25 − 20) = 0.4.
  2. Change in the property: 0.0032 − 0.0023 = 0.0009.
  3. Estimate: 0.0023 + 0.4 × 0.0009 = 0.00266.

Enter x₁ = 20, y₁ = 0.0023, x₂ = 25, y₂ = 0.0032 and x = 22 in the linear interpolation calculator to check.

A worked example over time

A statistic was 8.3 in 2020 and 9.1 in 2025. Estimate it for 2023.

  1. Fraction of the way: (2023 − 2020) ÷ (2025 − 2020) = 0.6.
  2. Estimate: 8.3 + 0.6 × (9.1 − 8.3) = 8.78.

This assumes the statistic changed steadily between the two years. If it grew faster at some times than others, the real figure could be different.

When linear interpolation works well

Linear interpolation gives good results when:

  • The two points are close together, so the true curve between them is nearly straight.
  • The relationship is close to linear, such as many physical properties over small ranges.
  • The data comes from a fine table, with small steps between rows.

It's less accurate when the relationship curves strongly between the points, such as exponential growth or decay over a long interval. In those cases, a curve through more points, or interpolating the logarithm of the values, may be better.

Who uses a linear interpolation calculator

Engineers use it to read values from steam tables, material property tables and design charts. Scientists use it to estimate measurements between calibration points. Finance professionals use it to estimate interest rates for maturities between those quoted on a yield curve. Data analysts use it to fill gaps in time series. Students use it in physics, chemistry and engineering courses.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. That is the whole job of DeepRit: a PPC-only agency that sets up and runs Google Ads accounts so every click is accounted for. You keep full ownership of your account, get a written report every week, and can stop at any time. See our pricing or ask for a free audit.

Interpolating in reverse

Sometimes you know y and need to find x. Because a straight line works both ways, you can swap the roles: enter the y values as x₁ and x₂, the x values as y₁ and y₂, and the known y as x. The linear interpolation calculator then gives the x value at which the line reaches that y. For example, with the default points, swapping gives the x at which y = 62: enter x₁ = 50, y₁ = 10, x₂ = 80, y₂ = 20 and x = 62, and the answer is 14.

Linear interpolation in spreadsheets and code

In a spreadsheet, the formula is easy to write directly: =y1 + (x − x1) * (y2 − y1) / (x2 − x1). Excel's FORECAST.LINEAR function fits a line through many points, which is regression rather than interpolation between two points. In programming, linear interpolation is often called lerp, written as lerp(a, b, t) = a + t × (b − a). Game developers and animators use it constantly to blend positions, colours and other values smoothly between two states.

Bilinear interpolation

When a value depends on two variables, such as a table with temperature along the rows and pressure along the columns, you can interpolate in both directions. This is called bilinear interpolation. First interpolate along one direction for each of the two neighbouring rows, then interpolate between those two results along the other direction. You can do it with the linear interpolation calculator by running it three times. The same idea is used to resize digital images smoothly.

Interpolating yields and rates

In finance, interest rates are often quoted only for certain maturities, such as 1, 2, 5 and 10 years. To estimate a rate for 3 years, you can linearly interpolate between the 2-year and 5-year rates. If the 2-year rate is 4.0% and the 5-year rate is 4.6%, the estimated 3-year rate is 4.0% + (1 ÷ 3) × 0.6% = 4.2%. More sophisticated methods fit smooth curves through all the points, but linear interpolation is common for quick estimates.

Checking your answer

A simple sanity check is that an interpolated y must lie between y₁ and y₂. If your answer is outside that range, either x is outside the two points or something was entered wrongly. Also check the direction: if y increases from the first point to the second, the slope must be positive.

Common mistakes

  • Swapping x₂ and y₁, or mixing up which values belong to which point.
  • Extrapolating far beyond the data and trusting the result.
  • Using points that are too far apart on a strongly curved relationship.
  • Interpolating between rows that use different units.

Interpolating percentages and money

Linear interpolation is often used for tax bands, pricing tiers and commission scales that change gradually between two thresholds. For example, if a discount rises steadily from 5% on orders of 1,000 to 10% on orders of 5,000, the discount on an order of 2,500 is 5% + (1,500 ÷ 4,000) × 5% = 6.875%. Enter x₁ = 1,000, y₁ = 5, x₂ = 5,000, y₂ = 10 and x = 2,500 in the linear interpolation calculator to check. Many contracts and policies describe this kind of sliding scale as "pro rata" or "on a straight-line basis", which is linear interpolation by another name.

Interpolating on a log scale

Some quantities change by a constant percentage rather than a constant amount, such as population growth, radioactive decay or compound interest. Straight-line interpolation between two values of such a quantity overestimates the values in between, because the true curve bends. A better approach is to interpolate the logarithm of the values and then convert back. For example, between 100 and 400 halfway along, straight-line interpolation gives 250, but interpolating the logarithms gives 200, which is correct if the quantity doubled at a constant rate across each half of the interval. For short intervals or gentle growth, the difference is small, and the linear interpolation calculator gives a good estimate.

Sources and further reading

Frequently asked questions

What is the linear interpolation formula?

y = y₁ + (x − x₁) × (y₂ − y₁) ÷ (x₂ − x₁).

What is the difference between interpolation and extrapolation?

Interpolation estimates a value between two known points; extrapolation estimates beyond them and is less reliable.

How accurate is linear interpolation?

It's accurate when the points are close and the relationship is nearly straight between them, and less so over strongly curved data.

Can I find x from a known y?

Yes. Swap the x and y values of both points and enter the known y as x.

What does the slope tell me?

How much y changes for each one-unit increase in x.

Is the linear interpolation calculator free?

Yes. It's free, needs no sign-up, and works in your browser.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep