Linear Regression Tool
Fit a least-squares linear trendline to paired data, review slope, intercept and R-squared, predict a value, and download results locally.
🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.
Dataset
Paired x, y values
Use x, y, separated by comma, tab, or semicolon.
Least-squares result
y = 3.14x + 8.75
Points
8
Slope
3.14
R² fit
0.99
Predicted y
40.19
Sample results update as you edit.
How it works
- Paste one numeric x, y pair per line.
- The tool finds the straight line that minimizes the total squared vertical distance from your points.
- Review the fitted line and R-squared score, then enter an x value for a local prediction.
The formula
slope = Σ((x − x̄)(y − ȳ)) / Σ((x − x̄)²); y = slope × x + intercept
FAQ
Is my dataset uploaded?
No. The data, calculations, chart, and CSV download are all created locally in your browser.
What does R-squared mean?
R-squared describes how much of the variation in y is explained by the fitted straight line. A value near 1 indicates a closer linear fit.
Why do I need different x values?
A line slope cannot be calculated when every x value is identical, because there is no horizontal variation to compare.
Is a trendline a forecast guarantee?
No. It is a mathematical summary of the data you entered. Use domain knowledge before making decisions from extrapolated values.
How we compare
| Feature | Online Tool Store | Spreadsheet | Manual math |
|---|---|---|---|
| No install or upload | Yes | Depends on app | Yes |
| Trendline, R², and prediction | Visible together | Functions/chart setup | Calculate each step |
| CSV export | Included | Save/export workflow | Manual |
For a quick private line-of-best-fit check, this tool keeps data entry, visual output, and the formula in one focused screen.