Davided.

Standard Deviation Calculator

Calculate the standard deviation, variance, and mean of your data set for a sample or a population, with a clear step-by-step breakdown.

✓ Last reviewed: Sources: NIST/SEMATECH e-Handbook of Statistical Methods — 1.3.5.6 Measures of Scale

Report a correction

Spotted a wrong result, label or typo? Tell us — we review every report.

Values recognized: 0

Enter your numbers separated by spaces, commas, semicolons, or new lines — e.g. 2, 4, 4, 4, 5, 5, 7, 9

Use "sample" when your data is a subset of a larger group you're drawing conclusions about (divides by n−1, Bessel's correction). Use "population" when your data is the entire group of interest (divides by n). Both results are always shown below.

Advanced options

Your result

Fill in the fields above to see your result.

Related calculators

What the standard deviation calculator does

The standard deviation calculator turns a list of numbers into a set of figures that describe how spread out your data is. Paste in any set of values — test scores, measurements, prices, returns, anything numeric — choose whether they’re a sample or a population, and the calculator returns the count, sum, mean, variance and standard deviation, plus the standard error of the mean.

You don’t have to pick one interpretation and lose the other: both the sample standard deviation (s) and the population standard deviation (σ) are always shown, side by side, however you set the switch. The switch only decides which one becomes the highlighted, headline figure — useful, because mixing the two up is the single most common mistake people make with this statistic.

Turn on “show calculation steps” and you get a row-by-row table of every value, its deviation from the mean, and that deviation squared — the same arithmetic the calculator does internally, laid out so you can check it or use it as a worked example.

How to use the calculator

  1. Enter your data. Type or paste your numbers into the values field, separated by spaces, commas, semicolons, or new lines — for example 2, 4, 4, 4, 5, 5, 7, 9. Blank entries are ignored automatically.
  2. Choose sample or population. Pick “sample” if your numbers are a subset of a bigger group you’re trying to draw conclusions about (a survey, a test batch, a handful of measurements). Pick “population” if your numbers are the entire group you care about (every student in one class, every unit produced this week).
  3. Read the result. The headline standard deviation follows whichever mode you picked, and both the sample and population figures are shown underneath it, along with variance, mean, sum, count, and the standard error of the mean.
  4. Optional: show the calculation steps. Open “show calculation steps” to see each value’s deviation from the mean and its square, plus the totals — handy for checking the arithmetic or following along by hand.

How standard deviation is calculated: sample vs. population

Every calculation starts the same way, whichever mode you pick:

  1. Count the values (n) and add them up (sum).
  2. Divide the sum by n to get the mean.
  3. For each value, subtract the mean to get its deviation, then square that deviation.
  4. Add up all the squared deviations to get the sum of squares.

From there, the two modes divide by a different number:

Population standard deviation (σ) — use this when your data is the complete group you’re interested in:

σ² = (sum of squares) ÷ n, and σ = √σ²

Sample standard deviation (s) — use this when your data is a sample drawn from a larger population you’re estimating:

s² = (sum of squares) ÷ (n − 1), and s = √s²

That n − 1 is Bessel’s correction. A sample’s own mean is, by construction, the value that minimises the spread within that specific sample — so measuring deviations from it and dividing by n would systematically understate the true population variance. Dividing by n − 1 instead corrects that bias. It’s why the sample standard deviation is always a little larger than the population standard deviation for the same data — and why you need at least 2 values for it to be defined at all (with n = 1, n − 1 = 0, and dividing by zero has no answer).

Step-by-step example

Take the classic data set 2, 4, 4, 4, 5, 5, 7, 9 (n = 8):

  1. Sum = 2+4+4+4+5+5+7+9 = 40. Mean = 40 ÷ 8 = 5.
  2. Deviations from the mean: −3, −1, −1, −1, 0, 0, 2, 4.
  3. Squared deviations: 9, 1, 1, 1, 0, 0, 4, 16.
  4. Sum of squares = 32.
  5. Population variance = 32 ÷ 8 = 4; population standard deviation = √4 = 2.
  6. Sample variance = 32 ÷ 7 ≈ 4.5714; sample standard deviation = √4.5714 ≈ 2.1381.
  7. Standard error of the mean = 2.1381 ÷ √8 ≈ 0.7559.

So for the same eight numbers, the population standard deviation is exactly 2, the sample standard deviation is about 2.1381, and both appear on the calculator at once — labelled so you always know which is which.

