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.

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

  1. Enter your data as X,Y pairs — one pair per line, separated by a comma or space.
  2. Click "Calculate" to run the least-squares regression.
  3. The tool displays the slope, intercept, and the full equation y = mx + b.
  4. R-squared (R²) tells you the proportion of variance explained by the line (0–1; closer to 1 is a better fit).
  5. Enter any X value in the prediction box to get the corresponding predicted Y.
  6. 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