Glossary
Sample standard deviation
Spread of a sample dataset
By Buğra SözeriPublished Updated
Sample standard deviation is the square root of sample variance:
s = √(Σ(xᵢ − x̄)² / (n − 1))
Where x̄ is the sample mean, n is the sample size, and the sum runs over all values. The n − 1 divisor is Bessel’s correction — it compensates for the fact that the sample mean is closer to the data than the (unknown) true population mean would be, which makes the raw sum of squared deviations under-estimate the true population variance.
Use sample SD when your dataset is drawn from a larger group you can’t measure exhaustively (which is almost always). Use population SD (divide by n) only when the dataset literally is the entire population — every employee in your company, every transaction in March.
At large sample sizes the difference is negligible (n vs n-1 is rounding noise). At small sample sizes — say, n < 30 — the correction matters meaningfully and you should prefer the sample form.
Our statistics calculator defaults to the sample form with a toggle to switch to population.
Why the square root reintroduces a small bias: Bessel’s correction makes the sample variance an unbiased estimator of population variance, but the square root operation is non-linear and Jensen’s inequality bites — the sample SD systematically under-estimates the true population SD, even after the N−1 correction. The bias is roughly (1/4n) for normal data, so 2.5% at n=10, 0.25% at n=100, and negligible past n=1000. Statistical packages mostly ignore this; the unbiased c4-correction estimator s × √((n−1)/2) × Γ((n−1)/2) / Γ(n/2) exists for applications where it matters (quality control with tiny sample sizes). Reference: NIST/SEMATECH e-Handbook — Standard Deviation.
Worked example
Five measurements of a chemical assay: 9.8, 10.1, 9.9, 10.3, 10.4. Mean x̄ = 10.10. Squared deviations: 0.09, 0.00, 0.04, 0.04, 0.09 — sum 0.26. Sample variance s² = 0.26 / 4 = 0.065; sample SD s ≈ 0.255. Population SD (divide by 5) would be 0.228 — a 12% understatement of the underlying process spread when treating a sample as a census. For a quality-control chart with control limits at x̄ ± 3s, that difference moves the upper limit from 10.78 to 10.87, materially changing which production runs would trigger an out-of-control alarm.
When it matters in practice
A/B testing, lab science, polling, and finance all draw inferences from samples and report uncertainty as ±s or as a confidence interval built on s/√n. Using the population formula on a sample understates uncertainty and inflates statistical significance — the cardinal sin in reproducibility-crisis papers. Spreadsheets reflect this distinction in their function names: Excel’s STDEV.S divides by n−1,STDEV.P by n; pandas’.std() defaults to ddof=1(sample), NumPy’s np.std() defaults to ddof=0(population). Mixing these is one of the most common silent numerical bugs in data pipelines. See also variance and Bessel’s correction.
Frequently asked questions
- What is the sample standard deviation?
- The sample standard deviation (s) measures the spread of values around the sample mean, calculated as the square root of the average squared deviations using n minus 1 (not n) in the denominator. Dividing by n minus 1 (Bessel's correction) produces an unbiased estimate of the population standard deviation.
- Why divide by n minus 1 rather than n?
- A sample mean is calculated from the same data, so it is closer to the sample values than the true population mean would be. This causes the naive sum of squared deviations to underestimate the true variance. Dividing by n minus 1 corrects for this bias, producing an unbiased estimator.
- What is the difference between sample standard deviation and population standard deviation?
- Population standard deviation (sigma) divides by N (all values) and describes the actual spread of a known complete population. Sample standard deviation (s) divides by n minus 1 and is used when you have a subset and want to estimate the population's spread. For large n the difference is negligible.
Related
Published May 14, 2026 · Last reviewed May 31, 2026