📉 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
- Enter your values in the fields above — the defaults show a worked example.
- The result updates instantly as you type; change any input to compare scenarios.
- 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?
Is the Linear Regression Calculator free?
How accurate is the Linear Regression Calculator?
Can I use the Linear Regression Calculator on my phone or 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.
More Statistics & Probability Calculators
Popular calculators
Results are estimates for information only. Calculations run privately in your browser.