📊 Standard Deviation & Variance Calculator
A standard deviation calculator for sample and population, with the full working, relative standard deviation, and how much n−1 changes the answer.
Dividing by n−1 rather than n raises the answer by 6.90% at this sample size. The correction shrinks fast as data accumulates — it is about 22% at n=3, 5% at n=10 and under 0.1% at n=1,000. Use the sample figure unless your data really is the entire population.
Step by step
| Value (x) | x − mean | (x − mean)² |
|---|---|---|
| 10 | -8.0000 | 64.0000 |
| 12 | -6.0000 | 36.0000 |
| 23 | 5.0000 | 25.0000 |
| 23 | 5.0000 | 25.0000 |
| 16 | -2.0000 | 4.0000 |
| 23 | 5.0000 | 25.0000 |
| 21 | 3.0000 | 9.0000 |
| 16 | -2.0000 | 4.0000 |
| Sum of squared deviations | 192.0000 | |
Then divide that sum by 8 for the population variance, or by 7 for the sample variance, and take the square root of whichever you need.
What Standard Deviation & Variance Calculator Does
Standard deviation answers one question: how far, typically, do the values sit from their own average? A small figure means the data huddles near the mean, a large one means it is spread out. The arithmetic is short — find the mean, measure each distance from it, square those distances, average them, take the square root — and every calculator on the first page of results does it identically.
The one real decision is whether to divide by n or by n−1, and it is the step people get wrong most often. Divide by n when your numbers are the entire group you care about. Divide by n−1 when they are a sample standing in for something larger, which is almost always the case.
The reason is subtle but worth understanding. A sample sits closer to its own mean than to the true mean of the population it came from, because the sample mean is calculated from those very numbers. Squared deviations measured against the sample mean therefore come out slightly too small, and dividing by n−1 instead of n compensates. That is Bessel's correction.
How much it matters depends entirely on how much data you have: it raises the answer by about 22% at n=3, roughly 5% at n=10, and under a tenth of a percent at n=1,000. With plenty of data the choice is almost irrelevant. With very little, it is the difference between an honest estimate and an optimistic one.
How to Use Standard Deviation & Variance Calculator
- Paste or type your numbers, separated by commas, spaces or line breaks
- Read the sample figure (s) if these numbers are a sample, or the population figure (σ) if they are the whole group
- Check the step-by-step table to see each deviation and its square
- Use the relative standard deviation to compare spread against datasets on a different scale
Formula Used by Standard Deviation & Variance Calculator
Sample standard deviation (use this by default)
s = √[ Σ(xᵢ − x̄)² ÷ (n − 1) ]
- xᵢ
- Each individual value in the data
- x̄
- The mean — the sum of all values divided by how many there are
- n
- How many values you have
- n − 1
- Bessel's correction, which removes the downward bias in a sample
Worked example
The dataset 5, 9, 8, 12, 6, 10, 6, 8
- Sum = 64, and 64 ÷ 8 = 8, so the mean is exactly 8
- Deviations: −3, 1, 0, 4, −2, 2, −2, 0
- Squared: 9, 1, 0, 16, 4, 4, 4, 0 — summing to 38
- Sample variance: 38 ÷ 7 = 5.4286
- √5.4286
Result: s = 2.3299
Population standard deviation
σ = √[ Σ(xᵢ − μ)² ÷ N ]
- μ
- The population mean
- N
- The size of the entire population — every member, not a sample
Worked example
The same eight numbers, treated as a complete population
- Population variance: 38 ÷ 8 = 4.75
- √4.75
Result: σ = 2.1794 — about 6.9% lower than the sample figure from identical data
Relative standard deviation (coefficient of variation)
RSD = (s ÷ |x̄|) × 100%
- RSD
- Standard deviation expressed as a percentage of the mean — unitless, so comparable across datasets
Worked example
Three datasets with very different scales
- Mean 100, s = 5 → 5%
- Mean 1,000, s = 50 → 5%
- Mean 2.5, s = 0.125 → 5%
Result: All three have identical relative spread despite standard deviations ranging from 0.125 to 50
How much Bessel's correction changes the answer
The ratio between the sample and population standard deviation is √(n ÷ (n−1)). It depends only on how many values you have, never on the values themselves.
| Sample size n | Sample SD ÷ population SD | Sample figure is higher by |
|---|---|---|
| 3 | 1.2247 | 22.47% |
| 5 | 1.1180 | 11.80% |
| 10 | 1.0541 | 5.41% |
| 20 | 1.0260 | 2.60% |
| 30 | 1.0171 | 1.71% |
| 50 | 1.0102 | 1.02% |
| 100 | 1.0050 | 0.50% |
| 1,000 | 1.0005 | 0.05% |
Worked example — 5, 9, 8, 12, 6, 10, 6, 8
A dataset small enough to check by hand. The mean lands on exactly 8, which keeps every step clean.
| Value | Deviation from mean | Squared deviation |
|---|---|---|
| 5 | −3 | 9 |
| 9 | +1 | 1 |
| 8 | 0 | 0 |
| 12 | +4 | 16 |
| 6 | −2 | 4 |
| 10 | +2 | 4 |
| 6 | −2 | 4 |
| 8 | 0 | 0 |
| Sum = 64, mean = 8 | Sum of squares = 38 |
Standard deviation for grouped data
When data arrives as a frequency table, use class midpoints weighted by frequency: mean = Σ(f·x) ÷ Σf, and the squared deviations become Σf(x − mean)².
| Midpoint x | Frequency f | f × x | f(x − mean)² |
|---|---|---|---|
| 10 | 3 | 30 | 816.75 |
| 20 | 5 | 100 | 211.25 |
| 30 | 8 | 240 | 98.00 |
| 40 | 4 | 160 | 729.00 |
| Totals | 20 | 530 | 1,855.00 |
| Mean = 530 ÷ 20 = 26.5 | σ = 9.6307 | s = 9.8809 |
How to Read Your Result
"Is my standard deviation good?" is not answerable as asked
A standard deviation of 5 is negligible on measurements averaging 1,000 and enormous on measurements averaging 6. The number carries the units of your data, so it means nothing detached from the scale. Relative standard deviation fixes this by expressing spread as a percentage of the mean: three datasets with standard deviations of 0.125, 5 and 50 can all be equally variable at 5% relative spread. That is the figure to quote when comparing across datasets.
Why the deviations get squared
Deviations from the mean always sum to exactly zero — that is what the mean is. Averaging them directly would give zero for every dataset ever collected. Squaring removes the signs so they stop canceling, at the cost of leaving the result in squared units. Taking the square root at the end converts it back. Squaring also weights large deviations more heavily than small ones, which is why standard deviation is sensitive to outliers in a way that a simple average distance would not be.
What it does not tell you
Standard deviation is a single summary, and very different distributions can share one. The familiar rules of thumb — about 68% of values within one standard deviation, 95% within two — hold only for roughly normal data. For skewed data, or data with two peaks, or data with an extreme outlier, those percentages can be badly wrong. Plot the numbers before trusting any single summary statistic of them.
Outliers move it a long way
Because deviations are squared, a single distant value has an outsized effect. Adding one point far from the mean can inflate the standard deviation dramatically while the median barely shifts. If your data contains genuine outliers and you want a measure of typical spread that ignores them, the interquartile range is the more robust choice.
The correction is not a complete fix
The Bessel correction makes the variance an unbiased estimator of the population variance, but it does not quite make the standard deviation unbiased — taking a square root is non-linear, so the bias does not survive the operation intact. There is in fact no single estimator of sample standard deviation that is simultaneously unbiased, efficient and maximum-likelihood, and the residual bias is meaningful below about ten observations. None of that is a reason to use n instead: n−1 moves in the right direction and is universally standard. It is a reason to be sceptical of a standard deviation computed from a handful of numbers, however many decimal places it is printed to.
Limitations & Accuracy Notes
- Standard deviation assumes the values are measurements on a meaningful numeric scale. It is not appropriate for ordinal categories such as survey ratings from one to five, however commonly it is applied to them.
- Squaring makes the measure sensitive to outliers. One extreme value can dominate the result, so check whether an unusual figure is genuine data or a recording error before quoting the spread.
- The 68/95/99.7 rules of thumb apply only to approximately normal distributions. For skewed or multi-modal data they can mislead substantially.
- Relative standard deviation becomes unstable when the mean approaches zero, and is meaningless for data that can be negative, since dividing by a near-zero or sign-changing mean produces nonsense.
- A standard deviation computed from a small sample is itself uncertain. With ten values the estimate is rough regardless of how many decimal places any calculator prints.
Frequently Asked Questions
Should I use the sample or the population formula?
What is the standard deviation of 5, 9, 8, 12, 6, 10, 6, 8?
What is a good standard deviation?
How do I calculate standard deviation for grouped data?
What is the difference between variance and standard deviation?
Should I divide by n or n − 1?
Why does Bessel's correction exist at all?
Why are the deviations squared rather than just made positive?
Is a high standard deviation bad?
How does an outlier affect it?
Is my data stored?
References & Further Reading
- NIST/SEMATECH e-Handbook of Statistical Methods — Measures of scale — The US National Institute of Standards and Technology reference on variance, standard deviation and the alternatives such as the interquartile range
- NIST/SEMATECH e-Handbook — Summary statistics — Definitions of location and scale measures, and guidance on when each is appropriate