What is the sum of squares?
Paste a list of numbers to get its sum of squares, the sum of the squared distances from the mean, with the working shown step by step.
- Sum of squares (SS)
- 32
The sum of squares of the 8 numbers is 32, around a mean of 5.
- Sum of squared values (Σx²)
- 232
- Sum (Σx)
- 40
- Mean (x̄)
- 5
- Sample variance (s²)
- 4.571429
- Population variance (σ²)
- 4
- Count (n)
- 8
- Steps
- The mean is x̄ = 40 ÷ 8 = 5; Subtract the mean from each number and square it: 9, 1, 1, 1, 0, 0, 4, 16; Add the squares: SS = Σ(x − x̄)² = 32; For comparison, Σx² = 232, and Σx² − (Σx)² ÷ n = 232 − 1600 ÷ 8 = 32
Sum of squares (SS): 32. The sum of squares of the 8 numbers is 32, around a mean of 5.
How it is worked out
Where do your numbers fall?
How to calculate
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.
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.
Method: x̄ = Σx ÷ n; SS = Σ(x − x̄)² = Σx² − (Σx)² ÷ n; s² = SS ÷ (n − 1); σ² = SS ÷ n.
- 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
Each example is checked against the calculator on every build.
- Your numbers 2, 4, 4, 4, 5, 5, 7, 9 gives Sum of squares (SS) 32, Sum of squared values (Σx²) 232, Sum (Σx) 40, Mean (x̄) 5, Sample variance (s²) 4.571429, Population variance (σ²) 4, Count (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)
- Your numbers 0.1, 0.2, 0.3 gives Sum of squares (SS) 0.02, Sum of squared values (Σx²) 0.14, Mean (x̄) 0.2, Sample variance (s²) 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)
- Your numbers -3, 5 gives Sum of squares (SS) 32, Sum of squared values (Σx²) 34, Mean (x̄) 1, Sample variance (s²) 32, Population variance (σ²) 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)
How it works
For the n numbers x₁, x₂, …, xₙ:
- Sum Σx = x₁ + x₂ + … + xₙ, and mean x̄ = Σx ÷ n.
- Sum of squares SS = Σ(x − x̄)²: the deviation of each number from the mean, squared, then added up.
- Sum of squared values Σx² = x₁² + x₂² + … + xₙ².
- The two are linked: SS = Σx² − (Σx)² ÷ n.
- Sample variance s² = SS ÷ (n − 1), shown when n is 2 or more. Population variance σ² = SS ÷ n.
Rules:
- The list has 1 to 10,000 numbers. Every number counts, repeats included.
- The arithmetic is exact on the decimals you type: 0.1, 0.2 and 0.3 give SS = 0.02 exactly. Each result is rounded once for display.
- A result too large or too small to show as a number (beyond about 1.8 × 10³⁰⁸, or a nonzero value below about 5 × 10⁻³²⁴) gives no answer, with a message.
- The steps show up to 12 squared deviations, then "…".
Assumptions
- SS is about the mean of the numbers you enter. To measure squares about another value, subtract it first.
Worked examples by hand
2, 4, 4, 4, 5, 5, 7, 9 (the default). Σx = 40 and n = 8, so x̄ = 5. The deviations are −3, −1, −1, −1, 0, 0, 2, 4, and their squares are 9, 1, 1, 1, 0, 0, 4, 16, so SS = 32. Σx² = 4 + 16 + 16 + 16 + 25 + 25 + 49 + 81 = 232, and 232 − 40² ÷ 8 = 232 − 200 = 32, the same SS. s² = 32 ÷ 7 = 4.571429 and σ² = 32 ÷ 8 = 4.
0.1, 0.2, 0.3. x̄ = 0.2. SS = (−0.1)² + 0² + 0.1² = 0.02, Σx² = 0.01 + 0.04 + 0.09 = 0.14, and s² = 0.02 ÷ 2 = 0.01.
−3, 5. x̄ = 1. SS = (−4)² + 4² = 32, Σx² = 9 + 25 = 34, s² = 32 ÷ 1 = 32 and σ² = 32 ÷ 2 = 16.
Other questions people ask
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.