StatisticsCALCULATOR LAB

Sum of Squares Calculator

Calculate the sum of squares from a list of numbers and see each step. Find the sum of squared deviations from the mean, the sum of squared values, and related variance measures without confusing these different calculations.

01 / YOUR INPUTSCalculated in your browser

Calculate the Sum of Squares

Try an example:
Separate numbers with commas, spaces, tabs, or line breaks. Use a period for decimals. Maximum 10,000 observations.
02 / YOUR RESULT

Your Sum of Squares Result

Enter your values, or choose an example. No result is calculated until you select the calculation button.

What Is the Sum of Squares in Statistics?

The sum of squares measures the total squared deviation of observations from a reference point, usually their mean. In descriptive statistics, the corrected sum of squares is the sum of (x−x̄)² over all observations. It is used to calculate variance and standard deviation.

Sum of Squares Formula

To calculate the corrected sum of squares, find the mean, subtract the mean from each observation, square each difference, and add the squared deviations.

SS = Σ(xᵢ−x̄)²; SS = Σxᵢ² − (Σxᵢ)²/n

An uncorrected or raw sum of squares instead adds the squared observations directly: Σxᵢ². These expressions generally produce different results.

How to Calculate Sum of Squares Step by Step

Enter the values, calculate their mean, and find each deviation from that mean. Square every deviation and add the results. The calculator displays the individual contributions so you can check the calculation by hand.

Corrected vs. Uncorrected Sum of Squares

The corrected sum of squares measures variation around the sample mean. The uncorrected sum of squares measures squared magnitude relative to zero. The two quantities answer different questions and should not be substituted for one another.

Sum of Squares and Variance

Sample variance divides corrected SS by n−1 when at least two observations are available. Population variance divides corrected SS by n. Standard deviation is the square root of the corresponding variance.

s² = SS/(n−1); σ² = SS/n

Compare sample and population measures with the Variance Calculator.

Sum of Squares in ANOVA and Regression

ANOVA and regression use several related sums of squares to describe explained and unexplained variation. Their definitions depend on the statistical model. The basic corrected SS calculated here should not automatically be interpreted as a regression or residual sum of squares.

Precision and Supported Inputs

Data calculations use the existing shifted, compensated two-pass algorithm, rather than subtracting nearly equal large totals. Inputs use browser double precision; decimals beyond its representable precision cannot be recovered. Overflow or unrepresentable spread produces an explicit error. Up to 10,000 observations are supported.

The first-n-natural-numbers mode uses exact BigInt arithmetic for n from 1 through 10³⁰. Its closed form is n(n+1)(2n+1)/6; it does not require generating n observations.

Worked Sum of Squares Examples

These examples use illustrative data, not your current inputs.

Example 1: Corrected Sum of Squares

For the data 2, 4, 4, 4, 5, 5, 7, 9, the mean is 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4, and 16. Adding them gives SS = 32.

Example 2: Raw Sum of Squares

For the same data, the sum of squared values is 2² + 4² + 4² + 4² + 5² + 5² + 7² + 9² = 232. This is different from the corrected sum of squares, which is 32.

Example 3: First Five Natural Numbers

The sum of the first five positive integer squares is 1² + 2² + 3² + 4² + 5² = 55. Using the formula n(n+1)(2n+1)/6 with n = 5 also gives 55.

Frequently Asked Questions

What does the sum of squares tell you?

The corrected sum of squares measures the total squared distance of observations from their mean. A larger value indicates more total variation, although it also depends on the number of observations.

How do you calculate sum of squares?

Find the mean, subtract it from each observation, square each difference, and add the squares. This gives the corrected sum of squares used in variance calculations.

Is the sum of squares the same as variance?

No. Variance is obtained by dividing the corrected sum of squares by n for a population or by n−1 for a sample.

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

Σx² adds the squares of the original values. Σ(x−x̄)² adds squared deviations from their mean. The second quantity measures variation around the mean.

Can I calculate sum of squares with negative numbers?

Yes. Negative observations are valid. Squaring the deviations makes every contribution nonnegative.

Why is the sample variance divided by n−1?

Using n−1 provides the usual unbiased estimator of population variance under independent sampling assumptions when the sample mean is estimated from the data.

Can the corrected sum of squares be zero?

Yes. It is zero when all observations have the same value because every deviation from the mean is zero.

Is this the same as the sum of squares in regression?

Not necessarily. Regression separates variation into model-related and residual components. This calculator primarily computes the basic corrected sum of squares for a data set.

Sources and Methodology

Corrected SS reuses the existing shifted, compensated two-pass descriptive-statistics engine unchanged. Individual contributions use the same centered offsets. Raw squares are separately accumulated with compensation. Natural-number sums use an exact BigInt closed form. Sample variance is undefined for one observation.

Reviewed: October 2026. Calculations run in your browser. No signup, upload, or server-side data processing is required. Read our methodology.