Variance and Standard Deviation Calculator — Population vs Sample Formula
Variance measures the average squared distance of each value from the mean. Standard deviation is its square root — bringing the result back to the original unit. Population variance divides by n; sample variance divides by n − 1 (Bessel's correction). For dataset {4, 7, 13, 16, 20}: mean = 12, population variance = 34.8, population standard deviation = 5.90. This calculator returns both population and sample versions side by side.
Client-side
Spread & dispersion
Before you calculate
Variance measures the average squared distance of each value from the mean. Standard deviation is its square root — bringing the result back to the original unit. Population variance divides by n; sample variance divides by n − 1 (Bessel's correction). For dataset {4, 7, 13, 16, 20}: mean = 12, population variance = 34.8, population standard deviation = 5.90. This calculator returns both population and sample versions side by side.
Best forMeasuring how spread out a dataset is around its mean — essential for quality control, risk analysis, grading curves, and any analysis where consistency matters as much as the average.InputTwo to 30 numeric values (positive, negative, and zero are all valid).OutputMean, population variance, sample variance, population standard deviation, sample standard deviation — all shown together.
Three things SD tells you that the mean cannot
Standard deviation quantifies the uncertainty hiding inside an average. A mean without SD is an incomplete summary.
Consistency
Same mean, completely different datasets
Dataset A {10, 10, 10, 10, 10} and Dataset B {2, 6, 10, 14, 18} both have mean = 10. Dataset A has SD = 0 (perfectly consistent); Dataset B has SD = 5.66 (spread across a 16-point range). A quality-control engineer needs both numbers.
68-95-99.7 rule
SD maps to probability under normal distribution
For normally distributed data: 68% of values fall within ±1 SD of the mean, 95% within ±2 SD, 99.7% within ±3 SD. For {4, 7, 13, 16, 20}: mean = 12, σ = 5.90 → 68% of values expected between 6.10 and 17.90. Three of the five values (7, 13, 16) fall in this range.
Bessel’s correction
Why sample SD divides by n−1
A sample tends to underestimate the full population’s spread because extreme values are less likely to be sampled. Dividing by n−1 instead of n inflates the estimate slightly to correct for this bias. For n = 5: s² = 170/4 = 42.5 versus σ² = 170/5 = 34.8. The 22% increase accounts for the missing coverage at the tails.
When to use each spread formula
The choice of population or sample formula changes the numeric result. Each row shows a real situation and which formula is correct.
Situation
Input
Best next move
Why
All scores from one class exam
30 scores; this is the complete group
Population SD (÷ n) in Excel: =STDEV.P()
No estimation involved — you have every value in the group.
Survey of 100 users from 10,000
100 satisfaction scores
Sample SD (÷ n−1) in Excel: =STDEV.S()
The 100 scores estimate the spread of all 10,000 users.
Two products with the same mean defect rate
Product A: {1,1,1,1,1}, Product B: {0,0,1,2,2}
Compare SD: A = 0, B = 0.89
Same mean (1.0) hides that Product B is inconsistent.
Step-by-step: how to use this calculator correctly
01
Decide first: are these values the entire group (population) or a subset drawn from a larger group (sample)? This determines which formula applies.
02
Enter values separated by commas, spaces, or line breaks. At least 2 values are required; at least 3 values are needed for meaningful sample standard deviation.
03
Read the mean and standard deviation together. A mean of 12 with σ = 5.90 means roughly 68% of values fall between 6.10 and 17.90 (one standard deviation), assuming normal distribution.
04
If population σ and sample s differ significantly, your sample is small — consider collecting more data before drawing conclusions.
Dataset {4, 7, 13, 16, 20}: full spread calculation step by step
Given
Values: 4, 7, 13, 16, 20 | n = 5 | mean = (4+7+13+16+20)/5 = 60/5 = 12
Population SD = √34.8 = 5.90 | Sample SD = √42.5 = 6.52. The sample SD is 10% larger — Bessel's correction assumes the full population is more spread than the sample suggests.
Takeaway
SD of 5.90 on a mean of 12 means a coefficient of variation of 49% — this dataset is widely spread relative to its center. Compare with a tight dataset like {10, 11, 12, 13, 14} where SD = 1.58 and CV = 13%.
Four spread and center metrics: which to pair with your data
Mean tells you where data is centered. Variance and standard deviation tell you how far values typically stray from that center. Use them together — one without the other is incomplete.
Method
Best for
Watch for
Example
Population variance (σ²)
When the dataset contains every member of the group you are describing.
Divides by n. Underestimates spread for samples — use s² instead.
All 30 students in one class: σ² = 34.8 for {4, 7, 13, 16, 20}.
Sample variance (s²)
When the dataset is a subset used to estimate the spread of a larger group.
Divides by n−1 (Bessel’s correction). s² is always larger than σ² for the same data.
Same data as above: s² = 170/4 = 42.5, which is 22% larger than σ² = 34.8.
Standard deviation (σ or s)
Reading spread in the original unit so it is directly comparable to the mean.
Sensitive to extreme values, just like the mean. A single outlier inflates both.
For {4, 7, 13, 16, 20}: mean = 12, σ = 5.90. Typical value is within 12 ± 5.90.
Mean (AM)
Locating the center of the data distribution.
Mean alone is misleading without SD. Mean = 10 for both {10,10,10} and {2,6,10,14,18}.
Standard deviation calculation: 5 steps for {4, 7, 13, 16, 20}
SD = √(Σ(xᵢ − μ)² / n). Every step shown with the actual numbers.
01Mean
(4+7+13+16+20)/5 = 60/5 = 12.
->02Deviate
Differences from mean: −8, −5, +1, +4, +8.
->03Square
Squared: 64, 25, 1, 16, 64. Sum = 170.
->04Average
Population: 170/5 = 34.8. Sample: 170/4 = 42.5.
->05Root
σ = √34.8 = 5.90. s = √42.5 = 6.52.
Key facts before you calculate
Population formula (÷ n) versus sample formula (÷ n − 1): which to use
Use population standard deviation (σ, divides by n) when the dataset contains every member of the group you want to describe — all students in one class, all machines on one production line. Use sample standard deviation (s, divides by n − 1) when the dataset is a subset drawn to estimate the larger group — 100 survey respondents representing 10,000 users. Bessel's correction (n − 1) makes s slightly larger than σ because samples tend to underrepresent extreme values. For n = 5: dividing by 4 instead of 5 increases the estimate by 25%.
Why the mean alone is not enough — and how SD completes the picture
Two datasets can share the same arithmetic mean but have completely different distributions. Dataset A: {10, 10, 10, 10, 10} → mean = 10, SD = 0. Dataset B: {2, 6, 10, 14, 18} → mean = 10, SD = 5.66. Same center, completely different spread. A quality-control team watching a manufacturing process cares about both: a mean within spec but a high SD signals inconsistency that AM alone would hide.
Three variance and standard deviation errors that change the result
Each mistake below produces a different number — not just a different interpretation.
Watch for
Using population formula for a sample
For {4, 7, 13, 16, 20} as a sample: σ = 5.90 (wrong) vs s = 6.52 (correct). The 10% difference grows as the sample gets smaller. Use s² = Σ(xᵢ−x̄)² / (n−1) when estimating a larger group.
Watch for
Comparing standard deviations in different units
SD = 5.90 points for scores and SD = 2.1 kg for weights cannot be compared directly. Use coefficient of variation (CV = SD / mean × 100%) for unit-free comparison: CV = 5.90/12 × 100% = 49%.
Watch for
Removing outliers to reduce SD without cause
Removing the 20 from {4, 7, 13, 16, 20} drops σ from 5.90 to 4.44. That is a 25% reduction from a single deletion. Keep outliers unless you have a documented data-quality reason (sensor fault, entry error).
Keep going
Related calculators and reference guides
Continue with the Statistics hub, compare this result against a related method, or open a guide that covers the same data pattern in more depth.
Should I use population or sample standard deviation?
If your dataset contains every value in the group (all employees in a company, all items produced in a shift), use population SD (÷ n). If it is a sample (e.g., 50 employees randomly chosen from 1,000), use sample SD (÷ n − 1). In Excel: =STDEV.P() for population, =STDEV.S() for sample.
Why is standard deviation easier to read than variance?
Variance squares the deviations, so its unit is the square of the original (e.g., points² for test scores). Standard deviation takes the square root, returning the result to the original unit (points). For {4, 7, 13, 16, 20}: variance = 34.8 points², SD = 5.90 points — directly comparable to the mean of 12 points.
Why are deviations squared instead of just taking absolute values?
Squaring serves two purposes: (1) it prevents positive and negative deviations from canceling (|+8| and |−8| both contribute equally), and (2) it gives disproportionately more weight to large deviations — a value 8 units from the mean contributes 64 to the sum, while a value 4 units away contributes only 16. This is a deliberate feature that makes variance sensitive to large swings.
Can standard deviation be zero?
Yes, but only when every value is identical. {5, 5, 5, 5, 5}: mean = 5, all deviations = 0, σ = 0. A SD of zero means complete consistency — no variation in the data.
Is a high standard deviation always bad?
No. Context determines whether high spread is a problem. High SD in investment returns = more risk (bad for conservative investors). High SD in product test scores = wide customer talent range (neutral or good). Compare SD to the mean (CV) and to a relevant benchmark.
Should I remove outliers before calculating standard deviation?
Remove values only when you have a documented, non-statistical reason: sensor malfunction, data entry error, wrong unit. Removing outliers to get a 'cleaner' SD is statistical manipulation. Instead, report the SD both with and without the outlier, and note the reason.