Sum of Squares Calculator

Paste a list to see its sum of squares, both Σ(x − x̄)² and Σx², with a step table and a chart. A second tab splits several groups into between, within and total sum of squares.

Loading calculator…

This free sum of squares calculator finds the sum of squared deviations from the mean (SS), the quantity behind variance, ANOVA and regression. It also gives the raw sum of squares Σx², so you can see which of the two your problem asks for. A check line proves the shortcut formula gives the same answer.

Every step is shown line by line as a step-by-step solution, so you can check each one against your own working.

How to use this sum of squares calculator

  1. Add your numbers. Put one per line or separate them with commas. Values pasted straight from a spreadsheet column are fine.
  2. Press Calculate. You get Σ(x − x̄)², the raw Σx², the mean, a check line, a working table and a bar chart.
  3. Comparing groups? Open the Groups tab, paste one box per group, and read the between, within and total sums of squares.

Any entry that is not a number gets skipped and named in a note. A single value or a list of identical values gives a sum of squares of 0, and the tool says so.

What is the sum of squares in statistics?

The sum of squares (SS) adds up the squared gaps between every value and the mean of the data. Because every gap is squared, values below the mean cannot cancel out those above it, and bigger gaps count far more. A small SS means tightly bunched values, and a large SS means widely scattered ones.

The name is used for two different sums. In statistics it means Σ(x − x̄)², also called the sum of squared deviations (or squared differences from the mean), the corrected sum of squares, or the total sum of squares (TSS or SST). In algebra it can mean Σx², the sum of x squared, also called the algebraic sum of squares or the uncorrected sum of squares, which squares the raw values. This page shows both and labels them, so you can choose whichever fits your problem.

Sum of squares formula

The sum of squares equation for a data set, usually written as the sum of squares formula, adds up each value minus the mean, squared:

SS = Σ(xᵢ − x̄)²

A shortcut that avoids working out every deviation gives the same number:

SS = Σx² − (Σx)² ÷ n

Symbols in the sum of squares formula
SymbolMeaning
xᵢOne value in the data
x̄The mean of the data, Σx ÷ n
nHow many values there are
Σx²The raw sum of squares: square every value, then add
(Σx)²Add all values first, then square the total

The shortcut is handy by hand and in code, but it can lose accuracy for large values with small spread, so this calculator uses the first form and shows the shortcut only as a check.

How to calculate the sum of squares: worked example

Here is how to calculate sum of squares by hand, the same way the sum of squares calculator does it. Work out the sum of squares of 3, 5, 7, 8 and 12.

Sum of squares example: values 3, 5, 7, 8, 12 with mean 7 give squared deviations 16, 4, 0, 1, 25 and a total of 46
  1. Work out the mean: (3 + 5 + 7 + 8 + 12) ÷ 5 = 35 ÷ 5 = 7.
  2. Take the mean away from every value: −4, −2, 0, 1 and 5.
  3. Square every difference: 16, 4, 0, 1 and 25.
  4. Add them: 16 + 4 + 0 + 1 + 25 = 46.
Step table for 3, 5, 7, 8 and 12 (mean 7)
Value xDeviation x − 7Squared deviationShare of SS
3−41634.8%
5−248.7%
7000.0%
8112.2%
1252554.3%
Total046100%

Check with the shortcut: Σx² = 9 + 25 + 49 + 64 + 144 = 291 and (Σx)² ÷ n = 35² ÷ 5 = 245, so 291 − 245 = 46. The raw sum of squares is 291, which is a different number from the statistical sum of squares of 46. Notice that the deviations cancel to 0; if yours do not, recheck the mean.

From sum of squares to variance and standard deviation

The sum of squares is the first step in most spread measures. Divide it by a count to get the variance, then take the square root for the standard deviation. For the example above, SS = 46 gives a sample variance of 46 ÷ 4 = 11.5 and a population variance of 46 ÷ 5 = 9.2.

To see which divisor to use, open the variance calculator, which explains sample versus population. For the square root and a picture of the spread, use the standard deviation of the same list or the standard deviation graph. Comparing spread across lists with different units? The coefficient of variation scales it by the mean.

What the sum of squares tells you and what it is used for

