Standard Deviation Calculator
Calculate variance and standard deviation for a data set — both population and sample versions — with sum of squares and step-by-step working.
What standard deviation measures
Standard deviation tells you, on average, how far the values in a data set sit from the mean. A small standard deviation means the data clusters tightly around the average; a large one means the values are spread out. It's the most widely used measure of spread precisely because it's expressed in the same units as the original data — unlike variance, which is in squared units.
The calculation, step by step
- Find the mean: x̄ = (Σxᵢ) ÷ n
- Find each deviation from the mean: (xᵢ − x̄) for every value
- Square each deviation: (xᵢ − x̄)² — this makes every term positive and penalizes larger deviations more
- Sum the squared deviations: SS = Σ(xᵢ − x̄)² — the "sum of squares"
- Divide by n (population) or n − 1 (sample) to get variance
- Take the square root of variance to get standard deviation, back in the original units
Population vs. sample: why there are two answers
Every data set has two valid variance/standard-deviation formulas, and the difference comes down to one question: is this data set the whole population, or a sample drawn from a bigger one?
| Population | Sample | |
|---|---|---|
| Divide SS by | n | n − 1 |
| Use when | The data IS the entire group you care about | The data is a sample representing a larger group |
| Symbol | σ² (variance), σ (std dev) | s² (variance), s (std dev) |
| Effect | Smaller value | Slightly larger value (corrects for bias) |
Dividing by n − 1 instead of n is called Bessel's correction. A sample's mean is computed from the same values used to measure spread, which makes a sample look slightly less variable than the true population it came from. Subtracting 1 from the divisor inflates the estimate just enough to offset that bias — the result is an unbiased estimator of the population variance.
Worked example
For the data set 42, 54, 65, 47, 59, 40, 53 (7 values):
- Mean = (42+54+65+47+59+40+53) ÷ 7 = 360 ÷ 7 ≈ 51.43
- Sum of squares = Σ(xᵢ − 51.43)² ≈ 489.71
- Population variance = 489.71 ÷ 7 ≈ 69.96
- Sample variance = 489.71 ÷ 6 ≈ 81.62
- Population std dev = √69.96 ≈ 8.364
- Sample std dev = √81.62 ≈ 9.034
Notice the sample values (81.62, 9.034) are always a little larger than the population values (69.96, 8.364) for the same data — that's Bessel's correction at work.
Where it's used
Standard deviation shows up anywhere spread matters as much as the average: quality control (how consistent are the parts coming off a production line?), finance (how volatile is a stock's return?), grading (how spread out were the test scores?), and science (how much did repeated measurements vary?). For the central-tendency measures this calculation builds on, see mean, median, and mode; to compare an individual value against the spread of a data set, see z-score; for a fuller statistical summary in one pass, see descriptive statistics.
Frequently asked questions
- Should I use population or sample standard deviation?
- Use the population formula (divide by n) only when your data set IS the entire population you care about — every student in a class, every part in a batch. Use the sample formula (divide by n − 1) whenever your data is a sample drawn from a larger group you're trying to describe, which is the far more common case in practice.
- Why does the sample formula divide by n − 1 instead of n?
- This is called Bessel's correction. A sample's own mean is calculated from the same data used to measure spread, which makes the sample slightly less spread out than the true population on average. Dividing by n − 1 instead of n inflates the result just enough to correct for that bias, giving an unbiased estimate of the population variance.
- Why square the deviations instead of just averaging the differences?
- If you averaged the raw differences from the mean, the positive and negative differences would cancel out to zero every time — that's a property of the mean itself. Squaring makes every deviation positive before averaging, so the result reflects the true spread instead of canceling to nothing. It also weights larger deviations more heavily than smaller ones.
- Why take the square root at the end?
- Squaring the deviations changes their units — variance for a data set of dollars is in "squared dollars," which isn't intuitive. Taking the square root of variance converts back to the original units, so standard deviation can be compared directly to the mean and the data itself.
- What does a small standard deviation mean compared to a large one?
- A small standard deviation means the values are clustered tightly around the mean — the data set is consistent. A large standard deviation means the values are spread out further from the mean — the data set is more variable. Two data sets can share the same mean but have very different standard deviations.
- Why do I need at least two numbers?
- The sample variance formula divides by n − 1, so with a single value (n = 1) that divisor becomes 0 and the calculation is undefined. Population variance and standard deviation for a single value are mathematically 0 (there is no spread), but since this calculator always reports both versions side by side, it requires at least two values.