Skip to the calculator
Rule Calculator

Standard deviation calculator

Paste a list. You get the standard deviation both ways — dividing by n and by n − 1 — with the sum-of-squares table underneath, so the figure can be checked a row at a time rather than trusted.

By Alex Seote, Built and maintains Rule Calculator

Formulas checked against the NIST handbook · How we check

Commas, spaces, tabs or new lines. A column pasted straight out of a spreadsheet works.

Standard deviation (sample)

2.4103

7 values, summing to 99.

Mean14.142857
Median14
Modenone — no value repeats
Range7 (11 to 18)
Standard deviation, sample2.4103
Standard deviation, population2.2315
Variance, sample5.8095
Variance, population4.9796
Standard error of the mean0.911

Which middle to quote

Use the mean, 14.142857. The mean and the median agree to within a quarter of a standard deviation and nothing falls outside the outlier fences, so the mean is a fair summary of this list.

The working, one value at a time

A standard deviation is the square root of the average squared distance from the mean. The distances are below; squaring them is what stops the ones above and below cancelling out.

Value− meansquared
12-2.14294.5918
150.85710.7347
11-3.14299.8776
183.857114.8776
14-0.14290.0204
161.85713.449
13-1.14291.3061

Sum of squares: 34.8571

Divided by n − 1 = 6: 5.8095 (variance)

Square root: 2.4103 (standard deviation)

Quartiles and outliers

Minimum11
Q112
Median (Q2)14
Q316
Maximum18
Interquartile range4
Outlier fences6 and 22
Outliersnone

Q1 and Q3 above are medians of the halves either side of the median, which is the method US schools and the TI-83 use. Excel's QUARTILE.INC interpolates instead and gives 12.5 and 15.5 for this data. Neither is wrong — they are different conventions, and a calculator that prints one without naming it is why homework and spreadsheet disagree.

The divisor is the whole question

Every other figure on this page follows from the data. The divisor does not: it follows from what the data is. Eight test scores from a class of eight are a population, and their spread is a fact — divide by 8. Eight scores drawn from a school of four hundred are a sample, and their spread is an estimate of something larger — divide by 7.

The correction is named after Friedrich Bessel and it is not a rounding convenience. A sample clusters around its own mean more tightly than around the population mean it came from, so dividing by n produces a number that is too small on average, every time, no matter how large the sample. Dividing by n − 1 corrects exactly that bias.

Questions people actually ask

Do I divide by n or by n − 1?
By n when your numbers are the entire group you are describing — every game this season, every part in the batch. By n − 1 when they are a sample you are using to estimate a bigger group you did not measure. The correction exists because a sample sits closer to its own mean than to the true one, so dividing by n would understate the spread every time. When in doubt in a statistics course the answer is almost always n − 1.
Why square the differences instead of just averaging them?
Because the differences from the mean always sum to exactly zero — that is what a mean is. Squaring removes the signs so the distances stop cancelling, and taking the square root at the end returns the answer to the units of the original data. Averaging the absolute differences is a real alternative called the mean absolute deviation; it is simply not what a standard deviation is.
What is the standard error, and how is it different?
The standard deviation says how spread out the values are. The standard error says how far the mean itself might be from the truth, and it is the sample standard deviation divided by the square root of n. Four times the data halves the standard error while leaving the standard deviation roughly where it was — the spread of the population does not shrink because you measured more of it.
Why does my Q1 not match my spreadsheet?
Because there is more than one quartile convention and both are in wide use. The figures here take the median of each half, which is the method US textbooks and the TI-83 use. Excel’s QUARTILE.INC interpolates between the two nearest values and lands somewhere else on most data sets. The quartile panel above prints both when they disagree, so you can see which one your marker expects.
Does one outlier really change the answer that much?
It changes the standard deviation more than anything else in the list, because the distance from the mean is squared before it is added — a value ten times further out contributes a hundred times more. That is why the outlier fences are printed above, and why the page says which of the mean and median describes your data better.

Sources

Related