Skip to main content

Sum of Squares Calculator

The sum of squares is one of those names that hides three different quantities. SS = Σ(xᵢ - x̄)² adds up the squared distances from the mean and is the smallest such total any reference point could produce. Σxᵢ² adds up the raw squares and grows without bound as the numbers grow. And in an ANOVA, SS splits into a part the groups explain and a part they leave behind.

The usual sum of squared deviations, a sum about any reference value, the computational shortcut, or the one-way ANOVA split.

The observations in any order; they are used exactly as entered, so an unsorted list is fine.

The point every value is measured against. Zero measures from the origin; the mean gives the smallest possible sum.

One group per vertical bar, at least two groups. Group sizes may differ, and each group needs at least two values for a within-group spread.

Calculated Result
32

Sum of squares about the mean

Sum of squares (SS)

32

Count

8

Mean

5

Sum of the values

40

Sum of the squared values

232

Population variance (SS ÷ n)

4

Sample variance (SS ÷ n − 1)

4.571429

Root mean square deviation

2

Largest single contribution

16

8 values averaging 5 — Population variance 4

Calculation Breakdown

  1. Find the meanThe 8 values add to 40, so the mean is 40 ÷ 8 = 5.x̄ = Σx / n
  2. Measure every value against the meanSquaring each deviation removes the sign, so values above and below the mean add rather than cancel.dᵢ = xᵢ - x̄
  3. Add the squared deviationsThe squared deviations add to 32, which is the smallest sum of squares any reference point could produce.SS = Σ(xᵢ - x̄)²
  4. Turn it into a varianceDividing by n − 1 = 7 gives a sample variance of 4.571429; dividing by n = 8 gives 4 instead.s² = SS / (n - 1)

What each value contributes to the sum of squares

Interactive visualization based on your current inputs

Squared contribution
0.04.08.01216#1#2#3#4#5#6#7#8ObservationSquared contribution

What Is the Sum of Squares Calculator?

The sum of squares is the total of the squared differences between observations and the point they are measured from. Change the point and the total changes, which is the whole difficulty in the subject: the name covers at least three different quantities and no default reference is assumed.

The form that matters in statistics is the one taken about the mean, SS = Σ(xᵢ - x̄)². It is the smallest total any reference can produce, it carries squared units, and dividing it by the degrees of freedom turns it into a variance. Everything else, including the raw Σx² and the ANOVA split, is either bigger or a partition of it.

How Does the Sum of Squares Calculator Work?

Order of operations never matters. The mean is subtracted from each value, the result is squared, and the squares are added. Squaring is what makes the measure work: without it, deviations above and below the mean would cancel and spread would look like none.

Shifting the reference from the mean to c adds exactly n(x̄ - c)² to the total. That single term is the parallel-axis rule, and it explains why two analysts can report different sums of squares for identical data without either of them making an arithmetic mistake.

Rearranging the same algebra gives the computational form SS = Σxᵢ² - (Σx)²/n, which needs no mean. It is faster to compute and much worse conditioned: both terms on the right are typically far larger than their difference, so the subtraction cancels away significant digits.

In one-way ANOVA the total sum of squares about the grand mean decomposes exactly into the between-group part Σnᵢ(x̄ᵢ - x̄)² and the within-group part ΣᵢΣ(x - x̄ᵢ)². Dividing by k - 1 and n - k respectively gives mean squares whose ratio is the F statistic.

Sum of Squares Calculator Formula & Variables

The core mathematical equation utilized by this calculator is expressed as:

SS=∑i=1n(xi−xˉ)2,s2=SSn−1,SS(c)=SS(xˉ)+n(xˉ−c)2,SStotal=SSbetween+SSwithinSS = \sum_{i=1}^{n} (x_i - \bar{x})^{2}, \qquad s^{2} = \frac{SS}{n-1}, \qquad SS(c) = SS(\bar{x}) + n(\bar{x} - c)^{2}, \qquad SS_{total} = SS_{between} + SS_{within}

Variable Definitions

