Standard Deviation Calculator
Standard deviation measures how far the numbers spread from their mean — the dispersion of the data. Enter your values and pick population or sample to get the standard deviation, variance and mean.
Your numbers
Result
- Variance
- 4
- Mean
- 5
- Count
- 8
| Step | Value |
|---|---|
| Count | 8 |
| Mean | 5 |
| Variance (÷ n) | 4 |
| Standard deviation | 2 |
How it is calculated, step by step
Start with the mean. Then take each value, subtract the mean, and square the difference. Add those squares, divide by n (population) or n−1 (sample) to get the variance, and take the square root for the standard deviation.
Run it on the default list — 2, 4, 4, 4, 5, 5, 7, 9. The sum is 40 across 8 values, so the mean is 5. The deviations are −3, −1, −1, −1, 0, 0, +2 and +4. Squared, those become 9, 1, 1, 1, 0, 0, 4 and 16, adding to 32.
In population mode, 32 ÷ 8 = 4 is the variance and √4 = 2 is the standard deviation. In sample mode, 32 ÷ 7 ≈ 4.571 and the standard deviation rises to about 2.14.
One check worth doing before you trust any result: the deviations you compute must sum to exactly zero before squaring. If they do not, the mean is wrong.
Why square the differences and then undo it
The obvious approach — average the distances from the mean directly — fails for a reason worth understanding. The deviations from the mean always sum to zero, by definition; the positives and negatives cancel exactly. Averaging them would return 0 for every dataset ever collected, which is why some operation has to remove the sign first. Squaring removes it, and does something else besides: it gives disproportionate weight to large deviations. A deviation of 4 contributes 16 to the total while a deviation of 1 contributes 1 — sixteen times as much for four times the distance. That is a deliberate choice. It means the standard deviation is deeply sensitive to outliers, which is desirable when you are looking for defects and misleading when a single data-entry error slips into the file. An alternative exists. The mean absolute deviation takes the absolute value instead of the square, treating all distances proportionally. It is more robust to outliers and easier to explain — but the variance has mathematical properties that make it far more workable, most importantly that variances of independent quantities simply add. Squaring leaves one problem: the units. A variance computed from dollars comes out in "dollars squared", which means nothing. The final square root exists purely to restore the original units, which is why the standard deviation, not the variance, is the number you report.
Population or sample: the n−1 correction
Use population (÷ n) when your data is the entire group you care about: every student in the class, all twelve months of a completed year. Use sample (÷ n−1) when the data is a sample drawn from something larger and you want to estimate the spread of the whole.
The reason for n−1, known as Bessel's correction, is subtle and worth stating precisely. The mean used in the calculation was itself estimated from the same data. By construction, that sample mean is the value that minimises the sum of squared deviations for this particular sample — so the deviations you measure from it are systematically smaller than the deviations from the true population mean would have been. Dividing by n−1 instead of n inflates the result just enough to cancel that bias.
How much it matters depends entirely on n. With 8 values the sample standard deviation runs about 7% larger than the population one; with 100 values the gap falls to roughly 0.5%; with thousands, the choice is irrelevant.
A footnote that trips up careful readers: the n−1 divisor makes the variance an unbiased estimator, but taking the square root of an unbiased estimator does not preserve unbiasedness. The sample standard deviation retains a small bias. In practice nobody corrects for it, but "unbiased" is a claim about the variance, not the standard deviation.
In spreadsheets, this is the difference between STDEV.S and STDEV.P. Picking the wrong one produces no error message and no warning — just two reports that quietly disagree.
What the number actually tells you
A low standard deviation means the values huddle near the mean; a high one means they scatter. Neither is good or bad in itself. In manufacturing tolerance you want the smallest possible; in a diversified portfolio, some dispersion is the point. For data that follows a normal distribution, the familiar landmarks apply: about 68% of values fall within one standard deviation of the mean, 95% within two, and 99.7% within three. Those percentages hold only for the normal distribution, and quoting them for arbitrary data is one of the most common statistical errors in business reporting. For a distribution of unknown shape you fall back on Chebyshev's inequality, which is much weaker but universally true: at least 75% of any dataset lies within two standard deviations of its mean, and at least 88.9% within three, whatever the shape. To compare dispersion across different scales, divide the standard deviation by the mean — the coefficient of variation. A standard deviation of $50 is enormous against a mean of $100 and negligible against a mean of $100,000. The raw number alone cannot tell you which situation you are in.
Where one number is not enough
Summarising a dataset into a single statistic always discards something. The four datasets published by Francis Anscombe in 1973 are the standard demonstration: they share essentially the same mean, the same variance and the same regression line, yet their scatter plots look nothing alike — one is a clean linear relationship, one is a curve, one is dominated by a single extreme point. Plot the data before trusting the summary. Two properties are handy for checking your work. Adding a constant to every value does not change the standard deviation at all — the whole cloud slides sideways and the spread is untouched. Multiplying every value by a constant multiplies the standard deviation by the absolute value of that constant. So converting a dataset from feet to inches multiplies the standard deviation by 12, while adding 10 to every reading changes it not at all. And a warning for anyone writing the code. The "one-pass" formula that computes the mean of the squares minus the square of the mean is algebraically correct and numerically unstable. When the mean is large relative to the spread, it subtracts two nearly equal large numbers, the significant digits cancel, and the result loses precision — it can even come out slightly negative, producing a square root of a negative number. Use a two-pass calculation or an incremental algorithm such as Welford's method instead.
Frequently asked questions
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods — Measures of Scale (variance and standard deviation)
- NIST/SEMATECH e-Handbook — the normal distribution and the 1, 2 and 3 sigma bands
- Wolfram MathWorld — Bessel's Correction (why the sample variance divides by n−1)
- Wolfram MathWorld — Chebyshev Inequality (bounds valid for any distribution)
Embed this calculator
Copy the code and paste it into your site or blog. Credit with a link back to Contania is included, and the height adjusts itself.
<iframe src="https://contania.app/embed/math/standard-deviation" title="Standard Deviation Calculator (population & sample)" width="100%" height="720" loading="lazy" style="border:1px solid #e5e0d8;border-radius:12px;max-width:640px"></iframe>
<script>window.addEventListener("message",function(e){if(e.data&&e.data.type==="contania:embed-height"){var f=document.querySelector('iframe[src="https://contania.app/embed/math/standard-deviation"]');if(f){f.style.height=e.data.height+"px"}}});</script>Related calculators
Average
Calculate the mean, median, mode and range of a list of numbers, plus the sum and count. Enter your values separated by commas.
CalculatePercentage
Work out percentages three ways: what is X% of a number, what percent one number is of another, and finding the whole from a part and its percentage.
CalculateRatio
Simplify a ratio to its lowest terms, or solve a proportion to find a missing value. Enter two numbers to reduce A:B, or add a third to solve A:B = C:?.
CalculateTriangle
Enter the three sides of a triangle to get its perimeter, area (Heron’s formula) and type — by sides (equilateral, isosceles, scalene) and by angles (right, acute, obtuse).
Calculate