Gauth

Statistics

Standard Deviation by Hand

Six steps, one table, and one decision that changes the answer: whether your data is a sample or the whole population.

By the Gauth editorial teamHow this content is produced and checkedUpdated 10 September 2026

The idea

Two classes both average 70 on a test. In the first, every mark is between 68 and 72. In the second, half the class scored 40 and half scored 100. The mean is identical and tells you nothing useful about either. Standard deviation is the number that separates them.

The natural instinct is to average how far each value sits from the mean. That fails immediately, because the positive and negative distances cancel exactly — the deviations from the mean always sum to zero, for every data set that has ever existed. So you have to remove the signs before averaging.

Squaring is how it is done. Square each deviation, average the squares, and you get the variance: a genuine measure of spread that never cancels itself out, and one that punishes a single far-off value much more than several mildly off ones. Its drawback is the units. Square marks, square centimetres, square pounds — these are not quantities anybody can interpret. Taking the square root at the end fixes that, and the result is the standard deviation, back in the units you started with:

Those two formulas are the same calculation with one difference: the denominator. The left is the population standard deviation, the right the sample standard deviation, and choosing between them is the only real decision this topic asks of you.

Averaging absolute deviations instead would also work, and that statistic exists — the mean absolute deviation. Squaring won because variances of independent quantities add and absolute deviations do not, and because the squared version is smooth enough to do calculus on.

When you need it

Comparing consistency, not just level. Two machines fill bottles to a mean of 500 ml. The one with a standard deviation of 2 ml is fit for sale; the one with 40 ml is a recall. Any time a question asks which of two data sets is more reliable, more consistent, or more spread out, it is asking for a standard deviation.

Turning a raw value into a position. A mark of 84 means nothing until you know the mean and the spread. The z-score says how many standard deviations above or below average a value sits, which is what makes marks from different tests comparable at all.

Describing a distribution. For roughly bell-shaped data, about 68% of values lie within one standard deviation of the mean and about 95% within two. That is a fast sanity check: if your computed standard deviation implies that 95% of the data sits in a range that clearly excludes half your values, you have made an arithmetic error.

Everything downstream. Confidence intervals, hypothesis tests, error bars, and control charts all take a standard deviation as their input, so getting the divisor wrong here propagates into every one of them. That is why the sample-versus-population distinction gets more attention than it might seem to deserve.

The method

1. Read the question and decide: sample or population? This comes first because it determines the arithmetic. Phrases like “all 30 students in the class” or “every component produced on Tuesday” describe a population, when the class or that Tuesday is genuinely all you care about. Phrases like “a sample of 12 batteries” or “20 randomly chosen households” describe a sample, because the point is to say something about batteries or households in general. Deciding correctly is a reading skill as much as a statistical one, and it uses the same care as any word problem translation.

2. Find the mean, and keep it exact. Add the values, divide by how many there are. If the mean comes out as 7.3333, carry the fraction 22/3 rather than a rounded decimal — every deviation inherits that rounding error, and squaring amplifies it.

3. Subtract the mean from every value, and check the total is zero. This is a free, complete check on both the mean and the subtraction. If your deviations do not sum to zero, stop: something is wrong, and finding it now costs less than finding it later.

4. Square each deviation and add them up. Every entry in this column is positive. A negative squared deviation means you copied a deviation instead of squaring it. The total is written in many textbooks.

5. Divide by n or by n − 1. This gives the variance. For a sample, the divisor is one less than the count, not one less than the sum of anything.

6. Take the square root. Then check the answer against the data: the standard deviation should be comfortably smaller than the range and roughly the size of a typical gap between a value and the middle. A standard deviation larger than the range is impossible.

Why n − 1, specifically

The deviations in a sample are measured from , the sample mean, not from the unknown population mean . And is not a neutral reference point — it is calculated from the very data you are measuring against it, so it sits in the middle of your particular sample rather than in the middle of the population. That makes the smallest it could possibly be for this data, and therefore systematically smaller than would have been. Dividing by would inherit that downward bias. Dividing by scales it up by exactly the right factor, so that on average lands on .

The other way to see it is degrees of freedom. Once you know and any of the deviations, the final deviation is forced, because they must sum to zero. There are only independent pieces of information about spread in the sample, so you average over , not .

One honest caveat. The correction makes an unbiased estimator of , but it does not make an unbiased estimator of , because taking a square root is not a linear operation and pulls the average down slightly. The residual bias is small, shrinks quickly with sample size, and is ignored by every standard course and software package. Use and move on.

The full deviation table, step by step

