Standard Deviation Calculator
Enter your numbers, one per line, to get the variance and standard deviation. Both the population (divide by n) and the sample (divide by n − 1) versions are shown.
How variance and standard deviation are calculated
- Sum of squared deviations = the sum of (each value − the mean)²
- Population variance = sum of squared deviations ÷ n (use it when you have every value in the group you care about)
- Sample variance = sum of squared deviations ÷ (n − 1) (use it when your data is a sample used to estimate the spread of a larger group)
- Population standard deviation = √(population variance), and sample standard deviation = √(sample variance)
Variance and standard deviation both describe how spread out the data is. The standard deviation is the square root of the variance, so it has the same unit as the data.
Population or sample?
- Population: the whole group you want to describe (for example, the test scores of every student in one class). Divide by n.
- Sample: a part of a larger group (for example, 100 people chosen from a country). When you use a sample to estimate the spread of the whole group, divide by n − 1 (this gives the unbiased estimate, also called Bessel's correction).
If you are not sure, your data is usually a sample, so the sample version (n − 1) is the usual choice. With a lot of data, the two values are close.
The names in Excel
| Shown here | Divided by | Excel function |
|---|---|---|
| Population variance | n | VAR.P |
| Sample variance | n − 1 | VAR.S |
| Population standard deviation | n | STDEV.P |
| Sample standard deviation | n − 1 | STDEV.S |
Some textbooks use the words "sample variance" for the version that divides by n, so check the definition your course or software uses. This calculator labels each result with its divisor (n or n − 1) to avoid confusion.
Examples
- 2, 4, 4, 4, 5, 5, 7, 9: n = 8, mean 5, sum of squared deviations 32. Population variance 4, population standard deviation 2 (exact). Sample variance 32/7 ≈ 4.571429, sample standard deviation ≈ 2.13809.
- 1, 2, 3, 4, 5: mean 3, sum of squared deviations 10. Population variance 2, population standard deviation ≈ 1.414214. Sample variance 2.5, sample standard deviation ≈ 1.581139.
Notes
- With only 1 value, the population variance and standard deviation are 0. The sample variance and sample standard deviation would divide by n − 1 = 0, so they are shown as "Not available". Enter 2 or more values.
- If all the values are the same, the variance and the standard deviation are 0.
- Variances are calculated as exact fractions. Standard deviations are square roots approximated to 40 decimal places and shown with 7 significant digits. They are labeled "exact value" when the square root is exact (a perfect square) and "rounded value" otherwise.
- You can enter 1 to 1,000 numbers. Each can have up to 12 digits before the decimal point and 6 decimal places.
- To find the mean, median and range, use the Mean & Median Calculator.
Frequently asked questions
Should I use the population or the sample standard deviation?
Use the population version when your data is the entire group you are describing, and the sample version when your data is only part of a larger group. If you are unsure, the sample version (n − 1) is the usual choice.
When is the standard deviation 0?
When all the values are the same. There is no spread, so the standard deviation is 0.
Why is the standard deviation shown as a "rounded value"?
The square root of the variance often does not end as a decimal. It is approximated to 40 decimal places, which is far more precise than the 7 significant digits displayed.
Why is 1,000 not accepted?
A comma with no space after it could be a thousands separator (1,000 = 1000) or a separator between two numbers (1 and 000), and some countries also use it as a decimal comma. Instead of guessing, the calculator asks you to write 1000, or to put each number on its own line.