1. Home
  2. Guides
  3. How to calculate standard deviation by hand, step by step
Education

How to calculate standard deviation by hand, step by step

Calculate standard deviation in five steps, choose between sample and population formulas, read the result and see how one outlier can change everything.

Calculator Simply cover image for the guide 'How to calculate standard deviation'

What standard deviation measures

Standard deviation describes how spread out a set of numbers is around its mean. A small value means the numbers sit close to the average; a large value means they are scattered. It is expressed in the same units as the data, so a standard deviation of test scores is in points and one of delivery times is in minutes.

The calculation has five steps: find the mean, subtract it from each value, square those differences, average the squares, and take the square root. The average of the squares is the variance. The NIST/SEMATECH Engineering Statistics Handbook describes the variance as roughly the average squared distance from the mean, and the standard deviation as its square root.

A full worked example

Take six quiz scores: 72, 85, 90, 64, 78 and 91. First find the mean. The Average Calculator gives a sum of 480 and a mean of 80.

Next, subtract 80 from each score to get the deviations: −8, 5, 10, −16, −2 and 11. They always add up to zero, which is a handy check that the mean is right. Square each deviation so negatives stop canceling positives: 64, 25, 100, 256, 4 and 121. These add up to 570, the sum of squares.

Now divide. If these six scores are the whole group you care about, divide by 6 to get a population variance of 95 and a standard deviation of √95 = 9.746794. If they are a sample drawn from a larger group, divide by 5 instead to get 114 and a standard deviation of 10.677078. The Statistics Calculator returns both, depending on the Data model you choose.

Worked exampleMean: 480 ÷ 6 = 80. Deviations: −8, 5, 10, −16, −2, 11 (sum 0). Squares: 64 + 25 + 100 + 256 + 4 + 121 = 570. Population: 570 ÷ 6 = 95, √95 = 9.746794. Sample: 570 ÷ 5 = 114, √114 = 10.677078.

Sample or population: N or N − 1

Use the population formula, dividing by N, when your data includes every member of the group you are describing: every student in one class, every invoice from one month. Use the sample formula, dividing by N − 1, when your numbers are a subset you are using to estimate the spread of something larger.

The sample version always comes out a little larger. Dividing by one less compensates for the fact that a sample tends to sit closer to its own mean than to the true mean of the whole population. The NIST handbook gives the sample formula with N − 1 as its definition.

Spreadsheets follow the same split. Microsoft documents STDEV.S as the sample function and STDEV.P as the one to use when the data represents the entire population. With large data sets the two answers converge; with six numbers, as above, the gap is almost a full point.

How to read the result

Compare the standard deviation with the mean and with the range. A mean of 80 with a standard deviation near 10 says that most scores in this small set fall within about ten points of 80, which matches the data: four of the six lie between 70 and 90.

For data that is roughly bell-shaped, the 68-95-99.7 rule gives a quick picture. OpenStax states that in a normal distribution about 68% of values fall within one standard deviation of the mean, about 95% within two and 99.7% within three. Real data only follow this approximately, and skewed data may not follow it at all.

Standard deviation is most useful for comparison. Two classes with the same average of 80 but standard deviations of 4 and 15 had very different experiences: one cluster of similar scores, and one spread from struggling to excellent. The averages alone hide that.

Edge case: one outlier changes everything

Because the deviations are squared, values far from the mean carry extra weight. Add a single score of 20 to the six quiz scores. The mean drops from 80 to 71.428571, but the sample standard deviation more than doubles, from 10.677078 to 24.683714.

The median barely moves, from 81.5 to 78. When your data has extreme values or a long tail, report the median alongside the mean, and check whether the outlier is a real observation or a typing error. The NIST handbook notes that standard deviation is sensitive to extreme values and suggests more robust measures, such as the interquartile range, for long-tailed data.

Worked exampleSeven scores 72, 85, 90, 64, 78, 91, 20: mean 71.428571, median 78, sample variance 609.285714, sample standard deviation 24.683714 (population: 22.852678).

Edge cases: one value, identical values and units

A single number has no spread. Its population standard deviation is 0, because the only value equals the mean. The sample formula cannot be used at all, since dividing by N − 1 means dividing by zero. The Statistics Calculator rejects a one-number sample for that reason and asks for at least two values.

When every value is identical, such as 80, 80, 80 and 80, both versions return 0. A result of exactly zero is a useful sign that nothing varied, or that the same number was pasted in by mistake.

Standard deviation can never be negative, since it is the square root of an average of squared numbers. If you ever get a negative result by hand, recheck the subtraction in your squared deviations. And remember the units: rescaling the data rescales the answer, so the same scores rescaled from out of 100 to out of 50 have exactly half the standard deviation.

Common mistakes

Forgetting the square root. The variance (114 in the example) is in squared units. Standard deviation is its square root, 10.68 points.

Averaging the absolute deviations. Adding up the distances without squaring gives the mean absolute deviation, a different statistic. For the example it is 52 ÷ 6 = 8.67, not 9.75.

Rounding the mean early. If the mean is 71.428571, rounding it to 71 before computing deviations distorts every squared term. Keep full precision until the end.

Mixing the formulas. Variance and standard deviation must use the same choice of N or N − 1. Taking the square root of a population variance and labeling it a sample standard deviation gives the wrong number.

Which calculator to use

Use the Statistics Calculator for the full picture in one pass: standard deviation, mean, median, variance, range and count, with a switch between sample and population. Use the Variance Calculator when an assignment or formula asks for variance specifically. Use the Average Calculator to check the mean and sum when you are working the steps by hand.

If the numbers will inform a decision about health, money or quality control, the calculation is only the first step. A statistician or subject expert can tell you whether the spread you found is meaningful for your situation.

Sources and further reading

Try the calculators