Standard deviation calculator

Paste a list of numbers. Choose population or sample. For 2, 4, 4, 4, 5, 5, 7, 9 the population standard deviation is 2.

Standard deviation2
Variance4
Mean5

n = 8 · median 4.5

What the standard deviation measures

The standard deviation is the square root of the average squared distance from the mean. It uses the same units as the data. For the list 2, 4, 4, 4, 5, 5, 7, 9, the mean is 5, because the eight numbers add to 40 and 40 ÷ 8 = 5. The distances from 5 are −3, −1, −1, −1, 0, 0, 2, and 4. Squared, they are 9, 1, 1, 1, 0, 0, 4, and 16, which add to 32.

If these eight numbers are the entire population, divide by n = 8. The variance is 32 ÷ 8 = 4, and the standard deviation is the square root of 4, which is 2. If they are a sample from a larger population, divide by n − 1 = 7. The sample variance is 32 ÷ 7 = 4.5714, and the sample standard deviation is 2.1381. The sample version is larger because dividing by a smaller number is the usual correction for using a sample mean.

Worked example

Use the population setting when the list is everyone you care about: every score in one small class, every measurement in a finished batch. Use the sample setting when the list is a subset and you want a estimate for a wider group. Spreadsheets call these STDEV.P and STDEV.S. Mixing them up will not change a large data set by much, and it will change a list of three or four numbers a lot.

  • Add the values: 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40.
  • Mean: 40 ÷ 8 = 5.
  • Square each difference from 5 and add them: 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32.
  • Population: variance 32 ÷ 8 = 4, standard deviation √4 = 2. Sample: variance 32 ÷ 7 = 4.5714, standard deviation 2.1381.

What this number is not

A standard deviation of 2 does not mean every value is within 2 of the mean. In the example, 2 and 9 are 3 and 4 away from 5. It also does not require the data to be a bell curve. The calculation above did not assume a shape. Rules of thumb such as “about 68% of values fall within one standard deviation” belong to a normal distribution, and they are a poor description of a short, lumpy list.

The variance is the square of the standard deviation, so it is in squared units. People report the standard deviation because “2 points” is easier to read than “4 points squared.” The calculator shows both, along with the mean and the median, so you can see the center and the spread on one screen.

Common questions

How do you calculate standard deviation?

Find the mean, square each difference from the mean, average those squares, and take the square root. For 2, 4, 4, 4, 5, 5, 7, 9 the population standard deviation is 2.

Should I divide by n or n − 1?

Divide by n for a population and by n − 1 for a sample. On this list, that is 2 versus about 2.138.

Can the standard deviation be zero?

Yes. It is zero when every value equals the mean. A single number has a population standard deviation of zero and no sample standard deviation, because n − 1 would be zero.