How to use the standard deviation calculator
- Paste or type your numbers into the box, separated by commas, spaces, semicolons or new lines.
- Choose whether the main result should be the sample or population standard deviation. Both are always shown below.
- Read the mean, variance, standard error and the deviation table. Download the CSV to get every row.
Formula
mean = sum of values / n
SS = sum of (value - mean)^2
population variance = SS / n, sigma = sqrt(SS / n)
sample variance = SS / (n - 1), s = sqrt(SS / (n - 1))
standard error = s / sqrt(n)
Use the population formula when your numbers are the whole group. Use the sample formula when they are a sample drawn from a larger group.
Worked example
Take 2, 4, 4, 4, 5, 5, 7, 9. The sum is 40 and n is 8, so the mean is 5.
The deviations are -3, -1, -1, -1, 0, 0, 2, 4. Their squares are 9, 1, 1, 1, 0, 0, 4, 16, and the sum of squares is 32.
Population variance = 32 / 8 = 4, so the population standard deviation is 2.
Sample variance = 32 / 7 = 4.5714, so the sample standard deviation is 2.13809. The standard error is 2.13809 / sqrt(8) = 0.75593.
Sample or population?
If you measured every member of the group you care about, such as all 30 students in one class, use the population formula. If you measured some members to learn about a bigger group, such as 30 voters out of a city, use the sample formula. Dividing by n - 1 instead of n corrects for the fact that a sample tends to understate the spread of the whole group.
Why one number has no sample deviation
With a single value there is no spread to measure, and n - 1 would be zero. The tool shows the sample standard deviation as not defined, explains why, and still reports the population value of 0.
Numerically careful calculation
Many simple formulas subtract two huge, nearly equal numbers and lose all accuracy. This tool finds the mean first, then adds up squared distances from it, and applies a small correction for rounding in the mean. Values such as 1000000004, 1000000007, 1000000013 and 1000000016 give a sample standard deviation of 5.4772256 as expected, because the true sum of squares is 90.
Reading the results
About 68 percent of values in a bell-shaped data set fall within one standard deviation of the mean, and about 95 percent within two. That rule is a guide for roughly symmetric data only. For the center of your data use the average calculator, and for combining scores with weights use the grade calculator.
Assumptions and limits
- Up to 5,000 numbers are accepted, each with an absolute value of 1e150 or less so squares stay finite.
- Text that is not a number is ignored and listed in a warning, so check the count shown.
- Results show 8 significant digits. The CSV contains the same values.
- The standard error uses the sample standard deviation and assumes independent values.
- The step table on the page shows the first 25 values. The CSV contains every row.
Frequently asked questions
What does standard deviation tell me?
It is the typical distance of a value from the mean, in the same units as your data. A small value means the numbers cluster tightly and a large value means they are spread out.
Why is the sample standard deviation larger than the population one?
It divides the same sum of squares by n - 1 rather than n, so the result is always a little larger. The gap shrinks as the sample gets bigger.
What is variance?
Variance is the average of the squared deviations from the mean, which is the standard deviation squared. It is useful in formulas, while the standard deviation is easier to read because it keeps the original units.
What is the standard error of the mean?
It estimates how much the sample mean would vary from sample to sample. It equals the sample standard deviation divided by the square root of the count, so more data makes it smaller.
Can the standard deviation be negative?
No. It is a square root of an average of squares, so it is zero or positive. It is exactly zero only when every value is the same.