Linear Regression Calculator
Fit a least-squares line to paired data and plot it against the points.
What is Linear Regression?
Linear regression finds the straight line that best predicts y from x by minimising the sum of squared vertical distances to the data points. The slope is how much y changes per unit of x, and the intercept is where the line crosses x = 0.
How it works
One pass over the paired data produces every sum needed, so the slope, intercept, correlation and R² are all read from the same numbers. The fitted line is drawn over the points on the shared coordinate plane, which is the quickest way to see whether a straight line is even appropriate.
- Enter your input. Type or paste your input into the field above — the tool responds instantly.
- Review the result. Output updates live as you type. Everything runs entirely in your browser.
- Copy or download. Use the Copy button to grab the result, or Download to save it as a file.
Examples
Realistic sample
Type or paste any realistic input — the tool computes the result locally and instantly.
Common mistakes
Expecting a server round-trip
Nothing is uploaded — every tool in this category runs entirely in your browser.