R² (Coefficient of Determination) Calculator
Paste your actual values and predicted values below to calculate R², adjusted R², and model error metrics.
What is R²?
R² (read as “R-squared”) is the coefficient of determination. It measures how much of the variation in your target variable is explained by your model. In practical terms, it gives you a quick signal of how well predictions line up with actual outcomes.
An R² of 1.00 means perfect fit, while an R² of 0.00 means your model explains none of the variability beyond a simple average baseline. R² can also be negative when a model performs worse than predicting the mean every time.
Formula used in this calculator
The calculator computes R² using residual and total sums of squares:
SSres = Σ(yi - ŷi)²
SStot = Σ(yi - ȳ)²
Where yi are actual values, ŷi are predicted values, and ȳ is the mean of actual values.
How to use the R² calculator
- Enter all observed values in the Actual values field.
- Enter matching model outputs in the Predicted values field.
- Set k to your number of predictors if you want adjusted R².
- Click Calculate R².
The tool returns R², adjusted R² (when valid), RMSE, and a short interpretation to help you quickly evaluate model fit quality.
Interpreting R² correctly
Quick intuition bands
- R² < 0: model is worse than mean prediction.
- 0 to 0.25: weak explanatory power.
- 0.25 to 0.50: modest explanatory power.
- 0.50 to 0.75: moderate to strong fit.
- 0.75 to 1.00: very strong fit.
These are rough guidelines. In fields with noisy systems (behavioral science, finance, marketing), lower R² values may still be useful. In controlled engineering settings, expectations are often higher.
Why adjusted R² matters
Standard R² never decreases when you add more features, even useless ones. Adjusted R² penalizes complexity, making it better for comparing models with different predictor counts.
If adjusted R² drops after adding a variable, that feature may not contribute enough to justify model complexity.
Common mistakes when evaluating regression models
- Using R² alone: Always pair it with RMSE/MAE and residual checks.
- Ignoring data leakage: Inflated R² often comes from train-test contamination.
- Assuming high R² means causal truth: fit quality is not proof of causation.
- Comparing across different targets: R² is only directly comparable for the same response variable and dataset context.
Example
Suppose your actual values are 3, 5, 7, 9, 11 and predicted values are 2.8, 5.2, 6.9, 9.1, 10.7. This calculator yields a high R², indicating your predictions explain most of the outcome variation with relatively low error.
That does not mean the model is production-ready by itself—you still need to validate on unseen data, check residual patterns, and test model stability over time.
FAQ
Can R² be negative?
Yes. A negative R² means your model performs worse than predicting the mean of the target variable.
Is higher R² always better?
Generally yes for fit, but an extremely high R² can still overfit if test performance degrades. Use cross-validation and holdout sets.
What if all actual values are identical?
In that case, total variance is zero, and classical R² becomes undefined. The calculator will report that condition clearly.