R-Squared & Adjusted R-Squared Calculator
Work out the coefficient of determination (R²) and adjusted R² for any regression. Fit a line to paired x/y data or compare actual against predicted values, and see the full SST, SSR and SSE breakdown. Free, browser-only, sources cited below.
How it works
R-squared, the coefficient of determination, answers one question: how much of the variation in your dependent variable y is explained by the model? It is built from three sums of squares defined in the NIST/SEMATECH e-Handbook of Statistical Methods.
Let n be the number of observations and ȳ the mean of the actual y values. The total sum of squares is the spread of y around its own mean:
SST = Σ(yᵢ − ȳ)²
The model produces a predicted value ŷᵢ for each point. In paired mode the tool fits an ordinary least-squares simple linear regression, choosing the slope b and intercept a that minimise the squared errors:
b = Σ(xᵢ − x̄)(yᵢ − ȳ) / Σ(xᵢ − x̄)² ; a = ȳ − b·x̄ ; ŷᵢ = a + b·xᵢ
In actual-vs-predicted mode you supply the ŷᵢ yourself — for example, the fitted values from a multiple regression run elsewhere. Either way, the residual (error) sum of squares measures what the model misses, and the regression (explained) sum of squares is the rest:
SSE = Σ(yᵢ − ŷᵢ)² ; SSR = SST − SSE
The coefficient of determination is then the explained fraction:
R² = SSR / SST = 1 − SSE / SST
Because R² never decreases when you add another predictor — even an irrelevant one — it can flatter a multi-variable model. Adjusted R² corrects for this by penalising the predictor count k against the sample size n:
R²_adj = 1 − (1 − R²)·(n − 1)/(n − k − 1)
Two edge cases matter. When every y value is identical, SST is zero and R² is undefined — the tool says so instead of dividing by zero. And when n − k − 1 is zero or negative there are too few observations for the number of predictors, so adjusted R² is undefined and the tool shows a message rather than a misleading number. As a cross-check in paired mode, the calculator also reports the Pearson correlation r and confirms the identity r² = R² that holds for any simple linear regression.
Worked examples
Frequently asked questions
Sources & references
- NIST/SEMATECH e-Handbook §1.4.1 — sums of squares (SST, SSR, SSE) and the coefficient of determination R²
- NIST/SEMATECH e-Handbook §4.4.1 — adjusted R² and the number of parameters
- NIST/SEMATECH e-Handbook of Statistical Methods — full handbook
The formulas on this page were last cross-checked against the NIST e-Handbook on 2026-07-09. R² and adjusted R² are universally-agreed mathematical definitions, so they are stable; this page is reviewed if the cited handbook sections are revised.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.