Population vs. sample: which one do you need?
This is the single most common point of confusion with this calculation, and getting it wrong changes the answer. Use population statistics when your data is the entire group you care about — every student in a class, every day in a specific month. Use sample statistics when your data is a subset drawn from a larger group you're trying to draw conclusions about — a survey of 200 people meant to represent a much larger population. Sample variance divides by one less than the count (N−1, "Bessel's correction") specifically because a sample's own variance tends to slightly underestimate the true population variance; dividing by a smaller number corrects for that bias.
If you are unsure which version applies, determine whether your data represents the complete group you want to describe or only a subset of a larger group. The correct choice depends on what your data represents, not simply on the number of values you have.
What does standard deviation tell you?
Standard deviation measures how much the values in a data set vary around their mean. A small standard deviation means the values tend to be close to the mean, while a larger standard deviation means they are more spread out.
For example, consider two data sets with the same mean:
8, 9, 10, 11, 12 2, 6, 10, 14, 18 Both sets have a mean of 10, but the second set has values much farther from the mean, so it has a larger standard deviation.
Unlike variance, standard deviation is expressed in the same units as the original data. If the data is measured in centimeters, the standard deviation is also measured in centimeters. This makes standard deviation easier to interpret as a measure of spread.
How to calculate standard deviation
The calculation follows the same basic steps for both population and sample standard deviation. The difference is whether you divide the squared deviations by N or N - 1.
- Find the mean of the data set.
- Subtract the mean from each value.
- Square each difference.
- Add the squared differences.
- Divide by N for a population or N - 1 for a sample.
- Take the square root of the result.
The result is the standard deviation. The value before taking the square root is the variance.
Standard deviation and variance formulas
σ² = Σ(x − μ)² ÷ N σ = √(Σ(x − μ)² ÷ N) s² = Σ(x − x̄)² ÷ (N − 1) s = √(Σ(x − x̄)² ÷ (N − 1)) Here, x is an individual data value, μ is the population mean, x̄ is the sample mean, and N is the number of values in the data set.
What is variance?
Variance measures the average squared distance of the data values from their mean. It is closely related to standard deviation: standard deviation is the square root of variance.
Variance is useful in statistical calculations and mathematical models, but its squared units can make it harder to interpret directly. For example, if the original measurements are in meters, the variance is in square meters, while the standard deviation is back in meters.
Standard Deviation = √Variance Variance = (Standard Deviation)² Worked standard deviation example
Consider the data set:
2, 4, 4, 4, 5, 5, 7, 9 The mean is 5. Subtracting 5 from each value and squaring the differences gives:
(2 − 5)² + (4 − 5)² + (4 − 5)² + (4 − 5)²
+ (5 − 5)² + (5 − 5)² + (7 − 5)² + (9 − 5)²
= 32
There are 8 values, so the population variance is:
32 ÷ 8 = 4 Taking the square root gives a population standard deviation of:
√4 = 2 If these eight values are instead treated as a sample from a larger population, divide by 7 instead:
32 ÷ 7 ≈ 4.571 √4.571 ≈ 2.138 Standard deviation vs. other measures of spread
Standard deviation is only one way to describe how spread out a data set is. Different measures can be useful depending on the data and the question you are asking.
- Standard deviation: measures spread around the mean and uses every value in the data set.
- IQR: measures the range of the middle 50% of the data and is less affected by extreme values.
- Mean absolute deviation: measures the average absolute distance from the mean.
- Range: measures the difference between the largest and smallest values in a data set.
Frequently asked questions
What's the difference between population and sample standard deviation?
Population standard deviation treats your data as the complete group of interest and divides by the count (N). Sample standard deviation treats your data as a subset representing a larger group and divides by one less than the count (N-1), which corrects for the tendency of a sample to slightly underestimate the true population variance.
How do you calculate standard deviation?
Find the mean, calculate each value's squared difference from the mean, sum those squared differences, divide by the count (population) or count minus one (sample), then take the square root of the result.
Why does sample variance divide by N-1 instead of N?
Because a sample's own mean is calculated from the same data being measured, the sample's squared deviations tend to run slightly smaller than the true population's would. Dividing by N-1 instead of N (Bessel's correction) counteracts that bias, giving a more accurate estimate of the population's actual variance.
Is variance the same as standard deviation?
No. Variance is the average squared deviation from the mean, while standard deviation is the square root of variance. Standard deviation is therefore expressed in the same units as the original data, while variance uses squared units.
What does a high standard deviation mean?
A high standard deviation means the values are more spread out around the mean. A low standard deviation means the values tend to be closer to the mean. Whether a particular standard deviation is large or small depends on the scale and context of the data.
Can standard deviation be zero?
Yes. Standard deviation is zero when every value in the data set is identical, because every value is exactly equal to the mean.