SymbolVariable Meaning & Units
xᵢthe i-th observation, exactly as entered
x̄the mean of the values, Σx / n
cany reference value the squares are measured from
nnumber of values in the list or in all the groups
SSBbetween-group sum of squares, Σnᵢ(x̄ᵢ - x̄)²
SSWwithin-group sum of squares, ΣᵢΣ(x - x̄ᵢ)²

Squaring the deviations is what makes the measure work: it removes the sign, so values above and below the mean add instead of cancelling, and the result is as small as possible when the reference is the mean. Shifting the reference to c adds exactly n(x̄ - c)², the parallel-axis rule. The computational form rearranges the same algebra into Σx² - (Σx)²/n, which saves the mean but subtracts two large nearly equal numbers. In one-way ANOVA the total about the grand mean splits exactly into the between-group and within-group parts.

How to Use the Sum of Squares Calculator

  1. Start with the deviation mode, which answers the usual question and shows every contribution separately, so one wrong value is visible rather than hidden in a total.
  2. Use the about mode when the reference is not the mean: a target, a baseline, a specification limit, or zero when you want Σx². The summary always splits the total into the part about the mean and the n(x̄ - c)² offset.
  3. Use the computational mode to see the shortcut rather than to trust it. It prints both forms and warns when the answer is a tiny fraction of the numbers being subtracted.
  4. Use the groups mode for one-way ANOVA data. Check that the between and within figures add to the total; if they do not, a group was typed in twice or a size is wrong.
  5. Read the category line before quoting a result. A warning means a single value with no spread, or a computational form that has lost digits.

Step-by-Step Example Calculation

Sum of squares of eight values, and the variance it implies

Input Values:

mode:deviation
values:2, 4, 4, 4, 5, 5, 7, 9
Worked Steps: The mean is 5, so the squared deviations are 9, 1, 1, 1, 0, 0, 4 and 16, adding to SS = 32. Dividing by n − 1 = 7 gives a sample variance of 4.571429 and a standard deviation of 2.13809, while Σxᵢ² = 232 measures the same data from the origin instead.

Understanding Your Result

The per-value table is the real result. Being able to see that one observation contributes 9 of a total of 32 tells you something no total can, and it is how an outlier is caught before it reaches a report.

A total of zero is a fact, not a failure. It means every value is identical, and a variance of zero follows immediately rather than being an error to explain away.

Between and within sums of squares answer different questions. A large between figure means the groups differ; a large within figure means the data are noisy regardless of grouping. Neither one on its own is a test result.

The F ratio is a ratio, not a verdict. It needs a comparison against an F distribution with the same two degrees of freedom before it can be called significant.

Factors That Affect the Result

  • The reference point. Moving it off the mean adds n(x̄ - c)², so the same data can produce almost any total.
  • The size of the numbers. Large values push Σx² and (Σx)²/n close together and hollow out the computational form.
  • Outliers. A single far value is squared, so its contribution grows with the square of its distance rather than linearly.
  • Group sizes in the ANOVA split. Between-group sums of squares weight each group mean by its size, so one large group dominates the total.

When Should You Use This Calculator?

  • Checking a variance or standard deviation someone else has reported.
  • Finding how much of a data set one unusual value is responsible for.
  • Building or verifying a one-way ANOVA table by hand.
  • Comparing a sum of squares against a reference such as zero, a baseline, or a specification limit.

Assumptions & Limitations

  • The observations are assumed independent. Repeated measurements on the same subject inflate the total and make every downstream variance and F ratio optimistic.
  • Nothing is assumed about the shape of the data, which is why the measure survives non-normal inputs, but a heavily skewed set still makes the sum of squares sensitive to its tails.
  • The computational form assumes nothing and yet still loses precision; the warning is about arithmetic conditioning, not about the data being wrong.
  • The groups mode implements the one-way layout only. Repeated measures, blocking, and unbalanced designs all need their own sums of squares beyond the three reported here.

Frequently Asked Questions

Calculation Accuracy & Reference Note

The deviation form adds terms that cannot cancel, so it is accurate to full double precision for any realistic data. The computational form is reported alongside it precisely because its error depends on how far the data sit from zero, and the difference between the two is printed rather than hidden.

Standard Reference: Standard least-squares and one-way ANOVA identities; the computational and parallel-axis forms follow from expanding (xᵢ - x̄)².