A quick note on why the calculator computes the mean first and the deviations second, rather than a one-step “sum of squares” shortcut some textbooks show: with values that are all close to a huge common number (say, everything near 1,000,000,010), the shortcut formula subtracts two enormous, nearly identical numbers and can lose so much precision that it produces a negative variance — which is mathematically impossible. Computing the mean first and then squaring the deviations from it avoids that trap entirely and always gives a correct, non-negative result.

Reading the result: variance, mean, and standard error (SEM)

Variance is standard deviation squared — the same measure of spread, in squared units. It’s mathematically central (it’s what the two-pass calculation actually produces before the square root), but it’s harder to interpret directly because its units don’t match your data: if your values are in kilograms, variance is in kilograms squared. Standard deviation, being back in the original units, is the one most people read and compare.

Mean and sum are just your data’s average and total — context for the spread figures, not a measure of spread themselves.

Standard error of the mean (SEM) is a different question altogether: not “how spread out is my data?” but “how precisely does my sample’s mean estimate the true mean of the whole population?” It’s calculated as the sample standard deviation divided by the square root of n. For the example above, SEM = 2.1381 ÷ √8 ≈ 0.7559 — noticeably smaller than the standard deviation itself, and that gap grows with larger samples. That’s exactly why SEM shouldn’t be swapped in for standard deviation when describing how varied your data is: doing so makes the data look artificially tighter than it really is. Use standard deviation to describe your data’s spread, and SEM only when you’re talking about the precision of an estimated mean.

Frequently asked questions

What’s the difference between sample and population standard deviation, and when do I use n vs. n−1?

Population standard deviation divides by n and describes a complete data set — use it when your numbers are the entire group you care about. Sample standard deviation divides by n−1 (Bessel’s correction) and estimates the spread of a larger population from a subset — use it when your numbers are a sample. The correction exists because a sample’s own mean slightly understates the true population spread, so dividing by a smaller number compensates. This calculator shows both values at once so you never have to guess which one applies.

What’s the difference between standard deviation and standard error of the mean (SEM)?

Standard deviation measures how spread out your data points are. SEM measures how precisely your sample’s mean estimates the true population mean, and it’s calculated as SD ÷ √n — so it’s always smaller than the standard deviation, and shrinks further as your sample grows. They answer different questions: report standard deviation when describing your data’s variability, and SEM (or a confidence interval) when reporting the precision of an average. Using SEM to describe data spread makes results look more consistent than they actually are, which is a common and misleading mix-up in reports and papers.

What’s the difference between standard deviation and variance?

Variance is the average of the squared deviations from the mean; standard deviation is its square root. They carry the same information about spread, but variance is in squared units (harder to relate back to your original data), while standard deviation is in the same units as your data, which is why it’s the figure most people read and quote. The calculator computes variance as an intermediate step and shows both.

How do I interpret a high or low standard deviation?

A low standard deviation means your values cluster tightly around the mean; a high one means they’re spread out more widely. There’s no universal cut-off for “high” or “low” — it depends entirely on your data’s units and typical scale, so a standard deviation of 5 is huge for shoe sizes and negligible for annual salaries. The useful comparison is relative: against the mean, against a previous measurement of the same thing, or against another data set measured the same way.

Can standard deviation be negative or zero?

It can never be negative — it’s a square root of an average of squared numbers, and both of those stay at zero or above. It can absolutely be zero, though: that happens when every value in your data set is identical, meaning there’s no spread at all. A standard deviation of 0 is a correct, meaningful result, not an error.

What units does standard deviation have?

The same units as your original data. If you’re measuring standard deviation of weights in kilograms, the result is in kilograms; for temperatures in Celsius, it’s in Celsius. That’s one reason standard deviation is easier to interpret than variance, which comes out in squared units (kilograms squared, degrees squared) that don’t map onto anything physical.

How many data points do I need for a reliable standard deviation?

Sample standard deviation is mathematically defined from n = 2 upward, but a result from just 2 or 3 points is extremely sensitive to any single value and rarely reliable. As a rough guide, more than about 10 data points starts giving a meaningfully stable estimate, and the reliability keeps improving as n grows — there’s no hard cutoff, just a steady reduction in how much any one outlier can distort the result.

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

Both use the same two functions: STDEV.S() for the sample standard deviation (divides by n−1) and STDEV.P() for the population standard deviation (divides by n) — matching the two modes on this calculator exactly. Watch out if you also use Python: NumPy’s numpy.std() defaults to the population formula (ddof=0), while pandas’ .std() defaults to the sample formula (ddof=1) — the same data can silently give you two different numbers depending on which library computed it, which is a very common source of “why doesn’t this match Excel” confusion.

Sources