HomeTools › Standard Deviation Calculator

Standard Deviation Calculator

Paste a column of numbers, or a frequency table, and get the sample and population standard deviation and variance, the mean, the standard error of the mean and the coefficient of variation. The step panel shows the whole calculation: the mean, every deviation, the sum of squares, and why a sample divides by n - 1.

I want the standard deviation of a list of numbers

Your data

One number per line, or separated by commas or spaces. Headers, currency symbols and blanks are handled.

Try:
 
Treat data as
sample

 

 
 
Mean
 
Count n
 
SD (sample, n-1)
 
SD (population, n)
 
Variance (sample)
 
Variance (pop.)
 
Std. error of mean
 
Coef. of variation
 
 
 
 
Show the steps on your data
The same thing in R
 
No data leaves your browser Verified against R's sd(), var() and mean() Free, no sign-up

Sample or population: which one do you want?

The two standard deviations differ only in what you divide by. The choice depends on what your numbers represent, not on the data itself.

Population (divide by n)

Use this when your numbers are the whole group you care about: every student in a class, all of last month's orders. There is nothing to estimate, so you divide the sum of squares by the full count n.

Sample (divide by n - 1)

Use this when your numbers are a sample and you want to estimate the spread of the larger population they came from. Dividing by n - 1 corrects a downward bias. This is R's default and the usual choice in practice.

The gap shrinks with n

For n = 2 the sample SD is noticeably larger; by n = 100 the two are within a percent of each other. With a lot of data it rarely matters which you pick, but reporting the right one is still good practice.

What each number means

QuantityFormulaWhat it tells you
Meansum(x) / nThe balance point of the data, and the reference every deviation is measured from.
Sum of squaressum((x - mean)^2)The total squared distance from the mean. Every spread number is built from this.
Sample varianceSS / (n - 1)Average squared deviation with Bessel's correction. In squared units.
Population varianceSS / nAverage squared deviation over the whole group. In squared units.
Standard deviationsqrt(variance)Typical distance of a value from the mean, back in the original units.
Standard errorsd / sqrt(n)Uncertainty in the mean itself; shrinks as the sample grows.
Coefficient of variationsd / meanSpread relative to the mean, as a percent. For positive, ratio-scale data.
Frequently asked questions
What is the difference between sample and population standard deviation?

They differ only in the denominator. The population standard deviation divides the sum of squared deviations by n, the full count, and is used when your numbers are the entire group you care about. The sample standard deviation divides by n - 1 and is used when your numbers are a sample from a larger population whose spread you want to estimate. For the same data the sample value is always a little larger. This calculator shows both every time.

Why do you divide by n - 1 for a sample?

Because the sample mean is estimated from the same data, the deviations from it are on average slightly too small, which would bias the variance low. Dividing by n - 1 instead of n corrects that bias. The n - 1 is the degrees of freedom: once the mean is fixed, only n - 1 of the deviations are free to vary. This is Bessel's correction, exactly what R's sd() and var() use.

What does the standard deviation actually tell you?

It is the typical distance of a value from the mean, in the same units as the data. A small standard deviation means the values cluster tightly around the mean; a large one means they are spread out. For roughly bell-shaped data about 68 percent of values fall within one standard deviation of the mean and about 95 percent within two.

Standard deviation vs standard error: what is the difference?

The standard deviation describes the spread of the individual values. The standard error of the mean describes how precisely you have pinned down the mean, and equals the standard deviation divided by the square root of n. Collect more data and the standard deviation settles toward the true spread, but the standard error keeps shrinking.

What is the coefficient of variation?

The coefficient of variation (CV) is the standard deviation divided by the mean, usually shown as a percent. It expresses spread relative to the size of the values, so you can compare variability across data on different scales. It only makes sense for positive, ratio-scale data, and is misleading when the mean is near zero or the values mix signs.

How do I calculate standard deviation by hand?

Find the mean, subtract it from every value to get the deviations, square each, and add them for the sum of squares. Divide by n - 1 for the sample variance (or by n for the population variance), then take the square root. The step panel above does exactly this on your numbers and shows every running total.

Keep going

Tools that pick up where the standard deviation leaves off.