Linear Regression Calculator

Enter your paired data to instantly calculate the least-squares regression line, correlation coefficient, R², and make predictions.

  • Regression equation — ŷ = a + bx (line of best fit)
  • Correlation (r) — strength and direction of the linear relationship
  • — proportion of variance explained by the model
  • Predictions — enter any x-value to predict ŷ

Formulas Used

Slope

Intercept

Correlation

Prediction

How to Use This Calculator

  1. Enter X values as comma-separated numbers (e.g., 2, 3, 5, 4, 6, 1)
  2. Enter Y values in the same order (e.g., 65, 70, 80, 75, 85, 58)
  3. See the results — regression line, r, R², and step-by-step calculation
  4. Make predictions — enter any x-value to get the predicted ŷ

Both lists must have the same number of values, and each x is paired with the corresponding y.

Interpreting the Results

  • Slope (b): For each one-unit increase in x, ŷ changes by b units
  • Intercept (a): The predicted y when x = 0 (may not be meaningful)
  • r close to ±1: Strong linear relationship. r close to 0: weak or no linear relationship.
  • R² = 0.85 means 85% of the variation in y is explained by x