MathsStatistics & Probability

Standard Deviation
calculator.

Paste your numbers to get their standard deviation, the working and a histogram.

How it's worked out

Standard deviation measures how far your values typically sit from their mean. The calculator follows the same four steps you would do by hand.

  1. Find the mean, x‾\bar{x}: add the values and divide by how many there are, nn.
  2. Subtract the mean from each value to get its deviation, x−x‾x - \bar{x}. These always add up to 0, which is the check in the working.
  3. Square each deviation and add them. Squaring stops the negative and positive deviations from cancelling out.
  4. Divide by n−1n - 1 for a sample or by NN for a whole population, then take the square root.
s =∑(x−x‾)2n−1\sqrt{\frac{\sum (x - \bar{x})^2}{n - 1}}848.009\sqrt{\frac{848.00}{9}}9.71
x‾\bar{x} = 80.00the mean of the ten exam scores belownn = 10how many scores there are∑(x−x‾)2\sum (x - \bar{x})^2 = 848.00the squared deviations added up

For a whole population, divide by NN instead of n−1n - 1:

σ\displaystyle \sigma=∑(x−μ)2N\displaystyle {}= \sqrt{\frac{\sum (x - \mu)^2}{N}}

Here ss is the sample standard deviation and σ\sigma (sigma) is the population one. The value inside the square root is the variance. It is in squared units, such as square points or square grams, which is why you take the root to get back to the units of your data.

Why n−1n - 1? Your deviations are measured from the sample mean, and the sample mean always sits closer to your own values than the true mean does. Dividing by nn would make the spread look too small on average. Dividing by one less fixes that. This is called Bessel's correction. With three values such as 4, 7 and 9, it is the difference between s = 2.52 and σ = 2.05.

The standard error, sn\frac{s}{\sqrt{n}}, tells you how precisely the mean is known. The coefficient of variation, s|x‾|\frac{s}{|\bar{x}|}, gives the spread as a percentage of the mean, so you can compare data on different scales.

Worked examples

A teacher's ten exam scores

Ms. Ortiz has ten scores out of 100: 72, 85, 90, 64, 78, 88, 95, 70, 81, 77. The mean is 80.00. The squared deviations add up to 848.00. The class is a sample of the students who could take this test, so she divides by 9: s² = 94.22 and s = 9.71 points. Most scores sit within one standard deviation of the mean, between about 70 and 90.

Open this example in the tool

Coffee bag fill weights

A roaster weighs eight bags labeled 500 g: 498, 502, 500, 497, 503, 501, 499, 500 g. The mean is 500 g and s = 2.00 g. The coefficient of variation is 0.4%, so the filler is very consistent. The standard error is 0.71 g, which says how far the mean of these eight bags is likely to be from the true average fill.

Open this example in the tool

Reaction times with one slow reading

A student records seven reaction times in hundredths of a second: 12, 14, 13, 15, 14, 13, 48. The 48 is far from the rest. With it, s = 13.07. Tukey's fences run from 10.75 to 16.75, so 48 is flagged as an outlier. Without it, s drops to 1.05. One reading is responsible for almost all of the spread, so it is worth checking before you report anything.

Open this example in the tool

Reading your result

The standard deviation is in the same units as your data. An s of 9.71 on exam scores means a typical student is about 10 points from the class average. It is not the biggest gap, which is the range.

For bell-shaped data, about 68% of values fall within 1 SD of the mean, 95% within 2 SD and 99.7% within 3 SD. The check card counts how many of your values do this. If your counts are far from those shares, your data are probably skewed, and the median and interquartile range may describe them better.

The tool flags a value as an outlier when it lies more than 1.5 times the interquartile range beyond the first or third quartile. This is Tukey's rule, as used in the NIST e-Handbook. Past 3 times the interquartile range, the value is called far out. An outlier is a reason to check the reading, not proof that it is wrong.

For a quick sanity check, compare s with the range. In bell-shaped data, the range is usually about 3 standard deviations wide when you have 10 values and about 4 when you have 25, because more values reach further into the tails. Ms. Ortiz has ten scores with a range of 31 points and an s of 9.71, which fits that pattern.

Common mistakes

  • Using the population formula on a sample. Unless your data cover every member of the group, choose Sample. With ten exam scores the two answers are 9.71 and 9.21.
  • Taking the square root too early. Add the squared deviations first, divide, and only then take the root. Rooting each squared deviation just gives back the absolute deviations.
  • Reporting the variance as the spread. Variance is in squared units. An exam variance of 94.22 is in square points, which is hard to read.
  • Mixing up spreadsheet functions. In Excel and Google Sheets, STDEV.S matches Sample here and STDEV.P matches Population.
  • Keeping a typo. A misplaced decimal point, such as 480 for 48, inflates s far more than it moves the mean, because deviations are squared.

Questions people ask

Use Population only when your data include every member of the group you are describing, such as every employee in a 12-person company. If the numbers are a sample used to say something about a larger group, such as one class standing in for all students, use Sample, which divides by n − 1. When in doubt, Sample is the safer choice.

Sources