Linear Regression Calculator - Best-Fit Line, Correlation r & R² With Scatter Plot
Linear Regression Calculator
Fit a straight line to your data and see how well it explains it
Line, Fit and Errors
Get the equation, correlation r, R² and the standard errors of the estimate, the slope and the intercept.
See the Fit
A scatter plot draws your points and the fitted line, so outliers and curves are obvious at a glance.
Predictions
Enter an x value to read off the predicted y from the fitted line.
Full Privacy
Your data never leaves your browser.
Reading the Results
Least-squares regression finds the line y = mx + b that makes the total of the squared vertical gaps to your points as small as possible. The slope m says how much y changes for each one-unit increase in x. The correlation r runs from −1 to 1, and R² is the share of the variation in y that the line explains: an R² of 0.6 means 60%.
Correlation is not causation, and a high R² does not prove a straight line is the right model: always look at the plot. Predicting far outside the range of your x values (extrapolation) is unreliable. The standard errors need at least three points; with only two points the line passes through both exactly.
Key Takeaways
- Flexible input: Spaces, tabs, commas or semicolons work; a header line is skipped.
- Clear errors: Tells you which line could not be read, or that all x values are equal.
- Theme aware: The plot follows light and dark mode.