Standard Deviation Calculator

Free standard deviation calculator. Paste numbers for the mean, variance, and both population (n) and sample (n-1) standard deviation, with worked steps.

Advertisement

Standard deviation calculator with the full working shown

Paste your numbers into the box — separated by commas, spaces or new lines, whichever way you happen to have them — and the results appear instantly. You get the count, the sum, the mean, the sum of squared deviations, both variances, and both standard deviations: population and sample, side by side, always. Below that is a step-by-step breakdown with a row for every value in your data set showing its deviation from the mean and that deviation squared, so you can check your own working against the calculator's line by line.

That last part is the point. Most standard deviation calculators hand you a single number and leave you to trust it. If you are checking homework, marking a lab report, or trying to work out why your answer differs from the textbook's, one number tells you nothing about where you went wrong. Seeing the mean, then each deviation, then each square, then the sum, then the two divisions, lets you find the exact step where your arithmetic and the calculator's parted ways.

Everything is computed in your browser. The numbers you paste — grades, salaries, patient measurements, test results — are never uploaded anywhere.

Population or sample: the decision that changes your answer

This is the one thing to get right, and it is where most wrong answers come from. There are two standard deviation formulas. They are identical except for the very last division:

  • Population standard deviation (σ) divides the sum of squared deviations by n — the number of values.
  • Sample standard deviation (s) divides by n − 1.

Which one is correct has nothing to do with how many numbers you have and everything to do with what those numbers are.

Use the population formula when your numbers are the entire group you care about. Every student in one class, when the class is the thing you are describing. Every transaction last month, when last month is the question. Every one of the twelve machines on the factory floor. There is nothing outside your data set that you are trying to say anything about, so there is nothing to estimate — you can simply describe what you have.

Use the sample formula when your numbers are a subset drawn from a larger group, and you want to say something about that larger group. Forty customers surveyed out of thousands. Thirty widgets tested from a production run of ten thousand. A hundred people polled to describe a city. The data is a window onto something bigger, and you are estimating.

Why n − 1 exists

It is not an arbitrary fudge. When you compute deviations from the sample mean rather than the true population mean, the deviations come out systematically too small — the sample mean is, by construction, the point that minimises the sum of squared deviations for that particular sample. Dividing by n would therefore underestimate the population's spread every time, not occasionally. Dividing by n − 1 corrects that bias. This is Bessel's correction, and the intuition behind it is degrees of freedom: once you know the mean and n − 1 of the values, the last value is determined, so only n − 1 of the deviations are free to vary.

The correction matters most when n is small. With four values you are dividing by 3 instead of 4 — a substantial difference. With four hundred you are dividing by 399 instead of 400, and the two answers are nearly identical. That is why the mistake often goes unnoticed in large data sets and produces visibly wrong homework answers in small ones.

When you genuinely cannot tell which applies, the sample formula is the safer default. Most real-world statistics, and nearly every spreadsheet formula people reach for by habit, is sample-based. It is also the conservative choice: it always gives the larger number, so you are not understating uncertainty. That said, if a textbook question says "the heights of all five children in the family", it means all five, and it wants σ.

The spreadsheet functions people mix up

FormulaExcel / Google SheetsDivides byUse when
Population σSTDEV.P (older: STDEVP)nYour data is the whole group
Sample sSTDEV.S (older: STDEV)n − 1Your data is a sample of a larger group
Population variance σ²VAR.PnAs above, before the square root
Sample variance s²VAR.Sn − 1As above, before the square root

Note the trap in the old names: plain STDEV is the sample version, and STDEVP is the population one. People reasonably assume the unadorned name is the plain, obvious, divide-by-n formula. It is not. If your spreadsheet answer disagrees with this calculator, check which of the two you called before you check anything else — and note that this page shows both, so one of them will match.

A fully worked example

Take the classic small data set: 2, 4, 4, 4, 5, 5, 7, 9. There are eight values, so n = 8.

Step 1 — find the mean. Add the values and divide by the count.

Σx = 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40

x̄ = 40 / 8 = 5

Step 2 — subtract the mean from each value, then square the result. The squaring is what stops the positive and negative deviations cancelling out; without it, the deviations from the mean always sum to exactly zero, which is why "average deviation" as a naive quantity is useless.

xx − x̄(x − x̄)²
2−39
4−11
4−11
4−11
500
500
724
9416

Step 3 — add up the squared deviations.

Σ(x − x̄)² = 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32

Step 4 — divide. This is where the two formulas split.

Population: σ² = 32 / 8 = 4

Sample: s² = 32 / 7 = 4.5714

Step 5 — take the square root.

Population: σ = √4 = 2

Sample: s = √4.5714 = 2.1381

Same eight numbers, two defensible answers, and they differ by roughly seven per cent. Enter this data set into the calculator (it is one of the example buttons) and every one of those intermediate figures appears on screen, in that order.

A second example with a wider spread

The set 4, 8, 15, 16, 23, 42 has n = 6 and sums to 108, so the mean is 18. The deviations are −14, −10, −3, −2, 5 and 24; squared, they are 196, 100, 9, 4, 25 and 576, which total 910.

  • Population variance: 910 / 6 = 151.6667, so σ = 12.3153
  • Sample variance: 910 / 5 = 182, so s = 13.4907

Notice how one value does most of the work: the 42 alone contributes 576 of the 910, well over half the total spread, from a single observation out of six.

Variance and standard deviation are the same information

Variance is the average squared deviation. Standard deviation is its square root. They are two views of one quantity, and the calculator shows both because different courses and different fields ask for different ones.

