Calculators
Home › Learn › How to Find the SD

How to Find the Standard Deviation

Five steps, one worked example, and the n versus n − 1 fork explained.

Quick answer: Mean, deviations, squares, average (n - 1 for a sample), square root. For 42, 38, 45, 51, 44, 39, 47, 50: squares sum to 158, sample SD 4.75, population SD 4.44.

The recipe, in five steps

The standard deviation measures the typical distance between values and their mean, in the original units. Work it by hand once and every calculator output after that makes sense. Step 1: find the mean. Step 2: subtract the mean from every value (these are the deviations; they always sum to zero). Step 3: square each deviation, which kills the signs and charges big misses extra. Step 4: average the squares, with one fork in the road explained below. Step 5: take the square root, returning to the original units.

Worked example: a bakery's daily sales

Sales: 42, 38, 45, 51, 44, 39, 47, 50. Mean = 356 ÷ 8 = 44.5. Deviations: −2.5, −6.5, 0.5, 6.5, −0.5, −5.5, 2.5, 5.5. Squared: 6.25, 42.25, 0.25, 42.25, 0.25, 30.25, 6.25, 30.25, summing to 158. Treat the eight days as a sample: divide by n − 1 = 7 for a variance of 22.571, and the standard deviation is √22.571 = 4.75 sales. Treat them as the whole population of interest: divide by 8 for 19.75, and SD = 4.44.

The n versus n − 1 decision

Divide by n when your data is the entire population you care about. Divide by n − 1 when it is a sample standing in for a larger population: the sample's own mean sits closer to the sample's values than the true mean does, which shrinks the squared deviations, and dividing by n − 1 inflates the result back to an unbiased size. Software splits along the same line: Excel's STDEV.S and STDEV.P, R's sd() (sample). At large n the difference fades; at n = 8 it is the gap between 4.44 and 4.75 above.

Watch out

Averaging the deviations without squaring: they cancel to zero by construction, every time, for every dataset. The squaring (and the root at the end) is not decoration; it is what makes the measure exist. The mean absolute deviation skips the square by using absolute values instead, a legitimate but different statistic.

Frequently asked questions

Should I divide by n or n - 1?

n for a full population, n - 1 for a sample estimating a population's spread. Most real datasets are samples, so n - 1 is the common default.

What is the difference between variance and standard deviation?

The variance is step 4, the average squared deviation, in squared units. The standard deviation is its square root, back in the data's own units, which is why it is the one quoted next to means.

Can the standard deviation be larger than the mean?

Yes, easily, whenever data spread widely or include values near zero with big positives. It is a distance measure, not a share of the mean; compare it to the mean only through the coefficient of variation, with care.