Sum of Squares Calculator
Compute the sum of squared deviations from the mean — the SS that sits inside variance, standard deviation, ANOVA, and regression — with every deviation shown, plus the computational shortcut formula for checking hand calculations.
Before You Calculate
- Paste raw data values separated by commas, spaces, or line breaks — at least two numbers.
- The result here is the total (corrected) sum of squares Σ(x − x̄)², the one used for variance; the raw Σx² is also reported for the shortcut formula.
- SS grows with both spread and sample size — divide by n or n − 1 (see below) to get a size-independent measure.
Enter numbers separated by commas, spaces, or line breaks
Related Calculators
Variance Calculator
Compute population or sample variance with every deviation and squared term shown.
Standard Deviation Calculator
Calculate standard deviation, variance, and spread with clear statistical outputs.
Pooled Standard Deviation Calculator
Combine two or more group standard deviations into the pooled estimate used by t-tests and effect sizes.
Learn More
n vs n−1: Bessel's Correction
Why sample variance divides by n−1: where the bias comes from, a tiny population where you can verify the fix by hand, and when plain n is correct.
How to Interpret R²
R² is the share of variance a regression explains. A worked example from five points, field-dependent benchmarks, and what high or low R² does not mean.
Two Formulas, One Number
Definitional: SS = Σ(xᵢ − x̄)²
Computational: SS = Σxᵢ² − (Σxᵢ)²/n
The definitional form says what SS means: square each value's distance from the mean and add them up. The computational form gives the same number without computing a single deviation — useful for hand calculation and the reason old textbooks tabulate Σx and Σx². The calculator reports both ingredients so you can verify the identity on your own data.
Squaring does two jobs: it makes all deviations positive so they cannot cancel (the raw deviations always sum to exactly 0 — see the middle column total), and it weights large deviations more heavily than small ones, which is precisely the sensitivity that variance-based statistics inherit.
Where SS Goes Next
SS is the raw material of the spread statistics: divide by n − 1 for the sample variance, take the square root of that for the sample standard deviation. In ANOVA, the total SS of all observations is partitioned into a between-groups part and a within-groups part (SST = SSB + SSW), and the F statistic compares the two. In regression, the same partition into explained and residual sums of squares produces R². Any time a statistical method talks about “explaining variation,” it is accounting for pieces of a sum of squares.
Worked Example: Both Routes to SS = 40
Take the data set 4, 8, 6, 5, 12.
Definitional route:
- Mean: (4 + 8 + 6 + 5 + 12) / 5 = 35 / 5 = 7.
- Deviations: −3, 1, −1, −2, 5 (they sum to 0, as they must).
- Squares: 9, 1, 1, 4, 25.
- Sum: SS = 40.
Computational route:
- Σx²: 16 + 64 + 36 + 25 + 144 = 285.
- (Σx)²/n: 35² / 5 = 1225 / 5 = 245.
- Difference: 285 − 245 = 40. Same answer, no deviations needed.
From here, the sample variance is 40 / 4 = 10 and the sample standard deviation is √10 ≈ 3.1623 — matching the standard deviation calculator on the same data.
Frequently Asked Questions
What is the sum of squares in statistics?
It is the sum of the squared deviations of each data value from the mean: SS = sum of (x - mean)^2. It measures the total variation in a data set - zero when all values are identical, and growing as values spread out. Variance and standard deviation are the sum of squares rescaled by the sample size.
What is the difference between the definitional and computational formulas?
They give identical results. The definitional formula sum((x - mean)^2) mirrors the concept; the computational formula sum(x^2) - (sum(x))^2/n avoids computing deviations entirely, which made it the standard for hand and calculator work. On computers the definitional form is preferred for numerical stability, and it is what this calculator uses internally.
Why do the deviations always sum to zero?
Because the mean is by definition the balance point of the data: values above it contribute positive deviations that exactly cancel the negative deviations of values below it. That is precisely why deviations must be squared (or absolute-valued) before summing - otherwise every data set would score 0 spread.
How do I get the variance and standard deviation from the sum of squares?
Divide SS by n - 1 for the sample variance or by n for the population variance, then take the square root for the corresponding standard deviation. With SS = 40 from 5 values: sample variance 40/4 = 10, sample SD = 3.1623; population variance 40/5 = 8, population SD = 2.8284.
What are SST, SSB, and SSW in ANOVA?
The total sum of squares (SST) of all observations around the grand mean splits exactly into the between-groups sum of squares (SSB), measuring how far group means sit from the grand mean, and the within-groups sum of squares (SSW), measuring scatter inside each group. ANOVA's F statistic is the ratio of these two parts, each divided by its degrees of freedom.
Is a larger sum of squares bad?
Not by itself - SS mixes together spread and sample size, so 100 observations of tight data can out-score 5 observations of wild data. To compare variability across data sets, use variance or standard deviation (SS per degree of freedom), or the coefficient of variation when the scales differ too.