Variance is the more convenient quantity mathematically — variances of independent things add together, standard deviations do not — which is why it appears throughout statistical theory, in ANOVA, in regression, in error propagation. But it is in squared units, and squared units are close to meaningless to a reader. A variance of 4 "square marks" or 25 "square dollars" describes nothing anyone can picture.

Standard deviation converts back to the original units, which is why it is what gets reported. If exam scores have a standard deviation of 12 marks, that is 12 marks — directly comparable to the scores themselves and to the mean. When you are writing up a result, report the standard deviation; when you are doing algebra, work with the variance.

What the number actually tells you

Standard deviation measures spread: how far, typically, the values sit from their mean. A small value means the data clusters tightly; a large one means it is scattered. Two data sets can share an identical mean and describe completely different realities — a class where everyone scored around 70 and a class where half scored 40 and half scored 100 both average 70, and only the standard deviation separates them.

  • Zero standard deviation means every value is identical. It is not an error; it is the honest answer for a data set with no variation at all.
  • The value is always positive or zero, because it comes from a square root of a sum of squares. A negative standard deviation is impossible, so if you have calculated one by hand, you have made a sign or ordering mistake.
  • It carries the units of the data. Standard deviation of a set of kilograms is in kilograms.
  • It is only comparable across data sets on the same scale. A standard deviation of 5 is huge for a set of exam percentages and trivial for a set of house prices. To compare spread across different scales, divide by the mean to get the coefficient of variation, or convert individual values to z-scores — how many standard deviations a value sits from the mean, which is exactly what the number is for.
  • For roughly bell-shaped data, the familiar rule of thumb is that about two thirds of values fall within one standard deviation of the mean and about ninety-five per cent within two. This is a property of the normal distribution, not of standard deviation itself — for skewed or bimodal data it can be badly misleading, so look at the numbers, not just the summary.

Outliers move it a long way

Because deviations are squared, a value far from the mean contributes disproportionately. Doubling how far a point sits from the mean quadruples what it adds to the total. This makes standard deviation genuinely sensitive to outliers, which is worth demonstrating rather than asserting.

Take the tightly clustered set 9, 10, 11, 10, 9, 11, 10. It has n = 7, sums to 70, mean 10, and the squared deviations total just 4. The population standard deviation is √(4/7) = 0.7559 and the sample standard deviation is √(4/6) = 0.8165. Tight, as expected.

Now add a single value of 40. The set becomes eight values summing to 110, and the mean jumps from 10 to 13.75. The squared deviations now total 791.5, giving a population standard deviation of 9.9467 and a sample standard deviation of 10.6335 — more than thirteen times the original. One observation out of eight did that.

The lesson is not that standard deviation is broken. It is that you should look at your data before you summarise it, and check whether an extreme value is a genuine observation or a typo, a unit mix-up, or a sensor glitch. If it is real and you still want a spread measure that shrugs it off, the interquartile range is the usual alternative. If it is a data-entry error, fix it — and here the calculator's per-value table earns its place, because the row with the enormous squared deviation points straight at the culprit.

Using the calculator

  • Paste however your data is shaped. Commas, spaces, tabs and line breaks all work as separators, and you can mix them, so a column copied out of a spreadsheet and a comma-separated list from a document both work without reformatting.
  • Negative numbers and decimals are fine. Tokens that are not numbers are ignored rather than treated as zero, which stops a stray label or a trailing comma from silently corrupting the mean. The line under the box reports how many values were parsed — check it against how many you expected before trusting the result.
  • Three example buttons load a widely spread set, a tightly clustered set, and the textbook set that comes out to exactly σ = 2, so you can see the difference between spread and cluster immediately.
  • Sample results need at least two values. With a single value, the population standard deviation is 0 and the sample version is undefined — you would be dividing by zero — so the calculator says so rather than showing a meaningless number.
  • The per-value table appears for smaller data sets and is hidden for large ones, where a few hundred rows of arithmetic would bury the results. The summary figures are computed for any size.
  • Results are rounded for display. The underlying arithmetic is done at full precision, so tiny differences against a hand calculation are usually just rounding at different points — round only at the end, never in the middle.

If you are checking a homework answer and the number does not match, work down the step list: is your mean right, are your deviations right, is your sum of squares right, and did you divide by n or by n − 1? In practice, the answer is that last one far more often than any of the others.

Frequently Asked Questions

What is the difference between population and sample standard deviation?+

They use different divisors. Population standard deviation divides the sum of squared deviations by N (the total count) and is used when your data is the entire group you care about. Sample standard deviation divides by n − 1 (Bessel's correction) and is used when your data is a sample meant to estimate a larger population. The n − 1 version is slightly larger and is the more common choice in real-world statistics.

How do I calculate standard deviation step by step?+

Five steps: (1) find the mean of your values; (2) subtract the mean from each value and square the result; (3) add up those squared deviations; (4) divide by N for the population or by n − 1 for a sample to get the variance; (5) take the square root of the variance. This calculator shows all five steps with your actual numbers.

What does standard deviation actually tell you?+

It tells you how spread out the data is around the average. A low standard deviation means most values are close to the mean; a high one means they are widely scattered. For data that follows a normal distribution, about 68% of values fall within one standard deviation of the mean, 95% within two, and 99.7% within three.

What is the relationship between variance and standard deviation?+

Standard deviation is simply the square root of the variance. Variance is the average squared distance from the mean and is expressed in squared units, which is hard to interpret. Taking the square root returns the spread to the original units of your data, which is why standard deviation is usually reported instead of variance.

Can standard deviation be zero or negative?+

It can be zero — that happens only when every value in the data set is identical, so there is no spread at all. It can never be negative, because it is a square root of an average of squared (non-negative) numbers. The smallest possible standard deviation is zero.

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.