Guides Math & Statistics

How Standard Deviation Works

What standard deviation measures, a worked step-by-step example, why samples divide by n − 1, the 68-95-99.7 rule, z-scores and how spread becomes uncertainty.

Last reviewed:

AdSense Placeholder
Slot: header_reference_page
On this page

The mean tells you where a data set is centred. The standard deviation tells you how far values typically stray from that centre. Two classes can share the same average mark and still be very different places: the standard deviation is what shows it.

Why the average is not enough

Class A scores 68, 69, 70, 71, 72 and class B scores 40, 55, 70, 85, 100. Both average exactly 70. But class A's standard deviation is 1.41 and class B's is 21.21: in A almost everyone is close to 70, in B the scores are spread across the whole range.

Calculating it step by step

Take the data 2, 4, 4, 4, 5, 5, 7, 9, whose mean is 5.

  1. Subtract the mean from each value to get its deviation.
  2. Square each deviation, which removes the signs and weights big misses more.
  3. Average the squares. This is the variance.
  4. Take the square root to return to the original units. This is the standard deviation.
Value x Deviation x − mean Squared
2 −3 9
4 −1 1
4 −1 1
4 −1 1
5 0 0
5 0 0
7 +2 4
9 +4 16
Total 0 32

The squares add up to 32. Dividing by 8 gives a variance of 4 and a standard deviation of 2. The Standard Deviation Calculator and Statistics Calculator do these steps and show the working.

Population or sample: dividing by n or n − 1

Divide by n when your data is the whole population, and by n − 1 when it is a sample used to estimate a larger population. For the same data the sample version gives a variance of 32 / 7 = 4.571 and a standard deviation of 2.138.

Why the n − 1? A sample's values sit closer to the sample's own mean than to the true mean, so dividing by n underestimates the spread. Here is an exact check. The population 1, 2, 3, 4 has variance 1.25. List all 16 ordered samples of size 2 (with replacement). Averaged over all of them, the variance computed with n − 1 is exactly 1.25, the true value, while dividing by n gives only 0.625, half of it.

The normal distribution and the 68-95-99.7 rule

For bell-shaped data about 68.3% of values lie within one standard deviation of the mean, 95.4% within two and 99.7% within three. A value more than three standard deviations out is rare enough to deserve a second look.

z-scores: measuring in standard deviations

A z-score says how many standard deviations a value is from the mean: z = (x − mean) / SD. A mark of 85 when the mean is 70 and the SD is 10 has z = 1.5, which in a normal distribution is about the 93rd percentile. Use the Z-score Calculator to convert both ways.

From spread to uncertainty

The standard deviation describes the data. The standard error describes how uncertain the mean is: SE = SD / √n. With SD = 15 and n = 100, SE = 1.5, so a sample mean of 103 has a 95% confidence interval of about 103 ± 1.96 × 1.5, from 100.06 to 105.94 (the Confidence Interval Calculator does this and handles small samples with the t distribution). Comparing that mean with a claimed value of 100 gives z = (103 − 100) / 1.5 = 2 and a two-sided p-value of 0.0455, which the P-value Calculator can check. The t-Test Calculator compares two groups, and the Sample Size Calculator tells you how much data you need for a given margin of error.

Common mistakes

  • Quoting a mean without a spread. An average alone hides outliers and bimodal data.
  • Using the wrong divisor. Samples use n − 1; spreadsheet functions come in both flavours (STDEV.S and STDEV.P).
  • Applying the 68-95-99.7 rule to skewed data. It describes bell-shaped distributions only.
  • Reading a p-value as the probability the result is true. It is how surprising the data would be if there were no effect; see p-value.
  • Forgetting that outliers inflate SD. One extreme value can dominate the squares; compare with the median and range in the Mean, Median, Mode & Range Calculator.

Try these tools

See also

  • Cheat sheet Statistics Formulas Cheat Sheet
    Mean, standard deviation, z-score, confidence intervals, chi-square.
  • Glossary Standard deviation
    Standard deviation measures how far values typically stray from their mean; it is the square root of the variance.
  • Glossary p-value
    A p-value is the probability of seeing results at least as extreme as yours if there were really no effect.

Frequently Asked Questions

Neither by itself. It means the values are spread out. That is bad for a machine that should fill bottles to the same volume and good for a portfolio that needs varied outcomes. Judge it against what the data is for.

AdSense Placeholder
Slot: footer_leaderboard