Linear Regression Calculator — Line of Best Fit & Correlation
Use this free linear regression calculator to find the line of best fit for a set of data points. Paste your (x, y) pairs and you’ll get the least-squares equation y = mx + b, the correlation coefficient r and r², and a scatter plot with the line drawn through it.
How to use the calculator
- Enter your data, one x, y pair per line.
- Press Calculate.
- Read the best-fit equation, the correlation, and see the scatter plot with the fitted line.
How the line of best fit works
The least-squares method finds the slope and intercept that minimize the total squared vertical distance from the points to the line: m = Σ((x − x̄)(y − ȳ)) / Σ((x − x̄)²) and b = ȳ − m·x̄. The correlation r measures how closely the points follow that line.
Frequently asked questions
What is the line of best fit?
The straight line that minimizes the total squared vertical distance to your data points — the least-squares regression line y = mx + b.
What does the correlation coefficient r tell me?
How strongly the points follow a straight line: r near +1 or −1 means a strong linear relationship, while r near 0 means little or none.
What is r²?
The square of the correlation. It’s the fraction of the variation in y explained by the line — for example r² = 0.73 means about 73%.
Read the full lesson: learn the method step by step.
Related to This Article
More math articles
- How to Prepare for the PSAT 8/9 Math Test?
- Where to Find Reliable Gambling Site Rankings
- What Kind of Math Is on the CBEST Test?
- Oklahoma OSTP Grade 5 Math: 48 Free Single-Page Printables, One Skill Each, Answer Keys Included
- The Best Grade 7 ELA Practice Tests for Pennsylvania Students
- The Ultimate ParaPro Math Course (+FREE Worksheets & Tests)
- The Agency’s Math Problem: How to Balance Costs and Revenue on OnlyFans
- Getting a Math Degree: Hacks to Make Your Life Easier
- Free Grade 6 English Worksheets for Georgia Students
- Brain Training Apps and How They Help Increase Memory and Focus
























What people say about "Linear Regression Calculator — Line of Best Fit & Correlation - Effortless Math: We Help Students Learn to LOVE Mathematics"?
No one replied yet.