SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call

How to calculate standard deviation

By Taimur Hassan SiddiquiPublished 7 October 2026

Standard deviation measures how spread out numbers are around their mean. This guide walks through the calculation step by step with a worked example, and explains when to divide by n and when by n − 1.

The short version

  1. Find the mean. Add the values and divide by how many there are.
  2. Find each value's deviation. Subtract the mean from every value.
  3. Square the deviations and add them. Squaring stops negatives cancelling positives.
  4. Divide. By n for a whole population, or by n − 1 for a sample.
  5. Take the square root. That gives the standard deviation, in the same units as your data.

Skip the arithmetic. The free Standard Deviation Calculator does this for you, shows the formula and the working with your own numbers, and runs in your browser - nothing you type is uploaded. Also useful: Mean, Median & Mode Calculator, Z-Score Calculator.

Open the Standard Deviation Calculator →

A worked example

Data: 2, 4, 4, 4, 5, 5, 7, 9 (eight values).

mean = (2+4+4+4+5+5+7+9) ÷ 8 = 40 ÷ 8 = 5 deviations: −3, −1, −1, −1, 0, 0, 2, 4 squares: 9, 1, 1, 1, 0, 0, 4, 16 sum = 32 population SD σ = √(32 ÷ 8) = √4 = 2 sample SD s = √(32 ÷ 7) = √4.571… = 2.138

Sample or population?

Use the population formula (divide by n) when your numbers are every member of the group you care about, such as all the students in one class. Use the sample formula (divide by n − 1) when your numbers are a sample meant to describe a bigger group. A sample's values sit slightly closer to their own mean than to the true mean, so dividing by n − 1 corrects the tendency to underestimate the spread. Most statistics courses default to the sample version unless told otherwise.

Variance and what the result means

Variance is the standard deviation squared: the average squared deviation before the square root. Standard deviation is easier to interpret because it is in the same units as the data. If test scores are roughly bell-shaped with mean 70 and standard deviation 10, about two-thirds of scores fall between 60 and 80, and about 95% between 50 and 90.

Mean, median and mode alongside it

Standard deviation describes spread; mean, median and mode describe the centre. Report them together. When a few extreme values pull the mean away from the median, the data is skewed and standard deviation will be large.

Common mistakes

  • Dividing by n when you should divide by n − 1 (or the reverse).
  • Forgetting the final square root and reporting the variance.
  • Squaring the sum of deviations instead of summing the squares. The deviations always add to 0.
  • Using the formula on a single value: a sample standard deviation needs at least two numbers.

Frequently asked questions

What is a good or bad standard deviation?
Neither - it depends on the units and what you are measuring. Compare it with the mean: a standard deviation of 10 is large for heights in centimetres but small for house prices in thousands.
Can 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 the same.
What is the difference between variance and standard deviation?
Variance is the mean squared deviation; standard deviation is its square root, which puts it back in the original units.
Why divide by n − 1?
It corrects for the fact that a sample's mean is estimated from the same data, which makes the raw spread slightly too small. The correction is named after Friedrich Bessel.
How many numbers do I need?
At least two for a sample standard deviation. With only one value the sample formula would divide by zero.