Math

How to Calculate Standard Deviation Step by Step

To calculate standard deviation, find the mean, square each value's distance from it, average those squares and take the square root. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5, the variance is 4 and the population standard deviation is 2.

By CalculatorHub Editorial TeamPublished December 2, 2026Updated December 2, 20266 min read
Run the numbers yourself. Try our free Standard Deviation Calculator and see the result with your own figures.

The five steps

  1. Find the mean: add the numbers and divide by how many there are. Here 40 ÷ 8 = 5.
  2. Subtract the mean from each number.
  3. Square each difference: 9, 1, 1, 1, 0, 0, 4, 16.
  4. Add the squares (32) and divide by n for a population (32 ÷ 8 = 4) or by n − 1 for a sample (32 ÷ 7 = 4.571).
  5. Take the square root: population 2, sample 2.138.

Sample or population?

Use n when the numbers are the whole group. Use n − 1 when they are a sample from a bigger group. Dividing by n − 1 corrects the tendency of a sample to understate the true spread.

How to read the result

A small value means the numbers sit close to the mean. In a bell-shaped distribution, about 68% of values are within one standard deviation of the mean and 95% within two.

Paste any list into the standard deviation calculator to see the working, and use the mean, median and mode calculator for the centre of the data.

Same mean, different spread

Two sets of exam marks can have the same average but very different results. Set A is 72, 75, 78, 80, 85. Set B is 50, 65, 80, 95, 110. Both have a mean of 78.0 and 80.0, but the standard deviation of A is 4.4 while for B it is 21.2. The mean alone hides how scattered B is.

SetMeanPopulation SDSample SD
A: 72, 75, 78, 80, 8578.04.434.95
B: 50, 65, 80, 95, 11080.021.2123.72

The 68-95-99.7 rule

If data follows a bell curve, about 68% falls within one standard deviation of the mean, 95% within two and 99.7% within three. With a mean of 100 and a standard deviation of 15, about 95% of values lie between 70 and 130.

Excel and calculator functions

  • =STDEV.S(range) for a sample, =STDEV.P(range) for a population.
  • =VAR.S and =VAR.P for variance.
  • Check the same list in the standard deviation calculator.

Warning signs

A few extreme values can inflate the standard deviation. If your data has outliers, look at the median and the interquartile range too.

Key terms

  • Mean: The arithmetic average.
  • Variance: The average of the squared deviations.
  • Population: The whole group being studied.
  • Sample: A part of the group used to estimate the whole.
  • Outlier: A value far from the others.

Practice questions

Try each one before you read the answer.

  1. Find the standard deviation of 4, 8, 6, 5, 7 (population).
    Answer: Mean 6, squared deviations 4, 4, 0, 1, 1 = 10, variance 2, so σ = 1.41.
  2. What is the sample standard deviation of the same numbers?
    Answer: 10 ÷ 4 = 2.5, so s = 1.58.

Frequently asked questions

What is the formula for standard deviation?

Population: σ = √(Σ(x − mean)² ÷ n). Sample: s = √(Σ(x − mean)² ÷ (n − 1)).

What is the difference between variance and standard deviation?

Variance is the average squared deviation. Standard deviation is its square root, so it is in the same units as your data.

Can standard deviation be zero?

Yes, when all values are identical. It is never negative.

What is the coefficient of variation?

It is the standard deviation divided by the mean, shown as a percentage. It lets you compare spread between data sets with different units or sizes.

Why is the sample standard deviation larger?

Because it divides by n − 1 instead of n, which corrects for the fact that a sample tends to understate the spread.

Try the calculators

Keep reading