Sum of Squares Calculator

Sum of Squares Calculator

Measure total squared variation around the mean for a dataset of 2 to 50 numbers.

Values 3 Mean 20 SS 8
Excel export is ready for the demonstration data.

Data values

Enter 2 to 50 finite numbers. Use a period for decimals; commas are accepted only as thousands separators.

Results

Sum of squares (SS)
8
Mean
20
Minimum
18
Maximum
22
SS = Σ(yi – ȳ)², where ȳ is the arithmetic mean of the entered values.
For 3 values, the mean is 20 and the sum of squares is 8.

Deviation breakdown

Data point Value Deviation (yi – ȳ) Squared deviation
y1 20 0 0
y2 22 2 4
y3 18 – 2 4
Sum of squared deviations 8
The squared-deviation column is the exact series summed to produce SS. A value equal to the mean contributes zero; values farther from the mean contribute quadratically more.

How to use this sum of squares calculator

What this calculator does

This calculator computes the total sum of squared deviations from the arithmetic mean for one numeric dataset. In statistics, that quantity is commonly called the total sum of squares, or simply the sum of squares when the context is unambiguous. It is a direct measure of aggregate squared variation: if all values are identical, SS is zero; as observations move farther from their mean, SS increases. The calculation is an exact identity for the entered numbers, but it is not by itself a probability statement, significance test, outlier rule, or model-quality verdict. For a broader discussion of squared deviations and variability, see the NIST guidance on measures of scale.

When to use it

Use SS when you need the numerator behind sample variance, when you are checking a hand calculation of dispersion, when you want a transparent deviation-by-deviation audit trail, or when you are preparing to decompose variability in ANOVA or regression. Because the statistic uses squared units, compare raw SS values cautiously across datasets with different sample sizes or measurement scales.

How to calculate

  1. The calculator opens with the demonstration values 20, 22, and 18, so the result table and a validated Excel workbook are available immediately. Replace any value directly, remove rows you do not need, or use Add value to expand the dataset up to 50 observations.
  2. Read Sum of squares (SS) as the primary result. Mean, Minimum, and Maximum provide context, while the deviation table shows exactly how each observation contributes to SS.
  3. Choose Download Excel to export the current validated inputs and calculations. Reset clears the demonstration data to two blank entry rows; after Reset, Excel export remains disabled until at least two valid numbers have been entered again.

Input guide

Data values are the only statistical input. They are required as a collection: at least two and at most 50 finite numbers must be present. Enter plain integers or decimal numbers using a period as the decimal separator, such as 18, 22.5, or 1,250.75. Commas are accepted only in conventional thousands groups, so an ambiguous decimal-comma entry such as 1,5 is rejected rather than silently interpreted as 15. Scientific notation is also rejected to keep pasted values explicit. Negative values and zero are valid because deviations around a mean may come from any real-valued measurement scale. Extremely large magnitudes are limited so that squaring the deviations remains finite. Increasing or decreasing a single observation can change both the mean and every row's deviation, so its effect on SS is not simply the square of the edit itself.

Output guide

Sum of squares (SS) is Σ(yi – ȳ)² in squared input units. It is always nonnegative; zero means every entered value is identical. Mean is the arithmetic average that defines the center used for every deviation. Minimum and Maximum are the smallest and largest entered observations, useful for spotting the range of the data but not substitutes for SS. The header pills Values, Mean, and SS repeat the same canonical results in compact form. In the Deviation breakdown table, Data point identifies the observation, Value is the entered number, Deviation (yi – ȳ) is its signed distance from the mean, and Squared deviation is that distance squared. The footer adds the squared deviations and therefore must equal the primary SS result exactly apart from display rounding.

Worked example

For the startup dataset 20, 22, and 18, the mean is (20 + 22 + 18) / 3 = 20. The deviations are 0, 2, and – 2. Squaring them gives 0, 4, and 4, so SS = 0 + 4 + 4 = 8. This is the same value shown in the primary result, the SS pill, the table footer, and the downloadable workbook. A second useful check is 30, 33, and 35: the mean is about 32.6667 and SS is about 12.6667.

Learn more

The NIST Dataplot sum-of-squares reference documents the related uncentered sum-of-squares operation, while the Penn State lesson on regression sums of squares shows how total, regression, and error sums of squares are used to partition variability in a model.

How the sum of squares formula works

SS = Σ(yi – ȳ)²

First compute the mean ȳ. Next subtract that mean from every observation. Those signed deviations always sum to approximately zero, so simply adding them would erase the spread. Squaring each deviation removes the sign and gives greater weight to observations farther from the center. Summing the squared deviations produces SS. This same numerator appears in the familiar sample-variance formula s² = SS / (n – 1), which is why SS is foundational in descriptive statistics.

SS depends on both scale and sample size. If every measurement is multiplied by 10, each deviation is multiplied by 10 and SS becomes 100 times larger. If you duplicate a dataset exactly, the mean stays the same but there are twice as many squared deviations, so SS doubles. These properties are mathematically correct, but they also explain why SS alone is not ideal for comparing spread across differently scaled or differently sized datasets.

Interpretation and common mistakes

A larger SS generally indicates more aggregate dispersion around the mean for data measured on the same scale with comparable sample size. It does not automatically mean that a dataset is “bad,” that an outlier exists, or that a regression model fits poorly. Context determines which sum of squares is relevant. In regression, for example, total variation can be decomposed into explained and residual components; in one-way ANOVA, variability is divided into between-group and within-group components. The NIST one-way ANOVA value-splitting example demonstrates this decomposition in a practical setting.

Common errors include summing raw squares yi² instead of squared deviations (yi – ȳ)², rounding the mean too early, confusing SS with variance, and comparing SS values across incompatible units. This calculator keeps full JavaScript numeric precision in the canonical model and rounds only the displayed text. The Excel workbook also stores numeric values rather than copying rounded result strings from the page.