Skip to content
Popular Calculators
Browse Statistics calculators

R-Squared Calculator

Find R², the coefficient of determination, from paired data, from a correlation, or from sums of squares, with adjusted R².

What do you want to work out?

About the R-Squared Calculator

R², the coefficient of determination, tells you what share of the variation in an outcome a model explains. An R² of 0.75 means the model accounts for 75 percent of the ups and downs in the data, leaving 25 percent unexplained. It is the most common summary of how well a regression line or model fits, and it appears in almost every regression output, from spreadsheets to research papers.

This R-squared calculator finds R² three ways: from paired data, by fitting a least-squares line; from a correlation coefficient, by squaring it; or from sums of squares, using the residual and total sums of squares from any model. Given the number of observations and predictors, it also calculates adjusted R², which corrects for the number of predictors in a model.

How to Use the R-Squared Calculator

Choose From data, From r or From sums of squares.

For data, enter the X and Y values in the same order.

For a correlation, enter r, between −1 and 1.

For sums of squares, enter the residual and total sums of squares, and optionally the number of observations and predictors for adjusted R².

The Formulas

  R² = 1 − SSres ÷ SStot

  SStot = Σ (y − ȳ)²          total variation around the mean
  SSres = Σ (y − ŷ)²          variation left over after the model

  simple regression:  R² = r²
  adjusted R² = 1 − (1 − R²) × (n − 1) ÷ (n − k − 1)

Here n is the number of observations and k the number of predictors.

Step-by-Step Example: From Data

X = 2, 3, 5, 7, 9 and Y = 65, 70, 75, 85, 90.

  SStot = 430
  Fitted line: ŷ = 58.29 + 3.598x
  SSres = 5.488
  R² = 1 − 5.488 ÷ 430 = 0.9872

The line explains 98.7% of the variation in Y. With 5 observations and 1 predictor, adjusted R² is 0.983.

Step-by-Step Example: From r

A correlation of 0.8.

  R² = 0.8² = 0.64

Only 64% of the variation is explained, even though 0.8 sounds like a strong correlation. A correlation of 0.5 explains just 25 percent.

Step-by-Step Example: Sums of Squares

SSres = 120, SStot = 400, with 30 observations and 3 predictors.

  R² = 1 − 120 ÷ 400 = 0.70
  adjusted R² = 1 − 0.30 × 29 ÷ 26 = 0.665

R² and the ANOVA Table

R² ties regression to analysis of variance. The total sum of squares splits into an explained part and a residual part, SStot = SSreg + SSres, and R² is simply the explained share, SSreg ÷ SStot. In a one-way ANOVA the same ratio is called eta squared. Thinking of R² this way makes clear why it can only range from 0, when the model explains nothing beyond the mean, to 1, when every point lies exactly on the fitted values and nothing is left over.

Why Adjusted R² Exists

Adding a predictor to a regression can never lower R², even if the predictor is pure noise, because the model can always use it to fit the sample slightly better. A model with many predictors and few observations can therefore show a high R² that does not reflect real explanatory power. Adjusted R² penalises each extra predictor, and it only rises when a new predictor improves the fit by more than chance would. Use it to compare models with different numbers of predictors.

What Is a Good R²?

There is no universal threshold. Laboratory measurements following a physical law often give R² above 0.99. Economic and social data is much noisier: models of wages, spending or health outcomes may have R² of 0.2 to 0.5 and still be valuable. In finance, a model that explains even a few percent of daily returns could be very profitable. Compare R² with what is typical for similar data, and remember that the purpose of the model matters more than the number.

What R² Does Not Tell You

A high R² does not mean the model is correct. A straight line fitted to curved data can have a high R² while systematically missing the pattern. R² says nothing about causation, nothing about whether the predictors are the right ones, and nothing about how well the model will predict new data — models with too many predictors often fit the sample well and new data badly, a problem called overfitting. Always inspect a plot of the residuals alongside R².

Negative R²

For an ordinary least-squares line with an intercept, R² is always between 0 and 1. But when a model is fitted without an intercept, or evaluated on new data it was not fitted to, the residual sum of squares can exceed the total sum of squares, making R² negative. That means the model predicts worse than simply using the mean of Y for every case — a clear sign something is wrong.

Understanding Your Result

The headline is R².

The variation explained line gives R² as a percentage.

The what it means line describes the fit in words.

The adjusted R² line corrects for the number of predictors, when n is known.

When Should You Use This Calculator?

Use it to judge how well a regression line fits your data.

Use it to convert a correlation into the share of variation explained.

Use it to compare models with adjusted R².

Use it for statistics and econometrics coursework.

Common Mistakes

Equating a high R² with a correct model. Check the residuals.

Comparing R² across models with different numbers of predictors. Use adjusted R².

Squaring r in your head. A correlation of 0.7 explains less than half the variation.

Reading R² as causation. It measures fit, not cause.

Comparing R² across different outcome variables. It depends on how variable each outcome is.

Frequently Asked Questions

What is R² for x = 2, 3, 5, 7, 9 and y = 65, 70, 75, 85, 90?

The total sum of squares of y is 430 and the residual sum of squares after fitting the line is 5.49, so R² = 1 − 5.49 ÷ 430 = 0.987. The line explains about 98.7 percent of the variation.

How do I get R² from a correlation?

For a simple linear regression with one predictor, R² is the square of the correlation coefficient. A correlation of 0.8 gives R² = 0.64, so 64 percent of the variation in Y is explained by its linear relationship with X.

What is adjusted R²?

R² never falls when predictors are added, even useless ones. Adjusted R² penalises extra predictors: with R² = 0.7, 30 observations and 3 predictors it is 1 − 0.3 × 29 ÷ 26 = 0.665. Use it to compare models with different numbers of predictors.

What is a good R² value?

It depends on the field. In physics and engineering, R² above 0.95 is common. In social sciences and economics, where behaviour is noisy, 0.3 can be useful. Judge R² against what is typical for similar data, not a fixed cut-off.

Can R² be negative?

For a least-squares line with an intercept, no — it runs from 0 to 1. But if a model is fitted poorly or without an intercept, or tested on new data, SSres can exceed SStot, giving a negative R², meaning the model is worse than predicting the mean.

Does a high R² mean the model is correct?

No. A curved relationship forced into a straight line can still give a high R², and a strong correlation can be driven by a third variable. Always plot the data and residuals, and think about whether the relationship makes sense.

Last reviewed September 28, 2026 by the CalculatorPeak editorial team.