🧮
🧮 Math & statistics

Sum of Squares Calculator (SS = Σ(x − x̄)², Σx² and variance)

Results update as you type.

Your numbers

Understanding the sum of squares calculator — concept and principle

This calculator finds the sum of squared deviations from the mean, SS = Σ(x − x̄)², along with the mean, the raw sum of squares, the correction term, the sample and population variance and the sample standard deviation. Use it for statistics homework, ANOVA tables, regression and checking variance calculations by hand.

Sum of squared deviationsSquares of the distances from the mean2345678910mean 64 + 1 + 0 + 9 + 9 + 1 = 24SS = Σ(x − x̄)²24Σx² − (Σx)²÷n = 240 − 216 · s² = 4.8−3−2+1+3
Deviations −2, 1, 0, 3, −3, 1 from the mean 6 square to 4, 1, 0, 9, 9, 1, which add to 24.

How it is calculated

The page computes SS from the deviations directly, which avoids rounding loss in the shortcut for large numbers.

The principle

Deviations from the mean always add up to zero, so they cannot measure spread directly. Squaring them makes every deviation count positively and gives more weight to values far from the mean. SS is the total squared spread; dividing by the number of values (or by n − 1 for a sample) turns it into the variance. The shortcut formula comes from expanding (x − x̄)² and using Σx = n·x̄. In ANOVA and regression, the total SS is split into parts explained by the model and parts left over.

Worked example

Default data: 4, 7, 6, 9, 3, 7.

  1. Σx = 36, n = 6, mean = 6.
  2. Deviations: −2, 1, 0, 3, −3, 1.
  3. Squares: 4, 1, 0, 9, 9, 1; SS = 24.
  4. Check: Σx² = 240, correction (36)² ÷ 6 = 216, 240 − 216 = 24.
  5. Sample variance = 24 ÷ 5 = 4.8, s ≈ 2.19089023; population variance = 24 ÷ 6 = 4.

How to read the result

SS on its own grows with the number of values, so compare data sets using the variance or standard deviation instead. A SS of 0 means every value equals the mean. Use the sample variance when your data are a sample from a larger population, and the population variance when you have every member.

Common mistakes

Keep in mind: With very large values that differ only slightly, the shortcut formula can produce rounding errors or even negative results. Use the deviation method, as this page does.

Frequently asked questions

Why divide by n − 1 for a sample?

Deviations are measured from the sample mean, which is fitted to the data, so dividing by n would underestimate the population variance on average.

What is the difference between SS and variance?

Variance is SS divided by n or n − 1; SS is the undivided total.

What is the total sum of squares in regression?

Σ(y − ȳ)², the total variation of y, which the model splits into explained and residual parts.

Sources: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.6 Measures of Scale

Checked 9 Nov 2026. Standard formulas: SS = Σ(x − x̄)² = Σx² − (Σx)² ÷ n; sample variance SS ÷ (n − 1), population variance SS ÷ n.

🧮 All math & statistics tools →🌍 Calculators by country →