Home / Math / Standard Deviation Calculator
Standard Deviation Calculator
Paste or type a list of numbers to see how spread out they are. You get the population and sample standard deviation, both variances, the mean, sum, count and standard error, with a working table.
The formulas
Standard deviation measures the typical distance between the values and their mean. It is the square root of the variance, which is the average squared deviation. The two versions differ only in the divisor:
| Measure | Formula |
|---|---|
| Mean | x̄ = Σx ÷ n |
| Population variance | σ² = Σ(x − x̄)² ÷ n |
| Sample variance | s² = Σ(x − x̄)² ÷ (n − 1) |
| Standard deviation | the square root of the variance |
| Standard error of the mean | s ÷ √n |
The calculation uses two passes: the mean first, then the deviations. That is numerically safer than the shortcut formula built from the sum of squares, which can lose accuracy when values are large and close together.
Population or sample: which one to use
Use the population version (divide by n) when your list contains every member of the group you care about, such as the scores of all students in one class when you only want to describe that class. Use the sample version (divide by n − 1) when the list is a subset used to learn about a larger group. Dividing by n − 1, known as Bessel's correction, compensates for the fact that deviations measured from the sample mean are slightly smaller than deviations from the true mean, so the sample variance would otherwise come out too low on average.
When n is large the two results are nearly identical. With only a handful of values the difference is noticeable. If in doubt about your data, the sample version is the usual default in statistics courses and software.
Reading the result
A small standard deviation means values cluster near the mean; a large one means they are spread out. It carries the same unit as the data, so compare it with the mean using the coefficient of variation when the scales differ. For data that follows a bell-shaped (normal) distribution, roughly 68% of values fall within one standard deviation of the mean, about 95% within two and about 99.7% within three. That rule does not hold for strongly skewed data. The standard error is different: it describes how precisely the sample mean estimates the true mean, and it shrinks as the sample grows.
Pitfalls
- One extreme value can inflate the standard deviation sharply, so check for typing errors such as a misplaced decimal point.
- A sample needs at least two values, since dividing by n − 1 with one value would divide by zero.
- Do not mix units, such as metres and centimetres, in the same list.
- Standard deviation says nothing about the shape of the data. Two very different distributions can share the same value.
Worked example
Eight test scores: 10, 12, 23, 23, 16, 23, 21, 16. The mean is 18 and the squared deviations add up to 192, so the sample variance is 192 ÷ 7.
Inputs
| Numbers | 10, 12, 23, 23, 16, 23, 21, 16 |
|---|---|
| Show as the main result | Sample standard deviation (n − 1) |
Result
Sample standard deviation of 8 values.
| Count (n) | 8 |
|---|---|
| Sum | 144 |
| Mean | 18 |
| Sample standard deviation (s) | 5.2372 |
| Sample variance (s²) | 27.4286 |
| Population standard deviation (σ) | 4.899 |
| Population variance (σ²) | 24 |
| Standard error of the mean (s ÷ √n) | 1.8516 |
| Sum of squared deviations | 192 |
| Coefficient of variation (s ÷ mean) | 29.0957% |
Working: deviations from the mean
| Value | Deviation from mean | Squared deviation |
|---|---|---|
| 10 | -8 | 64 |
| 12 | -6 | 36 |
| 23 | 5 | 25 |
| 23 | 5 | 25 |
| 16 | -2 | 4 |
| 23 | 5 | 25 |
| 21 | 3 | 9 |
| 16 | -2 | 4 |
Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.
Frequently asked questions
What is the difference between population and sample standard deviation?
Population standard deviation divides the sum of squared deviations by n and describes a complete group. Sample standard deviation divides by n − 1 and estimates the spread of a larger group from a subset.
What is the standard deviation of 2, 4, 4, 4, 5, 5, 7, 9?
The mean is 5 and the squared deviations add up to 32. The population standard deviation is √(32 ÷ 8) = 2, and the sample standard deviation is √(32 ÷ 7), about 2.138.
Can standard deviation be negative?
No. It is a square root of an average of squares, so it is zero or positive. It equals zero only when every value in the list is identical.
What is the difference between standard deviation and standard error?
Standard deviation describes how spread out individual values are. Standard error, the sample standard deviation divided by the square root of n, describes the uncertainty in the sample mean.
How many numbers can I enter?
Up to 5,000 numbers separated by commas, spaces or new lines. A working table of deviations is shown for lists of 30 values or fewer.
Related calculators
References and sources
- NIST/SEMATECH e-Handbook of Statistical Methods, sections on measures of scale and variance. Link
- Bessel's correction, as described in standard introductory statistics textbooks.