The two formulas

Standard deviation measures how far values typically fall from the mean. Which formula you use depends on whether your data are the whole population or a sample from it.

Population: σ = √[Σ(x − μ)² / N]. Sample: s = √[Σ(x − x̄)² / (n − 1)]. N is the number of items in the population and n is the number in the sample.

Why n − 1

A sample mean sits closer to the sample values than the true population mean does, so deviations measured from x̄ tend to be a little too small. Dividing by n − 1 instead of n corrects for this. OpenStax puts it this way: dividing by n − 1 gives a better estimate of the population variance.

The effect is large for small samples and fades as n grows. With n = 100, the divisor changes from 100 to 99, about 1%.

Worked example

Data: 2, 4, 4, 4, 5, 5, 7, 9. There are 8 values and they add to 40, so the mean is 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4 and 16, which add to 32.

If this is a whole population, the variance is 32 / 8 = 4 and σ = √4 = 2. If it is a sample, the variance is 32 / 7 ≈ 4.571 and s = √4.571 ≈ 2.138.

Variance and standard deviation

Variance is the standard deviation squared, and the standard deviation is the square root of the variance. In the example, 2.138² is about 4.571. Variance is in squared units, such as square inches, while standard deviation is in the original units, which makes it easier to interpret.

Common mistakes

Most errors come from picking the wrong formula or stopping too early.

  • Using n when the data are a sample. Unless the problem says the data are the entire population, treat them as a sample.
  • Forgetting the square root and reporting the variance as the standard deviation.
  • Subtracting the mean from each value but not squaring, which always sums to zero.
  • Rounding the mean before computing deviations. Keep extra decimals until the final step.
  • Using a calculator's population key (often labeled σx) when the problem needs the sample key (often labeled sx).
Put the idea to use with our Z table and area lookup.

Have a correction or a suggestion? Tell the studio.