Coefficient of Determination (R-Squared) Calculator

Measure linear model fit with R-squared, adjusted R-squared, Pearson correlation, and the least-squares regression equation.

Calculate coefficient of determination
Enter equal-length comma-separated X and Y values with at least three paired observations.

About the coefficient of determination

The coefficient of determination, usually written R² or R-squared, describes how much variation in a dependent variable is accounted for by a fitted model. In simple linear regression with an intercept, it equals the square of the Pearson correlation coefficient between X and Y. Values normally range from zero to one: zero indicates that the fitted line explains none of the observed variation in Y, while one indicates that every point lies exactly on the line. This calculator fits an ordinary least-squares line. It finds the slope by dividing the sum of cross-products around the means by the sum of squared X deviations. The intercept positions that line through the point formed by the mean of X and mean of Y. Pearson's r measures the direction and strength of the linear relationship, and R-squared is r². Because squaring removes the sign, inspect r or the slope to distinguish positive from negative relationships. Adjusted R-squared applies a penalty for model complexity. For this simple regression with one predictor, it is calculated as 1 − (1 − R²)(n − 1)/(n − 2), where n is the number of paired observations. It can be lower than zero when the fitted model performs poorly. Adjusted R-squared is especially useful when comparing models with different numbers of predictors, although this calculator specifically fits one-predictor linear regression. A high R-squared does not establish causation, validate every model assumption, or prove that predictions will be accurate outside the observed X range. A curved relationship may have a low linear R-squared despite being highly systematic. Conversely, a strong trend caused by time, a lurking variable, or a few influential points may produce a high value without a meaningful causal connection. Always inspect a scatterplot and residuals alongside summary statistics. Least-squares inference commonly assumes independent observations, a linear mean relationship, roughly constant residual variance, and suitably distributed residuals for confidence intervals and hypothesis tests. R-squared itself can still be calculated when these conditions fail, but its interpretation may be misleading. Duplicate X values are acceptable, but X and Y must each contain variation; a constant series makes correlation and regression undefined. Enter paired values in matching order so each X corresponds to the Y at the same position. Units affect the slope and intercept but not r or R-squared. Report enough context to explain the variables, sample, and range, and avoid describing R-squared as the percentage of individual outcomes predicted correctly. It is a proportion of sample variation explained by the fitted line, not a classification accuracy score or a guarantee about future observations.

R-squared examples

These paired data sets illustrate perfect, moderate, and negative linear relationships.

Paired dataRegression resultInterpretation
X: 1,2,3; Y: 2,4,6R² = 1; y = 2x + 0Every point lies exactly on an increasing straight line.
X: 1,2,3,4; Y: 2,3,5,4R² = 0.64; y = 0.8x + 1.5The line explains 64% of the variation in Y.
X: 1,2,3; Y: 6,4,2R² = 1; r = −1R-squared is perfect while correlation reveals the negative direction.

How to calculate R-squared

  1. Enter independent-variable values as a comma-separated X list.
  2. Enter dependent-variable values in the matching order as the Y list.
  3. Select Calculate R-Squared to fit the least-squares line.
  4. Interpret R-squared with the correlation, equation, scatterplot, and residual context.

R-squared FAQ

What is a good R-squared value?

There is no universal cutoff because expected variation differs across fields and purposes. Compare the value with relevant benchmarks and assess prediction error and residual patterns.

Can R-squared be negative?

For simple least-squares regression with an intercept, ordinary R-squared is between zero and one. Adjusted R-squared can be negative when the model performs poorly after its complexity penalty.

Why does R-squared hide the direction?

It squares the correlation coefficient, so positive and negative correlations can yield the same R-squared. Use Pearson's r or the regression slope to identify direction.

Does a high R-squared prove causation?

No. Association can arise from confounding, shared trends, selection effects, or chance. Causal claims require an appropriate design and assumptions beyond model fit.

What is adjusted R-squared used for?

It penalizes explained variation for the number of predictors relative to sample size. It is useful when comparing candidate regression models, though other diagnostics remain necessary.

Why must both lists have variation?

Correlation divides by the spread of each variable and the slope divides by X variation. A constant list makes those quantities undefined rather than zero.