Sum of Squares Calculator: SS Formula with Steps

Sum of squares calculator with the SS formula: SS = Σ(x − x̄)². Enter your data to get the mean, each squared deviation, and the total, with steps shown.

Sum of Squares Calculator

The sum of squares measures total variation around the mean: SS = Σ(x − x̄)². Enter your data set and the calculator finds the mean, each deviation, and the squared total, with every step shown.

Enter at least 2 numbers, separated by commas, spaces, or new lines.

Sum of squares (SS) is the total squared distance between every value in your data and the mean, written as SS = Σ(x − x̄)². Type your numbers into the calculator above and it returns the mean, each squared deviation, and the final SS, with every step laid out. This same value feeds directly into variance, standard deviation, regression, and ANOVA, so it shows up almost everywhere in statistics.

Below you will find the formula, the shortcut computational formula, worked examples using the exact numbers people search for, and the difference between SST, SSR, and SSE.

What Is the Sum of Squares?

The sum of squares is a basic statistical measure that shows how much data values vary from the mean. It works by calculating the squared difference between each value and the average, then adding them together.

In simple terms, the sum of squares tells you how spread out your data is. The larger the sum of squares, the more variation exists in the dataset.

This concept is widely used in statistics because it forms the foundation of important calculations like standard deviation, and regression analysis. Without the sum of squares, it would be impossible to measure data variability accurately.

The sum of squares formula is especially useful when comparing datasets or analyzing patterns in numerical data. That is why tools like a Sum of Squares Calculator are commonly used to perform fast and error-free calculations.

How to Calculate Sum of Squares Step by Step

The sum of squares formula measures how much each data point differs from the mean of the dataset. The process follows a clear step-by-step approach.

Here is how to calculate sum of squares manually:

  1. Find the mean of the dataset
  2. Subtract the mean from each value to get the deviation
  3. Square each deviation
  4. Add all the squared deviations together

Sum of Squares Formula:SS=(xxˉ)2SS = \sum (x – \bar{x})^2

Where:

  • xxx represents each data value
  • xˉ\bar{x}xˉ is the mean of the dataset

This formula is used in almost every major statistical method. Our Sum of Squares Calculator applies this same formula instantly, helping you calculate sum of squares accurately without manual effort.

What Is the Sum of Squares?

The sum of squares measures how far your data spreads from its own average. You take each value, subtract the mean, square that difference, and add all those squared results together. Squaring matters because it stops positive and negative gaps from cancelling out, and it gives extra weight to values sitting far from the center.

A large sum of squares means the numbers are widely scattered. A small one means they cluster tightly around the mean. On its own the number has no fixed scale, which is why it almost always gets converted into variance or standard deviation before you interpret it.

Sum of Squares Formula

The standard formula is:

SS = Σ(x − x̄)²

Where x is each data value, is the mean, and Σ means you add up every squared deviation. This is the definitional formula, and it is exactly what the calculator above runs.

Computational (shortcut) formula for sum of squares

Calculating each deviation by hand gets slow with big data sets. The computational formula skips the mean subtraction and gives the same answer:

SS = Σx² − (Σx)² / n

Here Σx² is the sum of every squared value, (Σx)² is the square of the total, and n is how many values you have. Both formulas always land on the same result, so use whichever is faster for your data.

Our Sum of Squares Calculator applies this formula instantly, eliminating manual calculations and reducing the risk of errors.

Sum of Squares Worked Examples

Here are three more examples using the definitional formula, so you can match your own homework step by step.

Example: 1, 2, 3, 4, 5

Mean = 15 ÷ 5 = 3. Deviations: −2, −1, 0, 1, 2. Squared: 4, 1, 0, 1, 4. SS = 4 + 1 + 0 + 1 + 4 = 10.

Example: 10, 12, 14, 16, 18

Mean = 70 ÷ 5 = 14. Deviations: −4, −2, 0, 2, 4. Squared: 16, 4, 0, 4, 16. SS = 16 + 4 + 0 + 4 + 16 = 40.

Example: 3, 5, 7, 9, 11

Mean = 35 ÷ 5 = 7. Deviations: −4, −2, 0, 2, 4. Squared: 16, 4, 0, 4, 16. SS = 16 + 4 + 0 + 4 + 16 = 40.

