Skip to content
UnitFormula

Standard deviation measures how spread out a set of numbers is around their mean. Find the mean, square each value's distance from it, average those squared distances (the variance), then take the square root. Dividing by n gives the population standard deviation; dividing by n − 1 gives the sample standard deviation, used when your data is a sample of a larger group. For 2, 4, 4, 4, 5, 5, 7, 9 the population standard deviation is 2 and the sample standard deviation is about 2.1381.

Standard Deviation Calculator — sample and population

Enter numbers separated by commas, spaces, or new lines.

The standard deviation of 2, 4, 4, 4, 5, 5, 7, 9.

Sample standard deviation (s)2.1381
Population standard deviation (σ)
2
Sample variance (s²)
4.5714
Population variance (σ²)
4
Mean
5
Count
8

Quick examples

How it's calculated

  1. Sample SD = √(sum of squared deviations ÷ (n − 1))s=(xxˉ)2n1s = \sqrt{\frac{\sum (x - \bar{x})^2}{n - 1}}
    n
    = 8
    2.14
Sample standard deviation (s)2.1381

How it works

Standard deviation summarizes spread — how far, on average, the values sit from the mean. The steps, per Wolfram MathWorld, are:

  1. Find the mean x̄.
  2. For each value, compute its squared deviation (x − x̄)².
  3. Average those squared deviations to get the variance.
  4. Take the square root to return to the original units — that is the standard deviation.

The one choice is the divisor in step 3:

  • Population (σ, σ²) — divide by n. Use it when your data is the entire group.
  • Sample (s, s²) — divide by n − 1 (Bessel's correction). Use it when your data is a sample drawn from a larger population; the n − 1 divisor corrects the bias, so the sample standard deviation is always a little larger than the population one.

A small standard deviation means the values cluster tightly around the mean; a large one means they are widely scattered. Identical values have a standard deviation of 0.

Worked example

For 2, 4, 4, 4, 5, 5, 7, 9: the mean is 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4, 16, which sum to 32. Dividing by n = 8 gives a population variance of 4, so the population standard deviation is √4 = 2. Dividing by n − 1 = 7 gives a sample variance of about 4.5714, so the sample standard deviation is about 2.1381.

Frequently asked questions

What is the difference between sample and population standard deviation?

The population form divides the summed squared deviations by n; the sample form divides by n − 1. Use the population form when you have every member of the group, and the sample form when your data is a sample of a larger population.

Why divide by n − 1 for a sample?

Because the sample mean is itself estimated from the data, dividing by n would slightly underestimate the true spread. Dividing by n − 1 (Bessel's correction) removes that bias, which is why the sample standard deviation is always at least as large as the population one.

How do you calculate standard deviation step by step?

Find the mean, subtract it from each value and square the result, average those squared deviations (that is the variance), then take the square root. Divide by n for the population form or n − 1 for the sample form.

What does a standard deviation of 0 mean?

Every value is identical, so there is no spread at all. As the values become more scattered, the standard deviation grows.

What is the relationship between variance and standard deviation?

Variance is the average squared deviation; standard deviation is its square root. Standard deviation is usually preferred because it is in the same units as the data, not squared units.

Which one should I use?

If in doubt and your numbers are a sample of something larger — survey responses, test scores, a batch of measurements — use the sample standard deviation (n − 1). Use the population form only when your data covers the whole group.