Sum Of Squares Calculator

Last Updated: June 24, 2026

Calculate the sum of squares from a data set, a list of numbers, the first n natural numbers, or two squares, with step-by-step results.

Sum of Squares Calculator

Enter two or more numbers separated by commas, spaces, or new lines.
A positive whole number. Sums 1² through n².

Sum of Squares Formula

The formula depends on which sum of squares you need. This calculator handles four common cases.

Sum of squared deviations from the mean (the statistics version):

SS = Σ(xᵢ − x̄)²

Sum of the squares of a list of numbers:

Σx² = x₁² + x₂² + … + xₙ²

Sum of the squares of the first n natural numbers:

1² + 2² + … + n² = n(n + 1)(2n + 1) / 6

Sum of two squares:

a² + b²
  • SS = the sum of squared deviations, also called the total sum of squares
  • xᵢ = each individual value in the data set
  • x̄ = the mean (average) of the data set
  • n = the count of values, or the highest natural number in the sequence
  • a, b = the two numbers being squared and added

In the statistics mode, each value has the mean subtracted from it, the difference is squared so negatives do not cancel positives, and all the squared differences are added together. That single number, SS, is the building block for variance, standard deviation, and ANOVA. The list mode simply squares every number you enter and adds the results, with no mean involved. The natural numbers mode uses the closed-form expression n(n + 1)(2n + 1) / 6 so you do not have to square and add each term by hand. The two squares mode adds a² and b², which appears in the Pythagorean theorem and in distance calculations.

Sum of Squares Reference Values

The table below shows the running sum of squares for the first n natural numbers. Use it to spot-check the natural numbers mode.

n1² + 2² + … + n²
11
25
314
430
555
10385
202,870
5042,925
100338,350

The next table explains what the statistical sum of squares (SS) tells you once you have it.

ResultWhat it means
SS = 0Every value equals the mean. There is no spread in the data.
Small SSValues sit close to the mean. Low variability.
Large SSValues are spread far from the mean. High variability.
SS / (n − 1)Sample variance. Take the square root for the sample standard deviation.

Example Problems

Example 1: Find the sum of squared deviations for the data set 4, 8, 6, 5, 3.

First find the mean: (4 + 8 + 6 + 5 + 3) / 5 = 26 / 5 = 5.2. Next subtract the mean from each value and square the result: (4 − 5.2)² = 1.44, (8 − 5.2)² = 7.84, (6 − 5.2)² = 0.64, (5 − 5.2)² = 0.04, (3 − 5.2)² = 4.84. Add them up: 1.44 + 7.84 + 0.64 + 0.04 + 4.84 = 14.8. The sum of squares is 14.8.

Example 2: Find the sum of the squares of the first 5 natural numbers.

Use n(n + 1)(2n + 1) / 6 with n = 5: 5 × 6 × 11 / 6 = 330 / 6 = 55. You can check this by adding 1 + 4 + 9 + 16 + 25 = 55.

FAQ

What is the sum of squares used for?

In statistics, the sum of squared deviations measures how far a set of values spreads out from its mean. It is the first step in computing variance, standard deviation, and the totals used in regression and ANOVA. Outside of statistics, the sum of squares of a list of numbers or of consecutive integers shows up in algebra, number theory, and geometry.

Why do you square the deviations instead of just adding them?

If you added the raw deviations from the mean, the positive and negative differences would cancel out and the total would always be zero. Squaring each deviation makes every term positive, so the sum reflects the true amount of spread. Squaring also gives larger deviations more weight than smaller ones.

Is the sum of squares the same as the variance?

No. The sum of squares is the total of the squared deviations. The variance is that total divided by the number of values (n for a population) or by n − 1 (for a sample). So the sum of squares is the numerator, and the variance scales it by the sample size.

Sum Of Squares Calculator