← All guides

How to calculate standard deviation, step by step

Calculate standard deviation by hand, the difference between population and sample standard deviation, and what the number actually means.

Video lesson: Variance and standard deviation (free, with subtitles)

Standard deviation measures how spread out data is: roughly, how far a typical value is from the mean.

Steps, with data 2, 4, 4, 4, 5, 5, 7, 9

  1. Mean: 40 ÷ 8 = 5.
  2. Subtract the mean and square: 9, 1, 1, 1, 0, 0, 4, 16.
  3. Add them: 32.
  4. Divide: by n = 8 for a population (variance 4), or by n − 1 = 7 for a sample (variance ≈ 4.571).
  5. Square root: population SD = 2; sample SD ≈ 2.14.

Why square the differences?

The plain differences always add up to 0 (the values above the mean cancel the ones below), so they can't measure spread. Squaring makes them all positive; the square root at the end brings the units back.

Population or sample?

If your data is the whole group you care about, divide by n. If it's a sample used to estimate a bigger group, divide by n − 1. A sample tends to underestimate the spread, and n − 1 corrects for that.

What the number means

For bell-shaped data, about 68% of values lie within 1 SD of the mean and about 95% within 2 SDs.

Practice it free

Watch the full lesson and try questions with new numbers every time, with the worked steps shown if you get one wrong.

Practice: Variance and standard deviation All courses