How to calculate standard deviation by hand

By Jude Wallis · Published

To calculate standard deviation by hand, find the mean, subtract it from each value to get deviations, square those, add them, divide by n-1 for a sample or n for a population, then take the square root. That square root is the standard deviation.

AP Statistics: Unit 1 (topics 1.7 Summary Statistics for One Quantitative Variable). Standard deviation is Unit 1 topic 1.7; the Fall 2026 CED gives the sample standard deviation formula with n-1 and defines the sample variance as s squared.

What standard deviation tells you

Standard deviation is a single number that summarizes how spread out a data set is. A small standard deviation means most values cluster tightly around the mean. A large one means the values are scattered widely.

Two data sets can share the same mean and still look completely different. Scores of 70, 70, and 70 average to 70 with zero spread, while scores of 40, 70, and 100 also average 70 but vary a lot, so the second set has the larger standard deviation. That spread is what standard deviation captures, which is why it is usually reported alongside the mean rather than the median.

Standard deviation belongs to a family of spread measures that also includes the range and the interquartile range. For roughly bell-shaped data, the empirical rule says about 68% of values fall within one standard deviation of the mean, which gives the number a concrete meaning.

The five steps to calculate standard deviation by hand

The AP course describes standard deviation as a typical deviation of the data values from their mean. Here is the five-step recipe you can run on any small data set, step by step.

  1. Find the mean. Add up all the values and divide by how many there are. The sample mean is written xˉ\bar{x} (say "x-bar"), and nn is the number of values.
  2. Find each deviation. Subtract the mean from every value, xixˉx_i - \bar{x}. Some deviations come out negative and some positive.
  3. Square each deviation. Squaring removes the negative signs and gives (xixˉ)2(x_i - \bar{x})^2.
  4. Add the squares and divide. For a sample, divide the sum by n1n-1. For a full population, divide by nn. This result is the variance.
  5. Take the square root. The square root of the variance is the standard deviation.

The square root in the last step puts the answer back in the original units, so a standard deviation of quiz points is measured in points, not points squared.

Sample vs population standard deviation

The steps are identical until step 4. The choice of n1n-1 or nn depends on whether the data is a sample or a whole population.

A population includes every member you care about, so its mean is the true mean, written μ\mu ("mu"). The population standard deviation is written σ\sigma ("sigma") and divides by nn:

σ=(xiμ)2n\sigma = \sqrt{\frac{\sum (x_i - \mu)^2}{n}}

A sample is a subset drawn from a larger population. Its standard deviation is written ss, called the sample standard deviation, and it divides by n1n-1. This is the version on the AP formula sheet:

s=(xixˉ)2n1s = \sqrt{\frac{\sum (x_i - \bar{x})^2}{n-1}}

Most real data sets are samples, so ss is the default you will use on the AP exam and the one a calculator reports first. Because n1n-1 is smaller than nn, the sample standard deviation ss comes out slightly larger than the population value σ\sigma for the same numbers.

The variance formula

Variance is the value you get in step 4, before taking the square root. In other words, standard deviation is the square root of variance, and variance is standard deviation squared.

For a sample, the variance formula is:

s2=(xixˉ)2n1s^2 = \frac{\sum (x_i - \bar{x})^2}{n-1}

The AP course states this directly: the square of the sample standard deviation, s2s^2, is the sample variance. Variance is reported in squared units (points squared, dollars squared), which is hard to interpret on its own, so taking the square root returns the spread to the original units. That is why standard deviation is reported more often than variance, even though the two carry the same information.

Why you divide by n minus 1

When you work with a sample, you do not know the true mean μ\mu, so you use the sample mean xˉ\bar{x} in its place. The catch is that xˉ\bar{x} is calculated from the same values whose spread you are measuring, so those values sit a little closer to xˉ\bar{x} than they would to the true mean. The squared deviations come out slightly too small.

Dividing by n1n-1 instead of nn makes the result a little larger, which corrects that downward bias. One common way to describe it: estimating the mean uses up one degree of freedom, so only n1n-1 independent pieces of information about the spread remain.

With a full population you already know μ\mu, so there is no bias to correct, and you divide by nn.

