📉 Linear Regression Calculator

Fit a straight line to paired data by least squares, see slope, intercept and R², chart the fit and predict Y for any X.

Also known as: Line of Best Fit · Least Squares · Regression Equation · Trend Line

Loading calculator…

How to use the Linear Regression Calculator

  1. Enter your values in the fields above — the defaults show a worked example.
  2. The result updates instantly as you type; change any input to compare scenarios.
  3. Copy or share the result, or open a related calculator below.

How it's calculated

b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)²; a = ȳ − b·x̄.

Frequently asked questions

What does R² mean?
The fraction of the variation in Y explained by the line — 1 means a perfect fit.
Is the Linear Regression Calculator free?
Yes. The Linear Regression Calculator on CalculatorSprint is completely free with no sign-up. Every calculation runs in your browser, so the numbers you enter are never sent to our servers.
How accurate is the Linear Regression Calculator?
It uses the method described under “How it’s calculated” and keeps full precision internally, rounding only the displayed result.
Can I use the Linear Regression Calculator on my phone or offline?
Yes. It works on any phone, tablet or computer. Install CalculatorSprint as an app from your browser menu (Add to Home Screen or Install app) and it keeps working offline.

Read more about the Linear Regression Calculator

When to use the Linear Regression Calculator

Use the Linear Regression Calculator for least-squares line of best fit ŷ = a + bx with R², standard error and predictions. It is one of 18 free statistics & probability calculators, and pairs well with the Correlation Coefficient Calculator, Slope Calculator, Mean, Median, Mode Calculator and Descriptive Statistics Calculator.

Tips for accurate results

Check that your input uses the expected format (decimals, fractions or one value per line), keep full precision until the final step, and use the worked formula below the result to verify the answer by hand or for homework.

Was this helpful?

More Statistics & Probability Calculators

See all Statistics & Probability Calculators →

Popular calculators

Results are estimates for information only. Calculations run privately in your browser.