The R-squared calculator above answers one question: of all the variation in your outcome variable, what share does your model account for? Paste two columns of numbers and it returns the coefficient of determination, the adjusted version that penalises extra predictors, the underlying sums of squares, and a bar showing the explained and unexplained split side by side.
Arb Digital's analytics team reaches for this number constantly — when a client asks whether ad spend "explains" revenue, or whether a page-speed change "explains" a conversion lift, R² is the honest first check. It is also the most over-interpreted statistic in reporting, so this page spends as much time on what R² cannot tell you as on what it can.
What This R-Squared Calculator Does
R², written R-squared and formally called the coefficient of determination, is the proportion of variance in a dependent variable that a model explains. It runs from 0 to 1 for an ordinary least-squares fit, where 0 means the model does no better than predicting the mean every time, and 1 means the model reproduces every observation exactly.
This tool computes it three ways, because in practice you arrive at R² from three different starting points. In X and Y pairs mode it fits a least-squares straight line for you, then scores that line. In observed and predicted mode you supply the real values and whatever your model predicted — from a polynomial, an exponential curve, a decision tree, anything at all — and it scores those predictions directly without assuming a straight line. In sums of squares mode you already have SSR and SST from software output and just want the arithmetic and the adjusted figure done cleanly.
Alongside R² you get adjusted R², the Pearson correlation coefficient r (the signed square root of R² in the simple two-variable case), the residual sum of squares SSE, and the total sum of squares SST. One boundary worth stating plainly: our linear regression calculator exists to find the line — slope, intercept, and a prediction for a new x — while this page exists to score a fit that already exists, including fits that are not lines at all.
How to Use It
- Pick your input mode. Two raw columns and no model yet? Use X and Y pairs. Already have predictions from a curve or an algorithm? Use observed and predicted. Reading numbers off a regression printout? Use sums of squares.
- Paste your numbers. Commas, spaces, tabs, or line breaks all work, so a column copied straight out of a spreadsheet pastes cleanly. The two lists must hold the same count of values, and each pair must line up row for row.
- Set the number of predictors. For one independent variable leave k at 1. For a multiple regression with four independent variables, set k to 4 so the adjusted figure penalises correctly.
- Set the sample-size override only if you need it. In sums-of-squares mode there is no data to count, so type your n there. In the data modes, leave it at 0 and the tool counts your rows.
- Read the hero number, then read the adjusted number underneath it. If those two disagree noticeably, your model is carrying predictors that are not earning their place.
The Formula / How It's Calculated
Everything rests on three sums of squares. The total sum of squares is the variation in your outcome around its own mean: SST = Σ(yᵢ − ȳ)². The residual sum of squares is what your model failed to capture: SSE = Σ(yᵢ − ŷᵢ)², where ŷᵢ is the model's prediction for observation i. The regression sum of squares is the part the model did capture: SSR = SST − SSE.
From there, R² = SSR ÷ SST = 1 − (SSE ÷ SST). That is the whole calculation. Work a small example by hand: take x = 1 to 5 and y = 2, 4, 5, 4, 5. The mean of y is 4, so SST = 4 + 0 + 1 + 0 + 1 = 6. The least-squares line comes out as ŷ = 2.2 + 0.6x, giving predictions of 2.8, 3.4, 4.0, 4.6 and 5.2, so SSE = 0.64 + 0.36 + 1.00 + 0.36 + 0.04 = 2.4. R² = 1 − (2.4 ÷ 6) = 0.60. The line explains sixty per cent of the variation in y, and the remaining forty per cent sits in the residuals.
Adjusted R² applies a penalty for model complexity: R²adj = 1 − [(1 − R²)(n − 1) ÷ (n − k − 1)], with n observations and k predictors. On the same example, with n = 5 and k = 1, that is 1 − (0.40 × 4 ÷ 3) = 0.467. The NIST/SEMATECH e-Handbook of Statistical Methods sets out the same decomposition and is a good reference if you want the derivation with its distributional assumptions spelled out.
Why Adjusted R² Exists At All
Plain R² has a structural flaw: it can never fall when you add a predictor. Add a column of random noise to a regression and R² will creep up, because least squares will always find some sliver of coincidental alignment to exploit. Add enough junk columns and you can drive R² towards 1.00 while building a model that predicts nothing at all about data it has not seen.
Adjusted R² fixes this by charging rent for every predictor. The penalty term (n − 1) ÷ (n − k − 1) grows as k rises and shrinks as n rises, so a genuinely useful variable — one that cuts SSE by more than the penalty costs — still raises the adjusted figure, while a useless one lowers it. That sign flip is the practical test: if adding a variable lowers adjusted R², drop the variable.
What R² Does Not Tell You
R² measures how tightly points sit around the fitted line. It does not measure whether the line is the right shape, whether the relationship is causal, or whether the model will hold up on new data. Those are three separate failures, and R² is blind to all of them.
The classic demonstration is Anscombe's quartet: four small datasets with near-identical means, variances, regression lines and R² values of roughly 0.67, yet one is a clean linear relationship, one is an obvious curve, one is a perfect line dragged by a single outlier, and one is a vertical stack of points with one leverage point inventing a slope. Summary statistics cannot tell them apart. Only a plot can, which is why NIST's guidance on graphical model checking treats plotting the residuals as a mandatory step rather than an optional one.
Nor does R² imply causation. Two series that both trend upward over time — ad spend and revenue, ice cream sales and swimming accidents — can produce a high R² purely because both respond to a third driver such as seasonality or general growth. A high R² tells you the numbers move together, which is exactly what our correlation coefficient calculator tells you, and no more.
Scoring Non-Linear and Machine-Learning Models
The observed-and-predicted mode exists because R² is not restricted to straight lines. The formula 1 − SSE/SST only needs a set of predictions to compare against a set of actuals; it does not care where those predictions came from. Fit a quadratic, a logistic curve, a gradient-boosted tree, or a hand-built rule of thumb, feed in what it predicted, and the number that comes back is a legitimate measure of explained variance.
Two cautions apply. First, when the model is not fitted by ordinary least squares, the tidy identity SST = SSR + SSE need not hold exactly, so R² is better read as "one minus the fraction of variance left unexplained" than as a literal partition. Second, R² computed on the same data the model was trained on is optimistic by construction. The honest version is computed on a held-out test set, where a model that memorised its training data will show its true score. A model reporting 0.94 on training data and 0.31 on test data has not explained anything — it has memorised noise.
When R² Comes Out Negative
People assume R² cannot go below zero because of the square in its name. It can, and this calculator will show it in observed-and-predicted or sums-of-squares mode. A negative R² means SSE is larger than SST — your model's predictions are further from the truth, on average, than simply guessing the mean of the outcome every single time.
This shows up in three situations in practice: scoring a model on new data it was never fitted to, forcing a regression through the origin when the data does not pass near it, and applying a model built on one population to a different one. It is not a computational error and it is not something to hide. It is the clearest possible signal that the model is worse than useless and should be replaced rather than tuned.
What Counts As a Good R² Depends On the Field
There is no universal threshold, and any page that gives you one is misleading you. In a physics or engineering calibration where the underlying relationship is deterministic and measurement error is small, an R² of 0.99 is routine and 0.90 would prompt a hunt for the instrument fault. In human behaviour — consumer choice, click-through rates, survey responses — an R² of 0.30 can represent a genuinely valuable finding, because individual behaviour is driven by dozens of unmeasured factors.
One more practical point: R² is not a significance test. A small sample can produce an impressive-looking R² by chance alone. Pair the fit measure with a formal test — an F-test on the regression, or the workflow on our p-value calculator — before you present a relationship as established.
R², Correlation, and the Rest of the Fit Family
In simple regression with one predictor, R² is exactly the square of Pearson's r, which is why this calculator reports both. The difference is interpretive: r carries a sign and tells you direction, while R² drops the sign and tells you the magnitude of explanation. An r of −0.80 and an r of +0.80 both give R² = 0.64.
That identity breaks in multiple regression, where there is no single r to square — R² there is the squared correlation between the observed values and the model's fitted values taken together. It also breaks when the relationship is monotonic but not linear, which is the case our Spearman rank correlation calculator handles by working on ranks instead of raw values.
Finally, R² is unitless, which makes it easy to compare across models but useless for judging practical accuracy. A model can explain 85% of the variance and still be wrong by an amount that matters to your business. For that, look at the root mean squared error in the original units, and at the spread of your data through the standard deviation calculator, before deciding whether the fit is good enough to act on.
Arb Digital builds free, no-signup calculators for statistics, finance, health and construction. Browse the full library, or get in touch if there is a calculation your team keeps doing by hand.
Browse All Free Tools Contact Arb DigitalCommon Mistakes to Avoid
- Reading R² as a measure of causation — it quantifies shared variation only, and two series driven by a common third factor will score highly without either causing the other.
- Comparing R² across different outcome variables — a model of revenue and a model of conversion rate have different SST values, so their R² figures are not on a common scale.
- Using plain R² to choose between models with different predictor counts — the bigger model wins automatically. Use adjusted R², or an out-of-sample score.
- Reporting training R² as if it were predictive accuracy — always hold data back and score the model on numbers it has never seen.
- Skipping the scatter plot — a curved relationship, a single outlier, or a leverage point can all produce a respectable R² that a ten-second plot would have exposed.
Related Free Tools From Arb Digital
Fit the line itself with the linear regression calculator, check direction and strength with the correlation coefficient calculator, measure spread with the variance calculator, test whether a result could be chance with the t-test calculator, and summarise a whole column at once with the descriptive statistics calculator. The full free online tools hub holds the rest of the statistics set.
Frequently Asked Questions
It is the proportion of the variation in your outcome variable that the model accounts for. An R² of 0.60 means the model explains 60% of the observed variation, and the remaining 40% is left in the residuals, driven by factors the model does not include.
There is no universal threshold. In physical sciences with controlled measurement, 0.95 and above is normal. In human behaviour, marketing, and social science, 0.25 to 0.40 can represent a genuinely useful relationship. Compare against other models of the same outcome, not against an abstract benchmark.
Yes, whenever the residual sum of squares exceeds the total sum of squares. That happens when a model is scored on data it was not fitted to, or when a regression is forced through the origin. It means the model performs worse than simply predicting the mean every time.
Plain R² never falls when you add a predictor, so it rewards complexity for its own sake. Adjusted R² subtracts a penalty based on the number of predictors relative to the sample size, so it only rises when a new variable earns its place.
In a simple regression with one predictor, R² is the square of Pearson's r. Squaring drops the sign, so r tells you direction and strength while R² tells you explained variance only. In multiple regression the simple squaring relationship no longer applies.
Yes. Use the observed and predicted mode and feed in the actual values alongside whatever your curve or algorithm predicted. Because the model is not fitted by least squares, read the result as the fraction of variance left unexplained rather than as an exact partition of the total.
Not on its own. A high R² measured on the same data the model was trained on can reflect memorised noise rather than a real pattern. The reliable test is to score the model on a held-out sample it has never seen.
This calculator is provided for education and planning only. Statistical output should be read alongside a plot of your data and, for consequential decisions, reviewed by someone qualified in your field.