Coefficient of Determination Calculator (R²)

Paste your paired X and Y values to compute R² — the proportion of variance in Y explained by the least-squares regression line — along with the fitted slope, intercept, and correlation.

Enter the same number of values in each box, separated by commas or spaces.

Quick Facts

Method
R² = 1 − SS_res / SS_tot (least-squares fit)
Equals the square of the Pearson correlation r for a straight-line fit.

Your Results

Calculated
R² (coefficient of determination)
-
Proportion of variance in Y explained
Variance explained
-
R² expressed as a percentage
Correlation r
-
Pearson correlation coefficient
Regression line
-
Least-squares best fit

Ready

Enter your X and Y data and press Calculate.

Using the Coefficient of Determination Calculator (R²)

The coefficient of determination, written R², tells you how much of the variation in a dependent variable (Y) is explained by an independent variable (X) through a fitted model. This calculator takes your paired data, fits the ordinary least-squares regression line, and reports R² along with the slope, intercept, and Pearson correlation. Paste two equal-length lists of numbers, press Calculate, and you get the full picture of how well a straight line describes the relationship.

The formula

R² is defined as the fraction of total variance in Y that the model accounts for:

R² = 1 − (SSres / SStot)

  • SStot = Σ(yᵢ − ȳ)² — the total sum of squares, the variance of Y around its own mean ȳ.
  • SSres = Σ(yᵢ − ŷᵢ)² — the residual sum of squares, the variance left over after the model's predictions ŷᵢ.

For simple linear regression the best-fit line has slope b = Σ(xᵢ−x̄)(yᵢ−ȳ) / Σ(xᵢ−x̄)² and intercept a = ȳ − b·x̄. In that one-predictor case, R² is exactly the square of the Pearson correlation coefficient r, which is why R² is always between 0 and 1 for a least-squares fit.

How to read the result

R² is a proportion, so multiply by 100 to get a percentage. R² = 0.85 means the regression line explains 85% of the variance in Y, and 15% remains unexplained (measurement noise, omitted variables, or nonlinearity). R² = 0 means the line does no better than simply predicting the mean of Y every time; R² = 1 means every data point falls exactly on the line.

Common reference points

  • R² = 1.00 — a perfect fit; all points are collinear.
  • R² ≈ 0.90+ — a very strong relationship, common in controlled physics or engineering data.
  • R² ≈ 0.25–0.50 — typical in social-science and behavioral data, where many factors drive the outcome.
  • R² ≈ 0 — no linear relationship; note that a curved (e.g. parabolic) relationship can still give R² near 0 for a straight line.

Frequently Asked Questions

What does the coefficient of determination (R²) measure?
R² is the proportion of the variance in the dependent variable Y that is explained by the model. It ranges from 0 to 1 for an ordinary least-squares fit: R² = 0.75 means the model accounts for 75% of the variation in Y, leaving 25% unexplained by X.
How is R² related to the correlation coefficient r?
For a single-predictor linear regression, R² is exactly r². So a Pearson correlation of r = 0.8 gives R² = 0.64, and r = −0.9 gives R² = 0.81. Because it is squared, R² loses the sign — it tells you the strength of the fit but not whether the slope is positive or negative. This calculator reports both so you keep the direction.
Can R² be negative?
Not for an ordinary least-squares line fitted to the same data, where it stays between 0 and 1. R² can go negative only when you apply a model that is worse than the horizontal mean line — for example a fixed line carried over from other data, or a forced zero-intercept fit. In those cases SS_res exceeds SS_tot and 1 − SS_res/SS_tot drops below 0.
Does a high R² mean the model is correct?
No. R² measures goodness of fit, not causation or model validity. A high R² can come from overfitting, a spurious correlation, or a nonlinear pattern squeezed through a straight line. Always inspect a residual plot, and when comparing models with different numbers of predictors use adjusted R², which penalizes extra terms that do not genuinely improve the fit.