Coefficient of Determination Calculator (R²)
Paste your actual observed values and your model's predicted values (comma-separated) to compute R², the fraction of total variance that the model explains. Also shows sum of squares, residual statistics and a scatter plot of actual vs predicted.
Proportion of variance in the actual values explained by the model (0 = none, 1 = perfect)
- 1
SS total = Σ(yᵢ − ȳ)²
1,000 - 2
SS residual = Σ(yᵢ − ŷᵢ)²
25 - 3
SS_res ÷ SS_tot
25 ÷ 1,000 = 0.025 - 4
R² = 1 − SS_res ÷ SS_tot
1 − 0.025 = 0.9750R² = 1 means perfect prediction; R² = 0 means the model explains no variance beyond the mean.
How does this calculator work?
R² = 1 − SS_res / SS_tot, where SS_res = Σ(actual − predicted)² and SS_tot = Σ(actual − mean)². An R² of 1 means perfect fit; 0 means the model explains no variance beyond the mean. Enter comma-separated actual and predicted lists to get R², residual stats and an actual-vs-predicted plot.
Formula
How this is calculated
R² (the coefficient of determination) measures how well a set of predicted values matches the actual data. It compares two sums of squares: SS_res (the residual sum of squares — how far predictions are from actuals) and SS_tot (the total sum of squares — how far actuals are from their own mean). Subtracting their ratio from 1 gives a value that is 1 for perfect predictions and 0 when the model is no better than guessing the mean.
R² can be negative when the model performs worse than using the mean as a predictor — this is possible for non-linear models or when predictions are made out-of-sample. For linear regression models fitted with ordinary least squares the value is always between 0 and 1.
This calculator makes no assumption about the underlying model: it accepts any pair of actual and predicted lists. If you are evaluating a regression, bear in mind that R² does not penalise for overfitting — adding predictors to a linear model never reduces R². Adjusted R² (not shown here) corrects for this by penalising model complexity.
Frequently asked questions
It depends on the field. In physical sciences R² > 0.99 is expected; in social sciences 0.3–0.6 can be meaningful. High R² does not guarantee that the model is correctly specified — always inspect residuals and check for patterns.
Yes, for any model type other than ordinary-least-squares linear regression. A negative R² means the predictions are worse than simply predicting the mean for every observation — the model actively harms accuracy.
Pearson's r measures the linear correlation between two variables; R² (for simple linear regression) is exactly r². But in multiple regression or for non-linear models, R² is computed from sums of squares and does not equal the square of any single correlation coefficient.
TG we-Calculate Editorial Team. (2026). Coefficient of Determination Calculator (R²) [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/coefficient-of-determination-calculator
TG we-Calculate Editorial Team. "Coefficient of Determination Calculator (R²)." TG we-Calculate. 2026. https://we-calculate.com/calculator/coefficient-of-determination-calculator.
TG we-Calculate Editorial Team, "Coefficient of Determination Calculator (R²)," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/coefficient-of-determination-calculator
@misc{wecalculate_coefficient_of_determination_calculator, title = {Coefficient of Determination Calculator (R²)}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/coefficient-of-determination-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
