Linear Regression Calculator
Enter X,Y data points to find the best-fit line equation, slope, intercept, and R-squared value — plus predict Y for any X.
Enter X, Y Data Points
Format: x, y or x y — at least 2 pairs required
Enter data on the left and click Calculate to see results.
Best-Fit Line Equation
Slope (m)
Intercept (b)
R²
Points (n)
R² Interpretation
Summary Statistics
Mean X
Mean Y
Pearson r
Std Dev X
Std Dev Y
Sum Sq Err
Copied!
Summary
Enter X,Y data points to find the best-fit line equation, slope, intercept, and R-squared value — plus predict Y for any X.
How it works
- Enter your data as X,Y pairs — one pair per line, separated by a comma or space.
- Click "Calculate" to run the least-squares regression.
- The tool displays the slope, intercept, and the full equation y = mx + b.
- R-squared (R²) tells you the proportion of variance explained by the line (0–1; closer to 1 is a better fit).
- Enter any X value in the prediction box to get the corresponding predicted Y.
- Use "Copy Results" to copy all outputs to your clipboard.
Use cases
- Analyze trends in sales or revenue data over time.
- Predict future values based on historical data points.
- Validate scientific measurements and experimental results.
- Calculate grade curves or academic performance trends.
- Estimate cost vs. volume relationships in business analysis.
- Explore correlations between two numeric variables.
- Homework help for statistics and data science courses.
- Quick sanity-check before running full statistical software.
Frequently Asked Questions
Last updated: 2026-06-09 ·
Reviewed by Nham Vu