Common mistakes to avoid

A few errors show up again and again when people calculate standard deviation by hand.

  • Forgetting to square the deviations. The raw deviations always add to zero, so you must square them before adding, or the sum is useless.
  • Dividing by the wrong number. Use n1n-1 for a sample and nn for a population. Mixing them up is the most common slip.
  • Stopping at the variance. The variance is only step 4. You still have to take the square root to reach the standard deviation.
  • Rounding too early. Keep extra decimals through the middle steps and round only the final answer, or small rounding errors pile up.

Check your work with a calculator

Working through the steps by hand once or twice builds intuition, but on the AP exam a graphing calculator with statistical capabilities is expected, and the sample standard deviation formula is printed on the provided formula sheet. Calculators usually list the sample value as ss or SxSx and the population value as σ\sigma or σx\sigma x, so read the label carefully.

To check a calculation, enter the same data set in the standard deviation calculator and confirm your ss and σ\sigma match. To watch the spread change as you drag points around, try the descriptive statistics sandbox.

Standard deviation is not the same as standard error, which measures how much a sample mean varies from sample to sample. The guide on the difference between standard error and standard deviation explains when to use each.

Standard deviation of five quiz scores, sample and population

Five students score 2, 4, 4, 6, and 9 on a quiz. Calculate both the sample standard deviation and the population standard deviation by hand.

  1. Find the mean. xˉ=2+4+4+6+95=255=5\bar{x} = \frac{2 + 4 + 4 + 6 + 9}{5} = \frac{25}{5} = 5.

  2. Find each deviation from the mean, xixˉx_i - \bar{x}: 25=32-5 = -3, 45=14-5 = -1, 45=14-5 = -1, 65=16-5 = 1, and 95=49-5 = 4. As a check, they add to 311+1+4=0-3 - 1 - 1 + 1 + 4 = 0.

  3. Square each deviation: (3)2=9(-3)^2 = 9, (1)2=1(-1)^2 = 1, (1)2=1(-1)^2 = 1, (1)2=1(1)^2 = 1, and (4)2=16(4)^2 = 16.

  4. Add the squared deviations: 9+1+1+1+16=289 + 1 + 1 + 1 + 16 = 28.

  5. Divide for the sample using n1=4n-1 = 4: sample variance s2=284=7s^2 = \frac{28}{4} = 7. Divide for the population using n=5n = 5: population variance σ2=285=5.6\sigma^2 = \frac{28}{5} = 5.6.

  6. Take the square root of each variance: sample s=72.6458s = \sqrt{7} \approx 2.6458 and population σ=5.62.3664\sigma = \sqrt{5.6} \approx 2.3664.

The sample standard deviation is s=72.65s = \sqrt{7} \approx 2.65 and the population standard deviation is σ=5.62.37\sigma = \sqrt{5.6} \approx 2.37. The sample value is larger because it divides by n1=4n-1 = 4 instead of n=5n = 5.

Frequently asked questions

Should I divide by n or n-1?

Divide by n1n-1 when your data is a sample and by nn when you have the entire population. Most data sets are samples, so n1n-1 is the usual choice, and it is the version on the AP formula sheet and the default a calculator reports as ss or SxSx.

What is the difference between standard deviation and variance?

Variance is the sum of squared deviations from the mean divided by n1n-1 for a sample or by nn for a population, and standard deviation is its square root. Variance is in squared units, while standard deviation is in the original units, which makes it easier to interpret. For a population, variance equals the average squared deviation; for a sample, the AP course writes it as s2s^2.

Why is my sample standard deviation bigger than the population one?

For the same data, the sample formula divides by n1n-1 while the population formula divides by nn. Dividing by a smaller number produces a larger result, so ss is at least as large as σ\sigma, and strictly larger whenever the values vary. In the worked example, s2.65s \approx 2.65 and σ2.37\sigma \approx 2.37.

Do I have to calculate standard deviation by hand on the AP exam?

Usually no. A graphing calculator with statistical capabilities is expected for both sections, and the sample standard deviation formula is provided on the formula sheet. Knowing the steps still helps you interpret what the number means and check that your calculator output is reasonable.