On its own, a sum of squares says how much total variation a list holds: 0 means no variation, and a bigger number means more. Because it grows with every extra value, it is mostly a building block rather than a final answer.

  1. Variance and standard deviation. Divide SS by a count, then take a square root (see the section above).
  2. ANOVA. A one-way analysis of variance splits the total sum of squares into between-groups and within-groups parts, divides each by its degrees of freedom, and compares them with an F ratio. The Groups tab gives you the two sums of squares and the degrees of freedom for that first step.
  3. Regression. The total sum of squares of the y values is the benchmark that a fitted line is measured against, through its explained (regression) and unexplained (error or residual) parts.

If you know the mean and the sample standard deviation s but not the data, the sum of squares is SS = (n − 1) × s². For the list 3, 5, 7, 8 and 12, s² = 11.5 and n = 5, so SS = 4 × 11.5 = 46.

Total, between and within sum of squares for groups

When data come in groups, the total sum of squares (SST) splits into two parts. The within-groups sum of squares adds the spread inside each group around its own mean. The between-groups sum of squares measures how far each group mean sits from the overall mean, weighting each group by its size. SS total = SS between + SS within.

Take three groups, A (4, 6, 8), B (7, 9, 11) and C (10, 12, 14). Their means are 6, 9 and 12, and the overall mean is 9.

Total sum of squares 78 split into between-groups 54 and within-groups 24 for three groups with means 6, 9 and 12
Between and within sums of squares for three groups
GroupnGroup meanSS withinn × (mean − 9)²
A36827
B3980
C312827
Total99 (overall)2454

The total sum of squares of all nine values around 9 is 78, and 54 + 24 = 78. This split is the starting point of a one-way ANOVA. The Groups tab shows the three sums of squares and the degrees of freedom (2 between, 6 within, 8 total); it does not run the F test.

Sum of squares with DEVSQ, SUMSQ and a TI calculator

Spreadsheet and calculator methods for the sum of squares
ToolStatistical SS Σ(x − x̄)²Raw Σx²
Excel or Google Sheets=DEVSQ(A2:A6)=SUMSQ(A2:A6)
Shortcut formula=SUMSQ(A2:A6)−SUM(A2:A6)^2/COUNT(A2:A6)–
TI-83 / TI-84STAT, CALC, 1-Var Stats on list L1; SS = (n − 1) × Sx²Σx² is shown on the 1-Var Stats screen

DEVSQ and SUMSQ are built into both Excel and Google Sheets. Under the results, the calculator writes the formulas with your own cell range. On a TI, use the stored values rather than the rounded Sx on screen when you need the exact SS.

Sum of squares from 1 to n

A different, purely algebraic question asks for the sum of the first n square numbers, 1² + 2² + … + n². There is a closed formula, so no list is needed:

1² + 2² + 3² + … + n² = n(n + 1)(2n + 1) ÷ 6

For n = 10 it gives 10 × 11 × 21 ÷ 6 = 385, and for n = 5 it gives 55. To check it here, paste 1, 2, 3, 4, 5 and read the raw sum of squares Σx², which is 55. The statistical sum of squares of that same list is a different number, 10.

Common mistakes with the sum of squares

  1. Mixing up the two meanings. Σ(x − x̄)² and Σx² are different numbers. Use whichever your textbook or course needs.
  2. Squaring the sum of the deviations. The deviations add to 0. Square each one first, then add.
  3. Forgetting that SS grows with n. More values mean a bigger SS, so compare variances, not sums of squares, across lists of different sizes.
  4. Rounding the mean too early. Round only the final answer, or use the shortcut formula with exact sums.

For other ways to measure centre and spread, see the descriptive statistics hub. A weighted data set needs the weighted average calculator instead, and the mean calculator covers the first step on its own.

Sum of squares calculator FAQs

What is the sum of squares in statistics?

The sum of squares (SS) measures how far values are from their mean. Measure each value’s gap to the mean, square it, then total the squares: SS = Σ(x − x̄)². For 3, 5, 7, 8 and 12 the mean is 7 and SS comes to 46. A bigger SS means the values are more spread out.

What is the sum of squares formula?

The sum of squares formula is SS = Σ(x − x̄)². A shortcut that gives the same number is SS = Σx² − (Σx)² ÷ n. For 3, 5, 7, 8 and 12, Σx² is 291 and (Σx)² ÷ n is 35² ÷ 5 = 245, so SS = 291 − 245 = 46.

