United Kingdom Ā· Maths & Statistics
Standard Deviation Calculator
Paste your data in any format. The calculator gives both the sample and population standard deviation together ā because choosing between n and nā1 is the step people get wrong, and seeing both makes the difference concrete.
What is the difference between sample and population standard deviation?
Population standard deviation divides the sum of squared deviations by n; sample standard deviation divides by nā1. Use nā1 when your data is a sample and you are estimating the spread of a wider population, which is almost always. Use n only when your data genuinely is the entire population.
How to use this calculator
- Paste data in any formatCommas, spaces, tabs or new lines all work, so you can paste a column straight out of a spreadsheet without reformatting it.
- Choose sample unless your data is everythingIf you measured 30 people to say something about a population, that is a sample. Only if you measured every member of the group is it a population.
- Read both figures anywayThe breakdown shows both, along with the percentage difference between them. On small datasets that gap is substantial.
- Check the range and median tooA standard deviation on its own can hide skew and outliers. Comparing the mean against the median is a quick check for both.
Why divide by n ā 1
This is the part of introductory statistics most people memorise and few can explain, and the explanation is genuinely intuitive once stated.
When you calculate the spread of a sample, you measure deviations from the sample mean ā because you do not know the true population mean. But the sample mean is, by construction, the point that minimises the sum of squared deviations for that particular sample. It sits right in the middle of your data.
The true population mean almost certainly sits somewhere slightly else. Deviations measured from it would be, on average, slightly larger.
So using the sample mean systematically underestimates the spread. Not by chance ā every time, in the same direction. That is a bias rather than noise.
Dividing by nā1 rather than n inflates the result by exactly enough to correct that bias on average. This is Bessel's correction, and nā1 is called the degrees of freedom: once the mean is fixed, only nā1 of the values are free to vary, because the last one is determined by the requirement that they average to the mean.
The size of the correction depends on the sample. With 6 values, dividing by 5 instead of 6 inflates the variance by 20% and the standard deviation by about 9.5%. With 100 values the difference is 0.5%. With 1,000 it is negligible.
So the choice matters most exactly where data is scarcest ā which is also where people are most likely to be working by hand and most likely to get it wrong.
s² = Ī£(x ā xĢ)² Ć· (n ā 1)Worked example: 4, 8, 15, 16, 23, 42
Six values. Sum: 4 + 8 + 15 + 16 + 23 + 42 = 108. Mean: 108 Ć· 6 = 18.
Now the deviations from the mean: ā14, ā10, ā3, ā2, 5, 24.
Notice they sum to zero. They always do, which is why you cannot simply average the deviations ā the positives and negatives cancel exactly. Squaring is what solves that.
Squared deviations: 196, 100, 9, 4, 25, 576. Sum: 910.
Sample variance: 910 Ć· 5 = 182. Sample standard deviation: ā182 = 13.49.
Population variance: 910 Ć· 6 = 151.67. Population standard deviation: ā151.67 = 12.32.
The two differ by 1.18, which is 9.5% ā a substantial gap, and entirely a consequence of six being a small n.
The square root at the end matters for interpretation. Variance is in squared units, so if these were heights in centimetres the variance would be in square centimetres, which means nothing physically. Taking the root returns the figure to centimetres, which is why standard deviation is the number people actually quote.
One more thing this dataset shows. The mean is 18 but the median is 15.5, and the largest value, 42, is nearly twice the next largest. That single value contributes 576 of the 910 total ā 63% of the entire sum of squares from one observation out of six. Squaring makes outliers dominate, and a standard deviation reported without checking for them can be badly misleading.
What standard deviation tells you
| Range | Roughly what proportion falls inside | Applies when |
|---|---|---|
| Mean ± 1 SD | 68% | Data is approximately normal |
| Mean ± 2 SD | 95% | Data is approximately normal |
| Mean ± 3 SD | 99.7% | Data is approximately normal |
| Mean ± 2 SD | At least 75% | Any distribution ā Chebyshev |
| Mean ± 3 SD | At least 89% | Any distribution ā Chebyshev |
The 68-95-99.7 rule only holds for roughly normal data. Chebyshev's inequality gives weaker bounds that hold for any distribution whatsoever, which is what to fall back on when normality is doubtful. Skewed data, bimodal data and data with heavy tails all break the first three rows while still obeying the last two.
Where standard deviation misleads
Standard deviation summarises spread in one number, and any single number will hide things.
It assumes the mean is a sensible centre. For skewed data ā income, house prices, waiting times ā the mean is pulled toward the tail and the standard deviation describes spread around a point that few observations are near. The median and interquartile range describe such data far better.
It is dominated by outliers, because deviations are squared before averaging. One extreme value can double a standard deviation, as the worked example above shows. Always look at the data, or at least at the range and median, before reporting a standard deviation.
It cannot distinguish distributions with the same spread but different shapes. A bimodal dataset with clusters at 10 and 30 and a uniform spread from 10 to 30 can produce identical standard deviations while describing completely different situations. A histogram takes seconds and shows what the summary cannot.
Comparing standard deviations between datasets with different means is misleading. A standard deviation of 5 means something very different around a mean of 10 than around a mean of 1,000. The coefficient of variation ā standard deviation divided by the mean, expressed as a percentage ā makes such comparisons meaningful, and it is in the breakdown for that reason.
Standard deviation is also not standard error. Standard deviation describes the spread of the data; standard error describes the precision of the sample mean as an estimate, and it shrinks as the sample grows. Error bars on a chart labelled only "± error" are ambiguous between the two, and the difference is large.
Finally, a standard deviation calculated from data that is not a random sample estimates nothing in particular. The arithmetic will run happily on any numbers; whether the result means anything depends on how they were collected.
In Excel and Google Sheets, STDEV.S uses nā1 and STDEV.P uses n. The old STDEV function is the sample version. Picking the wrong one is a common and silent source of error in spreadsheets.
Assumptions and limitations
- Requires at least two values ā a single observation has no spread to measure
- Assumes the mean is a meaningful centre, which fails for strongly skewed data
- Heavily influenced by outliers, because deviations are squared
- Cannot distinguish distributions with the same spread but different shapes
- The 68-95-99.7 rule applies only to approximately normal data
- Does not detect whether your data is a random sample, which determines whether the estimate means anything
- Standard deviation is not standard error ā the breakdown gives both
Questions people ask about this in United Kingdom
What is the difference between sample and population standard deviation?
Population divides by n; sample divides by nā1.
Use nā1 whenever your data is a sample being used to estimate a wider population, which is almost always. Use n only when you measured every member of the group.
Why divide by n ā 1?
Because the sample mean sits at the exact centre of your data, so deviations measured from it are systematically slightly too small.
Dividing by nā1 inflates the result by just enough to correct that bias. It is called Bessel's correction.
How much difference does nā1 make?
With 6 values, about 9.5% on the standard deviation. With 100 values, 0.5%. With 1,000, negligible.
It matters most where data is scarcest ā which is also where people are most likely to compute it by hand.
Why square the deviations?
Because deviations from the mean always sum to exactly zero ā the positives and negatives cancel.
Squaring removes the signs, and taking the square root at the end returns the answer to the original units.
What does standard deviation actually tell me?
For roughly normal data, about 68% of values fall within one standard deviation of the mean and 95% within two.
For non-normal data those figures do not hold, and Chebyshev's weaker bounds apply instead.
Which Excel function should I use?
STDEV.S for a sample, STDEV.P for a population. The old STDEV is the sample version.
Picking the wrong one is a common and completely silent source of error.
Is standard deviation the same as standard error?
No. Standard deviation describes the spread of your data; standard error describes how precisely your sample mean estimates the true mean, and it shrinks as the sample grows.
Error bars labelled only "± error" are ambiguous between the two.
Related United Kingdom calculators
Tools people usually open in the same sitting.
Method, source and review date
- How it is worked out
- Standard deviation with Bessel's correction shown alongside
- Formula used
s = ā(Ī£(x ā xĢ)² Ć· (n ā 1)); Ļ = ā(Ī£(x ā xĢ)² Ć· n)- Checked against
- Standard statistics
- Last reviewed
- Confidence
- High
Spotted a figure that has moved, or a formula you can show is wrong? Tell us ā send a correction. Fixes to rates and formulas are treated as urgent.
Disclaimer
This calculator gives an estimate for guidance only. Check the figures against your own measurements or paperwork before you commit money to them.