0 of 6 steps
    Try it yourself first — you'll remember it longer.

    Worked examples

    Worked example

    1. 1

      These eight values are the complete set being described, so this is a population and the divisor is N = 8.

    2. 2

      Subtract the mean from each value and confirm the deviations cancel.

    3. 3

      Square each deviation and add. The value of 9 alone contributes half the total.

    4. 4

      Divide by N for the population variance, then take the square root.

    5. 5

      Worth noting the contrast: if these eight values had been a sample, the divisor would be 7, giving a variance of 32/7 ≈ 4.571 and a standard deviation of about 2.14.

    Answer

    Worked example

    1. 1

      The word sample decides the divisor before any arithmetic happens: n − 1 = 4.

    2. 2

      The deviations are evenly spaced because the data is, which makes the check easy.

    3. 3

      Square and total.

    4. 4

      Divide by 4 and take the root. This is the answer being asked for.

    5. 5

      Had you divided by 5 you would have reported 4.24 minutes instead — about a tenth smaller. On a sample this small the choice of divisor is not a rounding detail, it is the difference between a right and a wrong answer.

    Answer

    Worked example

    1. 1

      The computational formula avoids building a deviation column, which helps when the mean is not a whole number. Collect the two totals it needs.

    2. 2

      Apply the identity. Note carefully which quantity is squared: the sum of the values is squared in the second term, while the first term is the sum of the squared values.

    3. 3

      Evaluate. 625 divided by 5 is 125.

    4. 4

      Confirm against the long method. The mean is 5, the deviations are 2, −2, 3, 0 and −3, and their squares total 4 + 4 + 9 + 0 + 9 = 26. The two routes agree, as they must.

    5. 5

      Divide by n − 1 = 4 and take the square root.

    Answer

    Try one of your own

    Paste a list of values and you will get the full deviation table rather than a bare number, with both the sample and population versions shown so you can see which the question wants. The standard deviation calculator lays out every squared deviation, and the statistics solver continues into z-scores, confidence intervals, and hypothesis tests from the same data.

    Solve a statistics problem now

    First solution free

    Where people go wrong

    Using n on data that is obviously a sample

    The single most costly error in the topic, and the one that grows as the data set shrinks. With the two divisors differ by 25%, which moves the standard deviation by more than a tenth. With the difference is negligible. The habit that saves you is deciding sample or population before touching the arithmetic, from the wording of the question rather than from the size of the list.

    Reporting the variance and calling it the standard deviation

    Stopping at 47.5 instead of 6.89. The units catch this every time: variance for a set of exam marks is in marks squared, which is not a thing anyone can picture. If the question asks for spread in the original units, or gives a context at all, the square root is part of the answer.

    Squaring the sum instead of summing the squares

    In the computational formula, and are different quantities and the notation makes them look almost identical. For the data the first is 151 and the second is 625. Reading the brackets correctly is an order of operations problem, and it is worth slowing down for, because the resulting answer is wrong by a large factor rather than a small one.

    Rounding the mean before building the table

    If the mean is 7.3333 and you write 7.3, every one of your deviations is off by 0.0333 before you have started, and squaring spreads that error through all of them in the same direction so it never cancels. Keep the mean as an exact fraction until the final square root, and round once, at the end. This is the same discipline as the other verification habits in how to check your own work.

    Practice

    The first two use the same four numbers, which is the point: only the divisor changes.

    Standard deviation practice

    Answers are checked here — nothing is sent anywhere.

    1. 1
    2. 2
    3. 3
    4. 4

    Frequently asked questions

    Do I divide by n or by n minus 1?
    Divide by n only when your data set is the entire population you want to describe — every member of it, with no wider group in mind. Divide by n−1 whenever the data is a sample and you want to say something about the larger population it came from. Almost all real statistical work is the second case, which is why n−1 is the default on calculators labelled sx and in spreadsheet functions named STDEV.S.
    Why does n minus 1 fix anything?
    Because the deviations are measured from the sample mean rather than the true population mean, and the sample mean always sits in the middle of your particular sample. That makes the sum of squared deviations systematically too small. Dividing by n−1 rather than n scales it up by exactly the right amount, so the sample variance becomes an unbiased estimator of the population variance.
    Is the sample standard deviation also unbiased?
    Not quite, and this is worth knowing. The correction makes s² an unbiased estimate of σ², but taking a square root is a concave operation, so s slightly underestimates σ on average. The bias is small and shrinks as n grows, and essentially every course and software package ignores it. Use n−1 and do not worry about the residual.
    What does a standard deviation of 6.89 actually tell me?
    That a typical value sits about 6.89 units away from the mean, in the same units as the original data. If the data is roughly bell-shaped, about 68% of values lie within one standard deviation of the mean and about 95% within two — 1.96, to be exact. On a set of exam marks with mean 76 and s = 6.89, that puts most of the class between 69 and 83.
    Can standard deviation be negative or zero?
    Never negative — it is a square root of a sum of squares, so it is zero or positive. It is exactly zero when every value in the data set is identical, because then every deviation is zero. A negative answer means an arithmetic error, most often a squared deviation that was written down with its sign still attached.

    Keep going

    Gauth AIAsk me for any help!