Σ Sum of Squares Calculator
By ToolNimba Math Team · Updated 2026-06-19
Sum of squares adds each value squared. Total sum of squares adds the squared distance of each value from the mean.
The sum of squares is one of the most useful quantities in statistics, and it comes in two flavours that people often mix up. This calculator gives you both at once. Paste or type a list of numbers and it returns the algebraic sum of squares (each value squared, then all of them added) and the statistical total sum of squares (the sum of each value’s squared distance from the mean). It also shows the mean, the plain sum and the count, so you can check the workings or feed the result straight into a variance calculation.
What is the Sum of Squares Calculator?
There are two distinct things called the "sum of squares", and the right one depends on what you are doing. The first is the plain algebraic sum of squares: you square every number and add the squares together. For the set 1, 2, 3 that is 1 + 4 + 9 = 14. This version shows up in the Pythagorean theorem, in least-squares fitting, in physics (kinetic energy, moments of inertia) and anywhere you need the magnitude of a vector, because the length of a vector is the square root of the sum of its squared components.
The second is the statistical sum of squared deviations, usually written SS or the total sum of squares (TSS or SST). Here you first find the mean of the data, then for each value you take its distance from the mean, square that distance, and add them all up. For 1, 2, 3 the mean is 2, the deviations are -1, 0 and 1, and the squared deviations are 1, 0 and 1, giving SS = 2. This number measures how spread out the data is around its centre, and it is the engine behind variance and standard deviation: divide SS by n for the population variance, or by n minus 1 for the sample variance.
The two values are linked by a tidy identity. The sum of squared deviations equals the raw sum of squares minus n times the mean squared, that is SS = (sum of x^2) minus (sum of x)^2 / n. So if you already have the raw sum of squares and the plain sum, you can get the deviation form without recomputing every difference. This shortcut is exactly how spreadsheets and calculators compute variance quickly in a single pass over the data.
When to use it
- Getting the total sum of squares (SST) as the starting point for variance, standard deviation, or an ANOVA table.
- Computing the residual or explained sum of squares when fitting a regression line by least squares.
- Checking homework or exam answers in a statistics course where both forms of the sum of squares are tested.
- Finding the squared magnitude of a vector (the raw sum of squares of its components) for a physics or geometry problem.
How to use the Sum of Squares Calculator
- Type or paste your numbers into the box, separated by commas, spaces, or new lines.
- Read the count and the plain sum to confirm every value was picked up.
- Use the algebraic sum of squares for vector length, least squares, or physics work.
- Use the total sum of squares (squared deviations from the mean) when you need variance or spread.
Formula & method
Worked examples
Find both sums of squares for the data set 4, 8, 15, 16, 23, 42.
- Square each value: 16, 64, 225, 256, 529, 1764
- Add them: sum of squares = 16 + 64 + 225 + 256 + 529 + 1764 = 2854
- Mean = (4 + 8 + 15 + 16 + 23 + 42) / 6 = 108 / 6 = 18
- Deviations from the mean: -14, -10, -3, -2, 5, 24
- Square the deviations: 196, 100, 9, 4, 25, 576
- Add them: total sum of squares = 196 + 100 + 9 + 4 + 25 + 576 = 910
Result: Sum of squares = 2854, total sum of squares (squared deviations) = 910
Find both sums of squares for the data set 2, 4, 4, 4, 5, 5, 7, 9.
- Square each value: 4, 16, 16, 16, 25, 25, 49, 81
- Add them: sum of squares = 4 + 16 + 16 + 16 + 25 + 25 + 49 + 81 = 232
- Mean = 40 / 8 = 5
- Deviations from the mean: -3, -1, -1, -1, 0, 0, 2, 4
- Square the deviations: 9, 1, 1, 1, 0, 0, 4, 16
- Add them: total sum of squares = 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32
Result: Sum of squares = 232, total sum of squares (squared deviations) = 32
The two sums of squares compared
| Quantity | What you square | Formula | Used for |
|---|---|---|---|
| Sum of squares | Each raw value | x1^2 + x2^2 + ... + xn^2 | Vector length, least squares, physics |
| Total sum of squares | Each deviation from the mean | (x1 - mean)^2 + ... + (xn - mean)^2 | Variance, standard deviation, ANOVA |
Worked values for small data sets
| Data set | Mean | Sum of squares | Total sum of squares |
|---|---|---|---|
| 1, 2, 3 | 2 | 14 | 2 |
| 2, 4, 6, 8 | 5 | 120 | 20 |
| 4, 8, 15, 16, 23, 42 | 18 | 2854 | 910 |
| 10, 10, 10 | 10 | 300 | 0 |
Common mistakes to avoid
- Squaring the sum instead of summing the squares. The sum of squares (square each value, then add) is not the same as the square of the sum (add first, then square). For 1, 2, 3 the sum of squares is 14, but the square of the sum is 6^2 = 36. Watch the order of operations.
- Confusing the two sums of squares. The algebraic sum of squares uses the raw values, while the total sum of squares uses deviations from the mean. They are equal only when the mean is zero. Always check which one your formula or assignment is asking for.
- Using the wrong mean for grouped data. When you split data into groups (as in ANOVA), the total sum of squares uses the overall grand mean, not a group mean. Mixing them up gives the wrong partition into between-group and within-group sums of squares.
- Treating a tiny total sum of squares as an error. If every value is identical, the deviations are all zero and the total sum of squares is exactly 0. That is correct, it just means there is no spread. The raw sum of squares is still positive in that case.
Glossary
- Sum of squares
- The result of squaring every value in a list and adding the squares together.
- Total sum of squares (SST)
- The sum of each value’s squared distance from the mean, a measure of total spread in the data.
- Deviation
- The signed difference between a single value and the mean of the data set.
- Mean
- The arithmetic average, found by dividing the sum of the values by how many there are.
- Variance
- The total sum of squares divided by n (population) or by n minus 1 (sample).
Frequently asked questions
What is the sum of squares?
In the simplest sense, the sum of squares is what you get when you square every number in a list and add the squares together. For 1, 2, 3 that is 1 + 4 + 9 = 14. In statistics the phrase usually means the total sum of squares: the sum of each value’s squared distance from the mean.
What is the difference between sum of squares and total sum of squares?
The plain sum of squares squares the raw values and adds them. The total sum of squares first subtracts the mean from each value, squares those deviations, then adds them. The two are equal only when the mean is zero. This calculator shows both so you do not have to guess which is wanted.
How do I calculate the total sum of squares by hand?
Find the mean of your data, then for each value subtract the mean and square the result. Add all those squared deviations together. As a shortcut you can also use SS = (sum of x^2) - (sum of x)^2 / n, which avoids computing each difference separately.
How is the sum of squares related to variance?
Variance is the average squared deviation, so it is just the total sum of squares divided by a count. Divide the total sum of squares by n for the population variance, or by n minus 1 for the sample variance. Taking the square root gives the standard deviation.
Can the sum of squares be zero or negative?
The total sum of squares is zero only when every value equals the mean, that is when all values are identical. It can never be negative, because squaring always gives a value of zero or more. The same is true of the raw sum of squares.
What separators can I use for my numbers?
You can separate values with commas, spaces, new lines, or semicolons, and you can mix them freely. The calculator ignores blank entries and anything that is not a valid number, then reports the count so you can confirm every value was read.