What Is Standard Deviation, and How Do You Calculate It?

Standard deviation measures how spread out numbers are around their mean. To calculate it, find the mean, square each value’s difference from that mean, add the squared differences, divide by the appropriate count, and take the square root. The dividing step depends on whether you are describing a whole population or estimating its spread from a sample.

An average cannot show this spread by itself. Two sets of imaginary wooden-strip lengths, 9, 10, 11 centimeters and 6, 10, 14 centimeters, both average 10 centimeters. The second set is more spread out. Its standard deviation is larger even though its center is unchanged.

Five wooden strips of different lengths beside a steel ruler on a workbench.

What does the number tell you?

Standard deviation is often abbreviated SD. A smaller SD means less spread around the mean; zero means every recorded value is identical. It cannot be negative. It is not the ordinary average of the absolute distances from the mean, even though that is a tempting shorthand.

The answer uses the same units as the observations: centimeters for lengths, seconds for durations. Variance, the quantity calculated just before taking the square root, uses squared units. For lengths, a variance of 2 square centimeters produces an SD of about 1.41 centimeters. The NIST explanation of measures of spread describes this relationship.

Choose population or sample before calculating

A population is the complete set you want to describe. If your question concerns only five particular strips and you measure all five, divide the sum of squared differences by N = 5. This gives their population variance. Its square root is the population standard deviation, often written with the Greek letter σ.

If those five strips are a sample used to estimate the spread of a larger collection, the usual sample calculation divides by n − 1 = 4. Its square root is the sample standard deviation, written s. A large data set is not automatically a population, and a small one is not automatically a sample. The question defines the distinction.

Why subtract one? The sample mean has been estimated from the same observations. Under the usual independent random-sample assumptions with finite variance, dividing by n − 1 makes sample variance an unbiased estimator of population variance. That property applies to variance; taking its square root does not generally make the resulting SD unbiased. Penn State’s statistics notes discuss the variance correction. It does not fix unrepresentative sampling.

Adult hands holding a ruler along a wooden strip.

Work through five measured lengths

Use these invented lengths: 8, 9, 10, 11 and 12 centimeters. They make the arithmetic easy to inspect; the accompanying photos illustrate measurement rather than documenting these values.

1. Find the mean. Add the lengths: 8 + 9 + 10 + 11 + 12 = 50. Divide by five to get 10 centimeters. If you need a refresher, our guide to calculating an average explains the mean and how it differs from the median.

2. Subtract the mean from each value. The differences are −2, −1, 0, 1 and 2 centimeters. Their sum is zero, so simply averaging these signed differences would hide the variation.

3. Square and add. Squaring those differences gives 4, 1, 0, 1 and 4. Their sum is 10 square centimeters. Square the differences individually, not their combined total.

4. Divide to obtain variance. For the whole five-strip population, 10 ÷ 5 = 2 square centimeters. For a sample of five, 10 ÷ (5 − 1) = 2.5 square centimeters.

5. Take the square root. The population SD is √2, approximately 1.41 centimeters. The sample SD is √2.5, approximately 1.58 centimeters. Both answers are correct for their stated purposes. Keep full precision until the last step.

Check your calculator or spreadsheet setting

With those five numbers in cells A1 through A5, Excel’s =STDEV.P(A1:A5) returns the population result, while =STDEV.S(A1:A5) returns the sample result. Microsoft documents the distinction in its STDEV.P and STDEV.S references. Check the selected range and whether every measurement is stored as a number.

In Python’s statistics module, pstdev computes population SD and stdev computes sample SD, as the official documentation explains. A handheld calculator may label the outputs σx and sx. Check its manual rather than choosing whichever number looks familiar.

You need at least two observations for the n − 1 calculation. One observation considered as an entire population has SD zero, but tells you nothing about variation in a larger collection. Empty data have no SD. Keep genuine zeros and repeated measurements; do not turn missing observations into zeros.

Six wooden strips with aligned ends, including one much longer than the others.

Why outliers and context still matter

Squaring gives distant observations extra influence. Replace 12 with 20 in the worked example: 8, 9, 10, 11 and 20 now have mean 11.6 and population SD about 4.32 centimeters. One changed value raised both the center and the spread. Check unusual entries for transcription or unit errors, but do not remove a genuine observation merely to lower the result.

The range is maximum minus minimum: 4 centimeters for the original list and 12 for the changed list. It uses only the endpoints. SD uses every observation, but still cannot reveal whether the data form two groups, follow a trend, or contain one unusual value. Inspect the list or a plot alongside the summary.

There is no universal “good” SD. Report the unit, mean, observation count, and population or sample method. An SD alone does not establish a prediction interval or a percentage of values within a given distance. Bell-curve percentage rules require a suitable distribution assumption; these five invented lengths provide no basis for one.

For a handwritten calculation, leave separate columns for the measurements, differences and squares. You can browse graph-paper notebooks on Amazon, though plain paper or a spreadsheet is enough.

Response

  1. […] deviation, while the related large summation symbol ∑ instructs you to add terms. Our guide to standard deviation explains that statistical use. Recognizing the sigma family is useful, but it does not make these […]

Add comment

Leave a Reply