Skip to content
Wagonsmith

How to Calculate Standard Deviation by Hand (With a Worked Example)

To calculate standard deviation by hand: find the mean, subtract it from every value, square those differences, add them up, divide by N (whole group) or n − 1 (a sample), and take the square root. For the eight exam scores below, that gives 10.63 as a population and 11.36 as a sample.

Calculators and spreadsheets give you a standard deviation in one keystroke, but doing it once on paper shows what the number means. It is not a complicated recipe. It is six small steps, and every one of them is just subtraction, squaring or division. This guide walks through all six with one set of exam scores, shows both the population and the sample version side by side, and explains how to decide which one your situation calls for. If you only want the answer, our standard deviation calculator does the same work instantly, and the steps below are how you check it.

What standard deviation tells you

The mean tells you where the middle of a data set is. The standard deviation tells you how far the values typically sit from that middle. OpenStax, a nonprofit education initiative of Rice University, describes it in its statistics text as a number you can use to decide whether a data value is close to or far from the mean. A class where everyone scores between 78 and 82 has a small standard deviation. A class where scores run from 40 to 100 has a large one, even if the two classes have the same mean.

NIST's e-Handbook of Statistical Methods defines it plainly: the standard deviation is the square root of the variance. It also notes that the standard deviation restores the units of the spread to the original data units, since the variance squares the units. In plain terms, if your data are test points, the standard deviation is also in points, which is why it is easier to interpret than the variance.

The six steps

  1. Find the mean. Add all the values and divide by how many there are.
  2. Find each deviation. Subtract the mean from every value. OpenStax calls the difference between a value and the mean its deviation. Some will be negative.
  3. Square each deviation. This removes the minus signs.
  4. Add the squared deviations. This total is often called the sum of squares.
  5. Divide. Divide the sum of squares by N for a population, or by n − 1 for a sample. The result is the variance.
  6. Take the square root. That is the standard deviation.

The two formulas, written out, are:

Population: σ = √( Σ(x − μ)² ÷ N ) Sample: s = √( Σ(x − x̄)² ÷ (n − 1) )

Here x̄ and μ are both the mean, N is the number of values in a population, and n is the number of values in a sample. OpenStax uses the Greek letter σ for the population standard deviation and the lowercase letter s for the sample standard deviation.

Worked example: eight exam scores

Suppose a student has these eight scores from one course: 72, 85, 90, 64, 79, 88, 95 and 67.

Step 1, the mean. The scores add up to 640. Divided by 8, the mean is 80.

Steps 2 and 3, the deviations and their squares. Lay the work out in a table, one row per score.

Score (x)Deviation (x − 80)Squared deviation
72−864
85525
9010100
64−16256
79−11
88864
9515225
67−13169
Total0904

The deviations always add to zero when you use the exact mean. That is a handy check: if your deviation column does not sum to zero, one of the subtractions is wrong. (If the mean is rounded, expect a tiny leftover.)

Step 4, the sum of squares. The squared deviations add up to 904.

Steps 5 and 6, divide and take the root. Now the two versions split.

Population (divide by N = 8)Sample (divide by n − 1 = 7)
Variance904 ÷ 8 = 113904 ÷ 7 = 129.14
Standard deviation√113 = 10.63√129.14 = 11.36

We checked these figures with a short script, and a spreadsheet's STDEV.P and STDEV.S functions or the calculator on this site should return the same 10.63 and 11.36. The sample figure is always a little larger than the population figure for the same numbers, because dividing by a smaller number gives a bigger result.

Population or sample: which one do you use?

OpenStax states the rule directly. If the numbers come from a census of the entire population, you divide by N, the number of items in the population. If the data are from a sample rather than a population, you divide by n − 1, one less than the number of items in the sample.

The OpenStax text explains why: the sample variance is an estimate of the population variance, and, based on the theoretical mathematics behind these calculations, dividing by n − 1 gives a better estimate of the population variance.

For ordinary school and work situations, the decision usually looks like this:

The eight scores in our example could go either way, which is why we showed both. If you are describing exactly those eight tests and nothing else, divide by 8. If you are using them to say something about how the student would do on other tests, divide by 7. When a problem or a course does not say, check what your instructor or textbook expects, because the two answers differ.

The difference shrinks as the data set grows. With 8 values, n − 1 changes the answer by about 7 percent here (11.36 against 10.63). With 100 values it is only about half a percent.

A second, smaller example

To see the steps in miniature, take five quiz scores: 4, 8, 6, 5 and 2. The mean is 25 ÷ 5 = 5. The deviations are −1, 3, 1, 0 and −3, and their squares are 1, 9, 1, 0 and 9, which add to 20. As a population, the variance is 20 ÷ 5 = 4 and the standard deviation is √4 = 2. As a sample, the variance is 20 ÷ 4 = 5 and the standard deviation is √5 = 2.24. We checked both with a script as well.

Common mistakes

Once you have the standard deviation, you can use it to see how unusual a score is. Dividing a score's distance from the mean by the standard deviation tells you how many standard deviations away it is, which is the z-score idea OpenStax introduces alongside standard deviation. If your next step is working out an overall course grade, see our weighted grade calculator, and the grade calculators page lists the rest.

These steps are for learning and checking your work. If a grade, a report or a decision depends on the figure, confirm the method your instructor, textbook or organization requires.

Frequently asked questions

What are the steps to calculate standard deviation by hand?

Find the mean, subtract the mean from every value, square each difference, add the squares, divide by N for a population or n minus 1 for a sample, then take the square root. The result is in the same units as your original data.

Should I divide by N or n minus 1?

Divide by N when your numbers are the entire group you care about, such as every score in one class. Divide by n minus 1 when your numbers are a sample drawn from a larger group. OpenStax explains that dividing by n minus 1 gives a better estimate of the population variance.

Why do you square the differences?

Differences above and below the mean cancel out if you add them directly, so their sum is always zero. Squaring makes every term positive. Taking the square root at the end brings the answer back to the original units, which is what NIST means when it says the standard deviation restores the units of the spread.

Can a standard deviation be negative?

No. It is a square root of a sum of squares, so it is zero or positive. It is zero only when every value is identical. If you get a negative number, you made an arithmetic slip.

What is the difference between variance and standard deviation?

Variance is the average of the squared differences, and standard deviation is its square root. NIST's handbook defines the standard deviation as the square root of the variance. Variance is in squared units, such as points squared, which is why people usually report the standard deviation.