Linear Regression Calculator
Fit a least-squares regression line to pasted X/Y data. Get slope, intercept, R², correlation coefficient, and a scatter plot with the fitted line - free, in-browser.
Loading tool...
What is Linear Regression Calculator?
The Linear Regression Calculator fits a least-squares line to pasted X,Y data and reports slope, intercept, R², and the correlation coefficient, with a scatter plot that draws every point and the fitted line - all computed instantly in your browser.
Key Benefits
- Lender-grade textbook least-squares math in one paste
- Fit quality visible through both R² and the scatter plot
- Flexible separators make pasting from any source easy
- Fully private - data stays on your device
Common Use Cases
- •Checking trends in sales, temperatures, or test scores
- •Quick fits for lab measurements and engineering data
- •Teaching or revising introductory statistics
- •Sanity-checking regression results from bigger tools
- •Exploring correlations before deeper modeling
Fit a Linear Regression
- Paste your data: Paste X,Y pairs one per line - commas, spaces, or tabs all work as separators.
- Read the fit: The slope and intercept define the best-fit line y = slope × x + intercept, computed by least squares.
- Check the fit quality: R² shows how much of the variance the line explains (1 is perfect), and the correlation coefficient r shows direction and strength.
- See it visually: The scatter plot draws every point with the fitted line through them, so outliers and curvature jump out immediately.
Key Features
- Least-squares fit with slope and intercept to four decimals
- R² and correlation coefficient computed from the same data
- Scatter plot with the fitted line drawn as crisp SVG
- Flexible input: commas, spaces, tabs, or semicolons
- Bad lines are skipped instead of breaking the fit
- Instant client-side statistics - works offline