Notice that 10, 12, 14, 16, 18 and 3, 5, 7, 9, 11 both give SS = 40 even though the numbers are different. Sum of squares depends on the spacing between values, not on how large the numbers themselves are.

Sum of Squares Quick Reference

The main sum of squares terms, their formulas, and what each one measures.

TermFormulaWhat it measures
SS / SSTΣ(x − x̄)²Total variation around the mean
SS (computational)Σx² − (Σx)²/nSame total, faster to compute
SSRΣ(ŷ − ȳ)²Variation the model explains
SSEΣ(y − ŷ)²Variation left unexplained
SSBΣ nⱼ(x̄ⱼ − x̄)²Between-group variation (ANOVA)
SSWΣ(x − x̄ⱼ)²Within-group variation (ANOVA)

SST, SSR, and SSE: The Three Sums of Squares

Once you move into regression and ANOVA, sum of squares splits into three parts. They always add up: SST = SSR + SSE. The calculator above computes SST, the total variation, which is the foundation for the other two.

SST (Total Sum of Squares)

SST is the total variation of your data around the overall mean. Formula: SST = Σ(y − ȳ)². This is the number the calculator gives you. It answers “how much do the values vary in total, before any model is applied?”

SSR (Regression Sum of Squares)

SSR is the portion of the total variation that your regression line actually explains. Formula: SSR = Σ(ŷ − ȳ)², where ŷ is the predicted value. A large SSR relative to SST means the model captures most of the pattern.

SSE (Error Sum of Squares)

SSE, also called the residual sum of squares, is the variation left unexplained. Formula: SSE = Σ(y − ŷ)². The smaller the SSE, the closer the model’s predictions sit to the real data. To calculate SSR and SSE you need a fitted model, so use the linear regression calculator for those.

How they connect

Think of SST as a fixed budget of variation. SSR is the share your model explains, SSE is the share it misses, and together they always equal SST. The ratio SSR ÷ SST gives R², which tells you what fraction of the variation the model accounts for.

Sum of Squares Between and Within (ANOVA)

In ANOVA the total sum of squares gets split a different way, into variation between groups and variation within groups.

  • SSB (between-group sum of squares): measures how far each group’s mean sits from the overall mean. It captures the differences caused by the groups themselves. Formula: SSB = Σ nⱼ(x̄ⱼ − x̄)², where nⱼ is each group size and x̄ⱼ is each group mean.
  • SSW (within-group sum of squares): measures variation inside each group, the spread that has nothing to do with group differences. Formula: SSW = Σ(x − x̄ⱼ)².

Just like regression, these add up: SST = SSB + SSW. A large SSB compared to SSW is the signal that the group means genuinely differ. To run the full test with F-statistics, use the ANOVA calculator.

Common Mistakes to Avoid When Calculating Sum of Squares

When working with the sum of squares formula, small mistakes can lead to incorrect variance or standard deviation results. Here are the most common errors and how to avoid them:

  • Not calculating the mean first
    Sum of squares always depends on the mean. Skipping this step or using the wrong average will give incorrect results.
  • Forgetting to square the deviations
    Each data value must be subtracted from the mean and then squared. Using absolute values instead of squares is a common mistake.
  • Mixing sample and population formulas
    The sum of squares itself is the same, but errors happen later when dividing by n or n − 1. Always know whether your data is a sample or a population.
  • Rounding too early
    Rounding intermediate steps can reduce accuracy. It is best to keep full decimal values until the final result.
  • Using incorrect data entries
    Even one incorrect value can significantly change the sum of squares, especially in small datasets.
  • Confusing SS with variance
    Sum of squares is the total, before dividing. Variance is SS ÷ n or SS ÷ (n − 1). People often report one when they mean the other.

Try these next

  • Parker Rowland

    Former Math Teacher

    Parker Rowland is a Former math teacher, author, and ed tech enthusiast focused on clear math explanations, practical problem solving & effective learning.

  • Muhammad Abdullah Arshad

    MPhil Statistics Scholar

    M. Abdullah Arshad is an MPhil Statistics scholar and Google-certified data analyst specializing in statistical analysis, data mining, and time series modeling.