Standard Deviation Calculator
Compute the standard deviation and variance of a data set as either a full population or a sample, with the denominator you are dividing by stated up front.
Calculator
- Population and sample modes
- Variance and standard deviation
- Declares the denominator
- Rejects sample n<2
Result & calculation receipt
- Method
- Sample standard deviation (denominator n − 1 = 7)
- Formula
s = √( Σ(xᵢ − x̄)² / (n − 1) )- Substitution
- s = √(32 / 7) = √4.571429 = 2.13808994
- Steps
- Mean = 5.
- Squared deviations: [9, 1, 1, 1, 0, 0, 4, 16].
- Sum of squared deviations = 32.
- Divide by n − 1 = 7 → variance = 4.57142857.
- Standard deviation = √variance = 2.13808994.
- Verification
- Variance × 7 = 32 recovers Σ(xᵢ − x̄)² = 32. ✓
- Decimal result
- standardDeviation: 2.13808994 · variance: 4.57142857 · mean: 5 · n: 8 · denominator: 7
- Engine
- math-solvers v1.4.0
How this calculator works
The calculator finds the mean, then the squared deviation of each value from it. It sums those squared deviations and divides by n for a population or by n − 1 for a sample (Bessel’s correction), giving the variance; the standard deviation is its square root. It shows each squared deviation and refuses a sample standard deviation of fewer than two values.
Worked example
For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5. The squared deviations sum to 32. As a population, variance = 32 ÷ 8 = 4 and the standard deviation is 2. As a sample, variance = 32 ÷ 7 ≈ 4.57 and the standard deviation ≈ 2.14 — slightly larger, because dividing by n − 1 corrects the sample’s tendency to understate spread.
Key insight
The choice between n and n − 1 is not cosmetic: a sample almost always underestimates the true spread, and dividing by n − 1 compensates. Always ask whether your numbers are the entire population or a sample drawn from a larger one — the answer changes the denominator.
Frequently asked questions
What is standard deviation?
It measures how spread out a data set is around its mean. A small standard deviation means the values cluster near the mean; a large one means they are widely scattered. It is the square root of the variance.
What is the difference between sample and population standard deviation?
The population version divides the sum of squared deviations by n; the sample version divides by n − 1 (Bessel’s correction) because a sample underestimates the true spread. The calculator states which denominator it used.
When should I use n − 1?
Use n − 1 when your data is a sample drawn from a larger population and you want to estimate that population’s spread. Use n only when your data is the entire population.
Why can’t I compute a sample standard deviation of one value?
The sample formula divides by n − 1, which is zero for a single value, so it is undefined. The calculator requires at least two values in sample mode.
What is variance?
Variance is the average squared deviation from the mean — the standard deviation before taking the square root. It is in squared units, which is why the standard deviation (its root) is usually reported.
Methodology & verification
The mean is computed, then each value’s squared deviation from it. The sum of squared deviations is divided by n (population) or n − 1 (sample, Bessel’s correction) to give the variance, whose square root is the standard deviation. The denominator used is stated explicitly. Empty input and non-numeric values return structured errors, and a sample standard deviation of fewer than two values is rejected. The receipt confirms variance × denominator recovers the sum of squared deviations.
Engine: math-solvers v1.4.0 · Last reviewed: · Every result is computed client-side and never sent to a server. See the verification methodology and the scientific calculator validation.