How do I find and calculate the sum of squares?

Compute the mean, deduct it from each value, square those gaps and sum them. With 3, 5, 7, 8 and 12 the mean is 7, the squared differences are 16, 4, 0, 1 and 25, and their total is 46. The calculator shows these same steps in a table for your own numbers.

What is the total sum of squares?

The total sum of squares (SST) is the sum of squared deviations of every value from the overall mean, Σ(x − x̄)², taken over all the data. For one list it is just the SS above. For grouped data it equals the between-groups SS plus the within-groups SS, which the Groups tab shows.

What is the difference between Σ(x − x̄)² and Σx²?

Σ(x − x̄)² squares the distance from the mean and measures spread. Σx² squares the raw values and ignores the mean, so it also grows when the values are simply large. For 3, 5, 7, 8 and 12 they are 46 and 291. Statistics uses the first; algebra problems often ask for the second.

What is the sum of squared deviations?

The sum of squared deviations is another name for the statistical sum of squares: measure each gap to the mean, square it, then total. People also call it SS, SSD, or SSx. Dividing it by n − 1 or by n gives the variance, which the variance calculator does for you.

How are the sum of squares and the variance related?

Variance is the sum of squares divided by a count. For the list 3, 5, 7, 8 and 12 the sum of squares is 46, so the sample variance is 46 ÷ 4 = 11.5 and the population variance is 46 ÷ 5 = 9.2. Its square root is the standard deviation.

What are between-groups and within-groups sum of squares?

Within-groups SS adds up the spread inside each group around its own mean. Between-groups SS measures how far each group mean is from the overall mean, weighted by group size. They always add to the total: in the three-group example, 54 + 24 = 78.

Can the sum of squares be negative or zero?

It can never be negative, because every term is a square. It is zero only when all values are identical, such as 5, 5 and 5, or when there is a single value. Any difference between values makes it positive.

What are residual and regression sum of squares?

In regression, the total sum of squares splits into a part explained by the fitted line and a leftover residual part. The total is the same Σ(y − ȳ)² this calculator finds for one column of y values, and the leftover part is the residual or error sum of squares (SSE). This page does not fit a regression line.

How do I find the sum of squares in Excel?

Use =DEVSQ(A2:A6) for the sum of squared deviations from the mean, and =SUMSQ(A2:A6) for the sum of the raw squares. Another route is =SUMSQ(A2:A6)−SUM(A2:A6)^2/COUNT(A2:A6), which is the shortcut formula. All three agree with the calculator.

How do I find the sum of squares on a TI-83 or TI-84?

Put the data in list L1, then open STAT, CALC, 1-Var Stats. The screen shows Σx² directly, which is the raw sum of squares. For the statistical SS, multiply the sample standard deviation squared by n − 1, or use the shortcut Σx² − (Σx)² ÷ n with the Σx and Σx² shown.

Why does the sum of squares get larger with more data?

Each extra value adds another squared term, so SS grows with sample size even when the spread stays the same. To compare spread between lists of different sizes, divide by a count (the variance) or use the standard deviation instead.

What is the sum of squares from 1 to n?

It is the sum of the first n square numbers, 1² + 2² + … + n², which equals n(n + 1)(2n + 1) ÷ 6. For n = 10 the result is 385. This is the raw sum of squares Σx² of the list 1, 2, …, n, not the statistical sum of squares around the mean.

What does the sum of squares tell you?

It tells you how much total variation a data set contains. Zero means every value equals the mean, and a larger number means the values are more spread out. Since it grows with the number of values, divide by a count (variance) or compare standard deviations when lists differ in size.

How do I find the sum of squares from the mean and standard deviation?

Square the sample standard deviation to get the variance, then multiply by n − 1: SS = (n − 1) × s². With s² = 11.5 and n = 5, SS = 4 × 11.5 = 46. For a population standard deviation, multiply the variance by n instead.

What is the corrected sum of squares?

The corrected sum of squares is another name for Σ(x − x̄)², the sum of squared deviations from the mean. It is called corrected because the mean has been subtracted. The uncorrected sum of squares is Σx², which works from zero instead of from the mean.

Easy Stat Calc · Results checked against Python, R and Excel · Last updated November 11, 2026 · Methodology