← All blog posts

Standard Deviation Calculator formula — how it actually works

WhiteUI · A plain-English guide to the Standard Deviation Calculator

Every answer from the Standard Deviation Calculator comes from four steps in a row: find the mean, measure how far each number sits from it, square those distances and average them, then take the square root. Here is each step, worked out on 10, 20, 30, 40 and 50.

The formulas

Mean = sum of the numbers ÷ count
Population variance = mean of (each number − mean)²
Population SD = square root of population variance
Sample SD uses ÷ (count − 1) instead of ÷ count

Worked example

Step 1, the mean: (10 + 20 + 30 + 40 + 50) ÷ 5 = 30. Step 2, the distances from the mean: −20, −10, 0, 10 and 20. Step 3, square them and average: (400 + 100 + 0 + 100 + 400) ÷ 5 = 200 — that is the population variance. Step 4, the square root: √200 = 14.14. For the sample version, step 3 divides by 4 instead of 5: 1,000 ÷ 4 = 250, and √250 = 15.81.

Mean = 150 ÷ 5 = 30
Distances from mean = −20, −10, 0, 10, 20
Squared distances = 400, 100, 0, 100, 400 (sum 1,000)
Population variance = 1,000 ÷ 5 = 200, population SD = √200 = 14.14
Sample variance = 1,000 ÷ 4 = 250, sample SD = √250 = 15.81

At a glance

The four steps start from the mean of 30Mean 301050Every distance is measured from the mean.
The mean of 30 is the anchor: every distance, square and average in the formula is measured from it.

Why square the distances

The distances −20, −10, 0, 10 and 20 add to exactly 0 — the negatives cancel the positives. Squaring them first stops the cancellation: 400 + 100 + 0 + 100 + 400 = 1,000, a real measure of spread. The square root at the end undoes the squaring, so the answer comes back in the same units as your numbers.

The mistake to avoid

Dividing by the wrong count. The population version divides by the count (5 here); the sample version divides by the count minus one (4 here). Mix them up and 14.14 becomes 15.81 — close, but wrong for the version you wanted. Decide first whether your list is everything or a sample, then read the matching line.

Population or sample — the one decision the formula cannot make for you

The formula has two versions and no opinion about which one you need. The population version divides the squared distances by the count; the sample version divides by the count minus one. The calculator shows both, but it cannot know whether your list is everything or a sample — only you know that, and the decision has to come before you read the number, not after.

Take 40, 45, 50, 55 and 60. The mean is 50, the population standard deviation is 7.07 and the sample version is 7.91 — 0.84 apart. The gap is biggest on short lists, because dividing by 5 instead of 4 is a 25% difference in the variance. With fifty numbers, dividing by 50 instead of 49 is a 2% difference, and the two answers nearly agree. So the shorter the list, the more the decision matters — and the more it pays to make it deliberately.

The check that proves the formula ran right

Three checks, all from the same list. First, square the standard deviation back to the variance: for 40, 45, 50, 55 and 60, 7.07² = 49.98, which is the population variance of 50 apart from rounding. Second, add the distances from the mean: −10, −5, 0, 5 and 10 add to exactly 0, as they must for any list. Third, check the band: the standard deviation of 7.07 sits between 0 and the range of 20.

If all three pass, the formula ran right and the answer is the answer. If one fails, work backwards: a failed square points at the standard deviation line, a failed zero-sum points at the mean, and an answer outside the band points at a mistyped number. The checks are short, and they beat re-doing the whole calculation by hand.

Frequently asked questions

What is the formula for standard deviation?

Find the mean, square each distance from the mean, average those squares to get the variance, then take the square root. The sample version divides by the count minus one instead of the count.

Why do you square the distances?

Because the plain distances add to zero: the negatives cancel the positives. Squaring stops the cancellation, and the square root at the end brings the answer back to the original units.

What is the variance of 10, 20, 30, 40, 50?

200 for the population version and 250 for the sample version.

What is the square root of 200?

14.14, to two decimal places. That is the population standard deviation of 10, 20, 30, 40 and 50.

More guides on the Standard Deviation Calculator

Try it yourself

Find the mean, variance and standard deviation of any list of numbers — free, in your browser.

Open the Standard Deviation Calculator