A sum of squares is exactly what the name says: take a set of deviations, square each one, and add them up. It is the raw material from which almost every other measure of variation is built. Variance is a sum of squares divided by degrees of freedom. Standard deviation is the square root of that. R squared is one sum of squares divided by another. The analysis of variance table is nothing but sums of squares laid out in rows. This calculator returns the sums themselves, undivided, which is what you need when you are building or checking an ANOVA table by hand.
Arb Digital keeps a full set of free statistics tools, and the difference between them is worth stating plainly. Our variance calculator takes the total sum of squares and divides it by the degrees of freedom; our R-squared calculator reports the ratio SSR ÷ SST as a single proportion. This page stops one step earlier and gives you the three sums that both of those are derived from, so you can see and check the partition itself.
What This Sum of Squares Calculator Does
With one dataset it computes the total sum of squares about the mean, Σ(y − ȳ)², along with the uncorrected sum Σy², the correction term (Σy)² ÷ n, and the sample size. Those three quantities are related by the computational identity that lets you get a sum of squares from running totals without storing the data.
With paired data it fits an ordinary least squares line and partitions the total into two parts: the regression sum of squares, which is the variation the line accounts for, and the residual or error sum of squares, which is what remains. It reports both, checks that they add back to the total, and prints the slope, the intercept and R squared alongside. A breakdown bar shows the split visually, because "R squared is 0.6" and "60% of the squared variation is on the explained side of the line" are the same statement and the second is easier to argue about.
How to Use It
- Paste the response values into the Y box. On their own they give the total sum of squares.
- Add the predictor values in the X box, in the same order, to split the total into regression and residual parts.
- Leave the total measured about the mean unless you are specifically working with regression through the origin.
- Check the partition. SSR plus SSE must equal SST; the panel states the reconciliation explicitly.
- Divide by degrees of freedom yourself when you need mean squares — the tool prints the divisors so the next step is obvious.
The Formulas and the Partition
The total sum of squares about the mean is SST = Σ(yᵢ − ȳ)². For a fitted line ŷᵢ = a + bxᵢ, the regression sum of squares is SSR = Σ(ŷᵢ − ȳ)² and the residual sum of squares is SSE = Σ(yᵢ − ŷᵢ)². The central result of least squares is that these add exactly: SST = SSR + SSE. That identity holds only because the fitted line passes through the point (x̄, ȳ) and the residuals are orthogonal to the predictor, which is a property of the least squares fit and not of any line you might draw by eye.
Work the default by hand. With x = 1, 2, 3, 4, 5 and y = 2, 4, 5, 4, 5, the means are x̄ = 3 and ȳ = 4. The cross-product sum Sxy is 6 and Sxx is 10, so the slope is 0.6 and the intercept is 4 − 0.6 × 3 = 2.2. SST = 4 + 0 + 1 + 0 + 1 = 6. SSR = slope × Sxy = 0.6 × 6 = 3.6, so SSE = 6 − 3.6 = 2.4, and R² = 3.6 ÷ 6 = 0.6. The NIST/SEMATECH e-Handbook section on linear least squares regression sets out why minimising SSE produces exactly these estimates.
Why the Raw Sums Matter More Than the Averages
Averaged quantities hide the two things an ANOVA table exists to show: how much variation there is, and how many independent pieces of information produced it. A mean square of 1.2 could be a large sum over many degrees of freedom or a small sum over few, and those are different situations. Every F statistic in analysis of variance is a ratio of two mean squares, and every mean square is a sum of squares divided by its own degrees of freedom, so if you cannot see the sums you cannot check the table.
This is also where sums of squares diverge cleanly from variance. Sums of squares are additive across sources — you can partition them into treatment, block, interaction and error and they will reconcile to the total. Variances are not additive in that way, because each has been divided by a different denominator. That additivity is the whole reason the analysis of variance works, and the NIST/SEMATECH page on the ANOVA table shows the layout the sums feed into. Our degrees of freedom calculator handles the divisors for each row.
The Computational Formula, and When Not to Use It
There is a shortcut identity: Σ(y − ȳ)² = Σy² − (Σy)² ÷ n. It lets you accumulate just two running totals — the sum and the sum of squares — and get the sum of squared deviations at the end without a second pass over the data. Before computers this was a real saving, and it is still how streaming and database implementations do the job.
It also has a well-known failure mode. When the mean is large relative to the spread, Σy² and (Σy)²÷n are two enormous, nearly equal numbers, and subtracting them destroys precision — in extreme cases the shortcut returns a small negative number for a quantity that cannot be negative. This tool computes the deviations directly in a second pass, which is numerically stable, and prints the shortcut components so you can see both. If you are ever handed a negative sum of squares, this identity is almost always the culprit.
Reading the Split Between SSR and SSE
SSR is the variation your model claims to explain; SSE is what it fails to. Their ratio to the total is R squared, and the temptation is to read a high value as proof the model is good. It is not. Adding any predictor at all, including random noise, cannot decrease SSR — the fit can only get better on the data it was fitted to, which is why adjusted measures and out-of-sample checks exist.
The more useful reading is the residual sum itself. SSE has a unit: it is in squared units of y, so if y is measured in dollars, SSE is in squared dollars, which is why the root mean squared error is quoted instead in practice. Compute it by dividing SSE by n − 2 for a simple regression and taking the square root, and you have a typical prediction error in the original units, which is a number a stakeholder can actually judge. Our mean squared error calculator handles that step, and the linear regression calculator gives you the full fitted equation.
The Other Sums of Squares You May Have Been Asked For
The phrase gets reused. In analysis of variance, the "treatment" or "between-groups" sum of squares plays the role SSR plays here, and the "within-groups" or "error" sum of squares plays the role of SSE. In a repeated-measures design the total is split three ways. In multiple regression with correlated predictors there are Type I, Type II and Type III sums of squares, which apportion shared variation differently and can give different answers on the same data — so a report that says only "sum of squares" is under-specified whenever predictors are correlated.
There is also the pure arithmetic meaning: the sum of the squares of the first n whole numbers, n(n+1)(2n+1) ÷ 6, which is a series identity rather than a statistic. If that is what you came for, the series sum calculator is the right page. And in physics and signal work, a "sum of squares" often means Σx² with no mean subtracted at all — the uncorrected form, which this tool reports as an option. Penn State's STAT 200 elementary statistics course is a solid reference for the regression usage.
Arb Digital designs measurement that separates real effects from ordinary variation, so budget decisions rest on evidence.
Browse All Free Tools Talk To Our TeamCommon Mistakes to Avoid
- Confusing a sum of squares with a variance — the sum has not been divided by anything yet.
- Using the shortcut formula on data with a large mean and small spread, where cancellation destroys the precision.
- Forgetting to subtract the mean and reporting the uncorrected Σy² as the total.
- Treating a high R squared as proof of a good model when adding any predictor at all can only increase SSR.
- Quoting SSE as an error size — it is in squared units, so take the root of the mean square before reporting it.
Related Free Tools From Arb Digital
Divide the total by its degrees of freedom with the variance calculator or the standard deviation calculator, get the ratio on its own from the R-squared calculator, fit the line itself with the linear regression calculator, measure the association with the correlation coefficient calculator, or see the whole summary in the descriptive statistics calculator. Everything else is on the free online tools hub.
Frequently Asked Questions
The sum of the squared differences between each observation and the mean of the data. It measures the total variation present before any model is fitted.
Variance is a sum of squares divided by its degrees of freedom. The sum is the raw total; the variance is the average squared deviation, which makes it comparable across sample sizes.
For an ordinary least squares fit with an intercept, yes, exactly. The identity depends on the fitted line passing through the mean point and can fail for regression forced through the origin.
No. Every term is a square, so the total cannot be below zero. A negative result means the shortcut computing formula has lost precision on data with a large mean and a small spread.
The corrected total subtracts the mean before squaring and is the standard reporting choice. The uncorrected total is simply the sum of the squared values themselves, used mainly in regression through the origin.
Because SSR is the part of the total variation the fitted line accounts for. Expressing it as a fraction of the total gives the proportion of variation explained.
Three ways of apportioning variation among correlated predictors in a multi-factor model. They agree when predictors are independent and can differ substantially when they are not.
This tool is provided for educational and analytical use. A sum of squares describes variation in a sample and is not on its own evidence that any model is correct.