Standard Deviation & Variance Calculator
Population and sample standard deviation and variance, plus mean, median and range.
How it works
Find the mean, subtract it from each value, square the differences and add them up. Divide that sum by N for a population or by N − 1 for a sample to get the variance, then take the square root for the standard deviation.
Population: σ = √( Σ(x − mean)² / N )
Sample: s = √( Σ(x − mean)² / (N − 1) )Example
For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 40 / 8 = 5 and Σ(x − mean)² = 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32. Population: variance 32 / 8 = 4, standard deviation 2. Sample: variance 32 / 7 = 4.5714, standard deviation 2.1381.
Common mistakes
- Using the population formula for a sample. If your numbers are a sample from a larger group, divide by N − 1, which gives a slightly larger and fairer estimate.
- Comparing variance with the data directly. Variance is in squared units (dollars², cm²); the standard deviation is back in the original units.
- Expecting a sample result from a single number. One value has no spread to estimate, and N − 1 would be 0.
About this calculator
Paste or type up to 10,000 numbers, separated by commas, spaces or new lines. The calculator reports the count, sum, mean, median, minimum, maximum and range, then the variance and standard deviation twice: once for a population (divide by N) and once for a sample (divide by N − 1).
It calculates in two passes: the mean first, then the squared distance of every value from that mean. This avoids the precision loss of the shortcut formula on data with a large offset. Entries that are not numbers are listed by name rather than skipped. For 12 values or fewer, every squared deviation is written out.
Frequently asked questions
Should I use the population or the sample standard deviation?
Use the population figure when your numbers are the entire group you care about, such as every score in one class. Use the sample figure when they are a subset used to estimate a larger group, such as 30 customers out of thousands. When unsure, sample is the usual choice in statistics courses.
Why does the sample formula divide by N − 1?
The sample mean sits closer to the sample's own values than the true mean would, so dividing by N would underestimate the spread. Dividing by N − 1 (Bessel's correction) corrects for that on average.
What is the difference between variance and standard deviation?
The standard deviation is the square root of the variance. Both measure spread, but the standard deviation is in the same units as your data, which makes it easier to read.
Why does the sample result say it needs at least 2 values?
With one value there is nothing to compare it with, and N − 1 would be 0. The population variance of a single value is 0, and the calculator shows that, but the sample figures are left blank.
What happens to entries that are not numbers?
The calculator lists them by name under the input box and does not calculate until they are fixed, so a typo cannot quietly change your answer. Numbers can be negative or decimal, but not larger than 1e150 in size.