What a standard deviation measures
The standard deviation is the typical distance between an observation and the mean, expressed in the same units as the data. If a set of parts has a mean diameter of 25.0 mm and a standard deviation of 0.2 mm, then a part 0.2 mm from nominal is unremarkable and one 1.0 mm off is five typical distances away.
The construction is deliberate. Take each observation's deviation from the mean, square it, average the squares, then take the square root to return to the original units. The squaring step does two things: it removes the signs, so that deviations above and below the mean do not cancel to zero (they always would, exactly), and it gives large deviations disproportionate weight. That second effect is why the standard deviation is sensitive to outliers in a way the interquartile range is not.
A standard deviation is meaningless on its own. It has to be read against the mean, which is what the coefficient of variation on this page does: it expresses the standard deviation as a percentage of the mean, so that spread can be compared across quantities measured in different units. A standard deviation of 0.2 mm is tight on a 25 mm shaft and enormous on a 0.5 mm wire.
Why the sample formula divides by n - 1
Both formulas start identically. Compute the mean, subtract it from every observation, square each difference, and add them up. That total is the sum of squared deviations, written SS, and it is where all the work is. The two formulas differ only in what they divide SS by.
The population formula divides by N, the size of the whole group. Use it when your list genuinely is everything: all 32 machines on the floor, all 12 months of last year, every student who sat the exam.
The sample formula divides by n - 1. The reason is that you did not subtract the true population mean, because you do not know it - you subtracted the sample mean, which is calculated from the very same data. The sample mean is, by construction, the value that makes SS as small as it can possibly be for this data set. Any other centre gives a larger total. So SS is systematically too small as an estimate of the population's spread, and dividing by n - 1 instead of n scales it back up by exactly the right amount, on average.
The quantity n - 1 is the degrees of freedom. Once the mean is fixed, only n - 1 of the deviations can be chosen freely; the last is forced, because the deviations must add to zero. That is the same count, arrived at from the other direction, and it is why the deviation table on this page always has a zero in its third column total.
The correction matters most when n is small. With n = 2, dividing by 1 instead of 2 doubles the variance; with n = 100, the two divisors differ by 1%. If you want the variance rather than its square root, the variance calculator shows the same quantities without the final square root.
Worked example: 2, 4, 4, 4, 5, 5, 7, 9
These eight numbers are the standard teaching example, chosen because everything comes out whole.
- Find the mean. 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40, and 40 / 8 = 5.
- Subtract the mean from each value. The deviations are -3, -1, -1, -1, 0, 0, 2, 4. Add them: -3 - 1 - 1 - 1 + 0 + 0 + 2 + 4 = 0, as they must.
- Square each deviation. 9, 1, 1, 1, 0, 0, 4, 16.
- Add the squares. 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32. That is SS.
- Divide. On the population basis, 32 / 8 = 4. On the sample basis, 32 / 7 = 4.571429.
- Take the square root. sigma = sqrt(4) = 2.000000. s = sqrt(4.571429) = 2.138090.
The two answers differ by 6.9% here because n is only 8. The coefficient of variation on the population basis is 100 x 2 / 5 = 40%, which is a wide spread: a typical observation sits four tenths of the mean away from it.
Notice the effect of the 9. Its squared deviation of 16 is half of the entire SS of 32, so this one observation out of eight determines half the answer. Change that 9 to a 5 and the whole calculation shifts: the sum becomes 36, the mean 4.5, the squared deviations 6.25, 0.25, 0.25, 0.25, 0.25, 0.25, 6.25, 0.25, and SS falls from 32 to 14. The population standard deviation drops from 2.000000 to sqrt(14/8) = 1.322876. That leverage is the property to keep in mind whenever a data set contains a value you are not sure about.
How to read the number you get
Start with the units. The standard deviation carries the units of the data, so a value of 2 means two units, not two of anything else. If the mean is 5 and the standard deviation is 2, an observation of 11 is three standard deviations above the mean, which is the calculation a z-score formalises.
For data that follow a normal distribution, the standard deviation converts directly into probabilities: about 68% of observations fall within one standard deviation of the mean, about 95% within two, and about 99.7% within three. Those are properties of the normal curve, not of the standard deviation, and they do not transfer to skewed data. The normal distribution calculator gives the exact figures - the familiar 68-95-99.7 shorthand rounds 68.27%, 95.45% and 99.73%.
For any distribution at all, Chebyshev's inequality guarantees that at least 1 - 1/k2 of the data lie within k standard deviations of the mean: at least 75% within two, at least 88.9% within three. That bound is weak precisely because it assumes nothing, but it is always true, which the 68-95-99.7 rule is not.
What counts as a large standard deviation depends entirely on the field. Manufacturing tolerances are quoted in fractions of a standard deviation and a coefficient of variation above a few per cent is a problem; biological measurements routinely show coefficients of variation of 20% or more without anything being wrong. Compare against your own historical data or a published specification, never against an abstract threshold.
How much the n - 1 correction changes the answer
| n | s / sigma | s is larger by |
|---|---|---|
| 2 | 1.414214 | 41.4% |
| 3 | 1.224745 | 22.5% |
| 5 | 1.118034 | 11.8% |
| 8 | 1.069045 | 6.9% |
| 10 | 1.054093 | 5.4% |
| 20 | 1.025978 | 2.6% |
| 30 | 1.017095 | 1.7% |
| 50 | 1.010153 | 1.0% |
| 100 | 1.005038 | 0.5% |
| 1000 | 1.000500 | 0.05% |
Each ratio is sqrt(n/(n-1)) evaluated at that n, so it does not depend on the data at all. Below about n = 20 the choice of basis is visible in the answer; above n = 100 it rarely matters to a reported figure.
Errors that produce a wrong standard deviation
- Choosing the wrong basis. Most real data are a sample, so n - 1 is the default in Excel's STDEV.S, R's sd() and almost every statistics course. Use N only when the list is genuinely the entire population.
- Rounding the mean before subtracting. Rounding a mean of 5.333 to 5.3 shifts every deviation and inflates SS. Carry full precision through the deviations and round only the final answer.
- Forgetting the square root. SS / (n - 1) is the variance, in squared units. The standard deviation is its square root. Reporting a variance as a standard deviation overstates the spread whenever the value exceeds 1 and understates it when it is below.
- Including a value that is not a measurement. Blank cells read as zero, or a row total pasted along with the data, will both wreck the result. Check the reported count n against the number of observations you meant to enter.
- Quoting a coefficient of variation on data that can be negative or that has a mean near zero. The CV divides by the mean, so it explodes as the mean approaches zero and its sign becomes meaningless when observations straddle zero. It is defined for ratio-scale data with a positive mean.
- Comparing standard deviations across different units. A spread of 2 kg and a spread of 2 lb are not the same spread. Convert first, or compare coefficients of variation instead.
Where the standard deviation goes next
Almost every inferential method in statistics is built on this quantity. The standard error of a mean is s divided by the square root of n, and it is what turns a sample mean into a confidence interval or a t-statistic. Regression reports a residual standard error, which is the standard deviation of the vertical distances from the fitted line. Control charts in manufacturing set their limits at three standard deviations from the centre line.
Two related summaries answer the same question differently. The variance is this number squared, and it is the form that adds: the variance of a sum of independent quantities is the sum of their variances, which is not true of standard deviations. The interquartile range measures spread by position rather than by distance, so a single extreme value cannot move it, which makes it the right partner for a median.
To place one observation within a distribution, standardise it with the z-score calculator, or read it against the raw data using the percentile calculator. To turn a mean and a standard deviation into probabilities, use the normal distribution calculator - but check first that your data are roughly symmetric, because the normal model is an assumption you are making, not a fact the standard deviation supplies.
