Fit the least-squares line to a list of x,y data pairs and inspect the slope, intercept, and fit stats.
Last updated: June 2026 | By Patchworkr Team
Enter one pair per line in the form x,y. Blank lines and malformed rows are rejected.
Linear regression finds the straight line that best fits a set of points by minimizing the sum of the squared vertical distances from the data to the line.
Using the sample data, the calculator fits a line to the points and reports the slope, intercept, and fit statistics in the result panel.
Why reject blank lines?
Blank rows are treated as invalid so the calculator never silently drops data.
Does the tool accept decimals?
Yes. Each x and y value can be any finite real number, including scientific notation.
What if all x values are the same?
The regression line is undefined because the denominator in the slope formula becomes zero.
When is R^2 undefined?
If y has no variation, correlation is undefined, so the panel shows N/A for r and R^2.
Related Tools