Concepts · 3 min read

Standard Deviation Explained With a Worked Example

Standard Deviation Explained With a Worked Example — illustration
In short: Standard deviation measures how spread out data is. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the population standard deviation is 2.

The steps

  • Find the mean.
  • Subtract the mean from each value and square the result.
  • Average those squares (÷ n for a population, ÷ n − 1 for a sample): this is the variance.
  • Take the square root.
Full working for 2, 4, 4, 4, 5, 5, 7, 9
AnswerMean 5 · Median 4.5
  • Mode: 4
  • Range: 7
  • Sample SD: 2.1381
  • Population SD: 2
Step-by-step working 7 steps
  1. 1
    Sort the data
    2, 4, 4, 4, 5, 5, 7, 9

    8 values.

  2. 2
    Mean = sum ÷ count
    Sum = 40
    Mean = 40 ÷ 8 = 5
  3. 3
    Median = middle value
    Average of values 4 and 5: (4 + 5) ÷ 2 = 4.5
  4. 4
    Mode = most frequent value
    4 (appears 3 times)
  5. 5
    Range = largest − smallest
    9 − 2 = 7
  6. 6
    Squared deviations from the mean
    (2 − 5)² = 9
    (4 − 5)² = 1
    (4 − 5)² = 1
    (4 − 5)² = 1
    (5 − 5)² = 0
    (5 − 5)² = 0
    (7 − 5)² = 4
    (9 − 5)² = 16
    Sum of squares = 32

    Sum these for every value to get the total used below.

  7. 7
    Variance and standard deviation
    Population: σ² = 32 ÷ 8 = 4,  σ = 2
    Sample:     s² = 32 ÷ 7 = 4.5714,  s = 2.1381

    Use the sample version (÷ n−1) when your data is a sample from a larger group; use the population version when it is the whole group.

Sample versus population

Use ÷ n when your data is the whole group. Use ÷ (n − 1) when it is a sample from a larger group: a sample tends to understate spread, and dividing by n − 1 corrects for that.

The 68-95-99.7 rule

For roughly bell-shaped data, about 68% of values lie within 1 standard deviation of the mean, about 95% within 2 and about 99.7% within 3.

Compare two sets

Same mean, different spread — see the effect in mean vs median, or use the mean, median and mode calculator.

A tighter data set with the same mean
AnswerMean 5 · Median 5
  • Mode: 5
  • Range: 2
  • Sample SD: 0.8165
  • Population SD: 0.7559
Step-by-step working 7 steps
  1. 1
    Sort the data
    4, 4, 5, 5, 5, 6, 6

    7 values.

  2. 2
    Mean = sum ÷ count
    Sum = 35
    Mean = 35 ÷ 7 = 5
  3. 3
    Median = middle value
    Value 4 of 7 = 5
  4. 4
    Mode = most frequent value
    5 (appears 3 times)
  5. 5
    Range = largest − smallest
    6 − 4 = 2
  6. 6
    Squared deviations from the mean
    (4 − 5)² = 1
    (4 − 5)² = 1
    (5 − 5)² = 0
    (5 − 5)² = 0
    (5 − 5)² = 0
    (6 − 5)² = 1
    (6 − 5)² = 1
    Sum of squares = 4

    Sum these for every value to get the total used below.

  7. 7
    Variance and standard deviation
    Population: σ² = 4 ÷ 7 = 0.5714,  σ = 0.7559
    Sample:     s² = 4 ÷ 6 = 0.6667,  s = 0.8165

    Use the sample version (÷ n−1) when your data is a sample from a larger group; use the population version when it is the whole group.

Frequently asked questions

Can standard deviation be negative?

No. It is a square root, so it is zero or positive; zero means every value is identical.

What is variance?

The standard deviation squared — the average squared distance from the mean.

Written and reviewed by Mateuss M.

Mateuss M. writes and reviews mathematical content for CalcSolver, focusing on online calculators, formulas, equations, and practical math tools. He reviews calculator functionality, calculation methods, formulas, examples, and explanations to help ensure that each tool is clear, useful, and easy to understand.

Keep reading