# What is the sum of squares?

Computes the sum of squares of a list of numbers: the sum of squared deviations from the mean, Σ(x − x̄)², and the sum of the squared values, Σx², with the variance.

- Page: https://www.acalculator.org/statistics/sum-of-squares-calculator
- JSON spec: https://www.acalculator.org/statistics/sum-of-squares-calculator.json
- Version: 0cb14887b3a3

## Default answer

Example with the default inputs (Your numbers [2, 4, 4, 4, 5, 5, 7, 9]): The sum of squares of the 8 numbers is 32, around a mean of 5.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| data | Your numbers | The numbers, separated by commas, spaces, semicolons, or new lines. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| ss | Sum of squares (SS) | The sum of the squared deviations from the mean, Σ(x − x̄)². |
| sumSquares | Sum of squared values (Σx²) | Each number squared, then added up. |
| sum | Sum (Σx) | All the numbers added up. |
| mean | Mean (x̄) | The sum divided by the count. |
| sampleVariance | Sample variance (s²) | The sum of squares divided by n − 1. It needs at least 2 numbers. |
| populationVariance | Population variance (σ²) | The sum of squares divided by n. |
| n | Count (n) | How many numbers are in the list. |
| steps | Steps | The working, step by step. |

## Method

x̄ = Σx ÷ n; SS = Σ(x − x̄)² = Σx² − (Σx)² ÷ n; s² = SS ÷ (n − 1); σ² = SS ÷ n.

## Assumptions

- The numbers are exact decimals as typed; sums and the mean are exact, rounded once for display.
- The sample variance needs at least 2 numbers.

## Worked examples

1. data = 2 or 4 gives ss = 32, sumSquares = 232, sum = 40, mean = 5, sampleVariance = 4.571429, populationVariance = 4, n = 8. Source: OpenStax, Introductory Statistics 2e, §2.7 Measures of the Spread of the Data (deviation x − x̄; sample variance s² = Σ(x − x̄)² ÷ (n − 1)), https://openstax.org/books/introductory-statistics-2e/pages/2-7-measures-of-the-spread-of-the-data (retrieved 2026-10-05).
2. data = 0.1 or 0.2 gives ss = 0.02, sumSquares = 0.14, mean = 0.2, sampleVariance = 0.01. Source: OpenStax, Introductory Statistics 2e, §2.7 Measures of the Spread of the Data (deviation x − x̄; sample variance s² = Σ(x − x̄)² ÷ (n − 1)), https://openstax.org/books/introductory-statistics-2e/pages/2-7-measures-of-the-spread-of-the-data (retrieved 2026-10-05).
3. data = -3 or 5 gives ss = 32, sumSquares = 34, mean = 1, sampleVariance = 32, populationVariance = 16. Source: OpenStax, Introductory Statistics 2e, §2.7 Measures of the Spread of the Data (deviation x − x̄; sample variance s² = Σ(x − x̄)² ÷ (n − 1)), https://openstax.org/books/introductory-statistics-2e/pages/2-7-measures-of-the-spread-of-the-data (retrieved 2026-10-05).

## FAQ

### What is the sum of squares?

In statistics, the sum of squares (SS) is the total of the squared deviations from the mean: subtract the mean from each number, square each result, and add them up. It measures how spread out the numbers are. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the sum of squares is 32.

### Is the sum of squares the same as the sum of the squared values?

No. Σx² squares each number and adds the squares, with no mean taken away. Σ(x − x̄)² squares the distances from the mean. They are linked by Σ(x − x̄)² = Σx² − (Σx)² ÷ n. This page shows both.

### How is the sum of squares related to the variance?

The variance is the sum of squares divided by a count. For a sample, divide by n − 1 to get s². For a whole population, divide by n to get σ². The standard deviation is the square root of the variance.

### Can the sum of squares be negative?

No. Each squared deviation is 0 or more, so their sum is 0 or more. It is 0 only when every number is the same.

### Why square the deviations instead of adding them?

The deviations from the mean always add up to 0, because the values above the mean balance the values below it. Squaring makes every deviation count as a positive amount, and gives large deviations more weight.

### What are the total, regression and error sums of squares?

In regression and ANOVA, the total sum of squares SST is the sum of squares of the y values, as on this page. It splits into the part the model explains (SSR) and the part it leaves over (SSE, the sum of squared residuals). The residual calculator shows SSE for a straight line.

## Sources

- OpenStax, Introductory Statistics 2e, §2.7 Measures of the Spread of the Data: deviation x − x̄, sample variance s² = Σ(x − x̄)² ÷ (n − 1) and population variance σ² = Σ(x − μ)² ÷ N. https://openstax.org/books/introductory-statistics-2e/pages/2-7-measures-of-the-spread-of-the-data (retrieved 2026-10-05)
