Standard deviation calculator

Paste or type your numbers to get the standard deviation, variance, mean, median and mode, with every step of the working.

Your answer and every step will appear here as you type.

Separate values with commas, spaces or new lines, or paste a column from a spreadsheet. Don't use commas inside numbers: write 1250, not 1,250.

Your numbers are

Report a problem with this calculator

Each value's distance from the mean

For the numbers in the calculator: each value, how far it is from the mean of 81.875, and that distance squared. The squared distances add up to Σ(x − x̄)².

Value xx − mean(x − mean)²
72-9.87597.515625
853.1259.765625
908.12566.015625
66-15.875252.015625
78-3.87515.015625
9513.125172.265625
886.12537.515625
81-0.8750.765625

How to calculate standard deviation

The standard deviation measures how far the values typically sit from their average. There are two versions, which differ only in the last division:

sample: s = √( Σ(x − x̄)² ÷ (n − 1) )population: σ = √( Σ(x − μ)² ÷ n )
  1. Add up the values and divide by how many there are (n) to get the mean.
  2. Subtract the mean from each value, and square each result so negatives don't cancel positives.
  3. Add up the squared distances. This is the sum of squares, Σ(x − x̄)².
  4. Divide by n − 1 for a sample, or by n for a whole population. That is the variance.
  5. Take the square root of the variance. That is the standard deviation.

Worked example

Take the eight values 2, 4, 4, 4, 5, 5, 7, 9.

  1. Mean: 40 ÷ 8 = 5.
  2. Distances from the mean: -3, -1, -1, -1, 0, 0, 2, 4. Squared: 9, 1, 1, 1, 0, 0, 4, 16.
  3. Sum of squares: 32.
  4. As a whole population: variance 32 ÷ 8 = 4, so the standard deviation is √4 = 2.
  5. As a sample: variance 32 ÷ 7 = 4.5714, so the standard deviation is √4.5714 = 2.1381.

The median is the average of the two middle values, (4 + 5) ÷ 2 = 4.5, and the mode is 4, which appears 3 times.

Sample or population?

Ask whether your numbers are everything you want to describe, or a part of something bigger.

  • Population (divide by n): the heights of all 24 players on a team, the monthly bills you paid last year, every score in one class when you only care about that class.
  • Sample (divide by n − 1): 30 bags of flour weighed to check a whole production run, a survey of 200 voters, a lab experiment repeated five times.

Dividing a sample by n − 1 gives a slightly larger answer, which corrects for the fact that a sample's values sit closer to their own mean than to the true mean of the whole group. With a few values the difference is noticeable; with thousands it all but disappears. The calculator shows both, so you can quote whichever your course or report asks for.

What the standard deviation tells you

A small standard deviation means the values cluster tightly around the mean; a large one means they are spread out. Two classes can both average 80 on a test, but if one has a standard deviation of 3 and the other of 15, the second has many more very high and very low scores.

When data follow the bell-shaped normal distribution, about 68% of values fall within one standard deviation of the mean, about 95% within two, and about 99.7% within three. Real data often aren't exactly normal, so treat these as a guide, not a rule.

The standard error of the mean, also shown in the working, is the sample standard deviation divided by √n. It describes how precisely the sample's mean estimates the mean of the whole group, and it shrinks as the sample grows.

Mean, median and mode

The mean is the ordinary average. The median is the middle value once the numbers are sorted (the average of the two middle values when there is an even count), so a few extreme values move it much less than they move the mean. The mode is the value that appears most often. A list can have several modes, or none when every value appears once.

Questions people ask

Should I use the sample or the population standard deviation?

Use the population version when your numbers are the whole group you care about, such as the test scores of every student in one class. Use the sample version when your numbers are a selection taken to learn about a bigger group, such as 50 customers surveyed out of thousands. In school statistics and research the sample version is the usual one, and it is the default here.

Why does the sample standard deviation divide by n − 1?

A sample’s values sit closer to their own mean than to the true mean of the whole group, so dividing by n would make the spread look slightly too small. Dividing by n − 1 instead (Bessel’s correction) makes the sample variance an unbiased estimate of the population variance. The difference shrinks as the sample grows: with 8 values it is about 7%, with 1,000 values about 0.05%.

What is the difference between variance and standard deviation?

The variance is the average squared distance from the mean, so its units are squared (dollars², points²). The standard deviation is the square root of the variance, which brings it back to the same units as your data. That is why the standard deviation is the one people quote: “scores averaged 82 with a standard deviation of 9 points.”

Can a standard deviation be negative or zero?

It can never be negative, because it is the square root of an average of squared numbers. It is zero only when every value is the same. A larger standard deviation means the values are more spread out around the mean.

How do I calculate standard deviation in Excel or Google Sheets?

Use =STDEV.S(A1:A20) for the sample standard deviation and =STDEV.P(A1:A20) for the population version (=STDEV and =STDEVP in older versions). VAR.S and VAR.P give the variances. You can also paste a column from a spreadsheet straight into the box above to check the working step by step.

Last checked November 13, 2026. See how we calculate and test our results.