Standard Deviation Calculator
Standard deviation and variance.
Formula
σ = √[Σ(x–μ)²/(n–1)]
Example
2,4,4,4,5,5,7,9 → SD ≈ 2.0.
Embed this calculator on your site
Add this free calculator to your own website with one line of code. The embedded version is responsive, ad-free, and includes a small attribution link back to CalcNest AI.
<iframe src="https://calcnestai.com/embed/standard-deviation-calculator.html" width="100%" height="700" frameborder="0" style="border: 1px solid #e5e5e5; border-radius: 12px; max-width: 720px;" loading="lazy" title="Standard Deviation Calculator — Free Tool by CalcNest AI"></iframe>
Understanding the Standard Deviation Calculator
A standard deviation calculator measures how spread out a set of numbers is around their mean. It reports the sample standard deviation, dividing by one less than the count, and that small adjustment is the difference between a biased estimate and an unbiased one.
How it actually works
Enter numbers separated by commas. The calculator finds the mean, averages the squared deviations using n minus one, and takes the square root. The values 5 through 50 in steps of 5 give a mean of 27.5 and a standard deviation of 15.14.
| Divide by | Use when |
|---|---|
| n − 1 (sample) | Estimating a population from a sample |
| n (population) | The data is the entire population |
| Difference | Larger for small n, negligible for large n |
| This calculator | Uses n − 1 |
The deeper context most people miss
Dividing by n minus one is Bessel's correction, and it exists because the sample mean is itself estimated from the data. Deviations measured from the sample mean are systematically smaller than deviations from the true population mean, so dividing by n understates the spread.
Why Bessel's correction is not arbitrary
The sample mean is, by construction, the value minimising the sum of squared deviations for that particular sample. That means the squared deviations from the sample mean are always at least as small as the squared deviations from the true population mean would be, and usually smaller. Dividing by n would therefore produce an estimate biased downward, systematically understating the population variance. Dividing by n minus one corrects it exactly, in the sense that the resulting estimator has the right expected value across repeated samples. The intuition frequently offered is about degrees of freedom: once the mean is fixed, only n minus one of the deviations are free to vary, since the last is determined by the requirement that they sum to zero. Both framings point at the same thing, that one piece of information in the data was already spent estimating the mean. The correction matters most for small samples, where dividing by 9 rather than 10 changes the result meaningfully, and becomes negligible as n grows, which is why the distinction is often glossed over in large-data contexts. A subtlety worth knowing is that Bessel's correction makes the variance unbiased and does not make the standard deviation unbiased, since the square root is a non-linear transformation and taking it reintroduces a small bias. That residual bias is usually ignored because it is small and because correcting it depends on the underlying distribution.
A worked example: what the number actually means
A standard deviation of 15.14 on a mean of 27.5 says the typical deviation from the mean is around 15 units, in the same units as the data, which is why standard deviation is reported rather than variance despite variance being the more mathematically natural quantity. Variance is in squared units, so a variance of 229 on data measured in kilograms is 229 squared kilograms, which is not interpretable. Standard deviation restores the original units and can be compared directly against the mean. For roughly normal data, about two thirds of observations fall within one standard deviation and about 95% within two, which gives the figure practical meaning, and those proportions fail for skewed or heavy-tailed data where the standard deviation still exists but describes the spread poorly. Chebyshev's inequality provides a distribution-free guarantee, that at least 75% of any dataset falls within two standard deviations and at least 89% within three, which is much weaker than the normal figures and holds regardless of shape. When the standard deviation exceeds the mean for data that cannot be negative, that itself signals substantial skew, since a symmetric distribution with that spread would extend below zero.
Deciding whether standard deviation is the right measure
It assumes the mean is a meaningful centre, which fails for skewed data, and it weights outliers heavily since deviations are squared. A single extreme value can dominate the result, which is why robust alternatives exist. The median absolute deviation takes the median of the absolute deviations from the median and is far less sensitive to outliers, with a scaling constant applied to make it comparable to the standard deviation for normal data. The interquartile range describes the middle half of the data and pairs naturally with the median. Range is the crudest measure and is entirely determined by the two most extreme values, so it grows with sample size and is not comparable across different sized samples. For comparing spread between datasets with different scales, the coefficient of variation divides the standard deviation by the mean, giving a dimensionless relative measure, though it is meaningless when the mean is near zero or when the data can be negative. In quality control, standard deviation underpins process capability indices and control chart limits, conventionally at three standard deviations, and the choice of that threshold is a deliberate trade-off between false alarms and missed signals rather than a natural constant.
Why standard deviation is everywhere in inference
Almost all classical statistical inference runs through the standard deviation, because the standard error of a mean is the standard deviation divided by the square root of the sample size. That single relationship governs how precision improves with data collection, and its square root shape is consequential: quadrupling a sample only halves the uncertainty, so precision is expensive and the returns diminish steadily. It is why sample size calculations produce the numbers they do and why increasing a survey from 1,000 to 2,000 respondents improves the margin of error by only about 30%. Confidence intervals are built from it, hypothesis tests compare differences against it, and effect sizes including Cohen's d express differences in standard deviation units precisely so they can be compared across studies measuring different things. In finance, standard deviation of returns is the conventional definition of volatility, which is a substantive modelling choice rather than a neutral one: it treats upside and downside deviation identically, when investors do not, which is why downside deviation and semi-variance exist as alternatives. It also assumes a stable distribution, and financial returns are heavy-tailed and volatility clusters, so a standard deviation estimated over a calm period badly understates risk in a turbulent one.
Variations: variance, robust measures, and computation
Variance is the square of the standard deviation and adds cleanly for independent variables, which is why it appears in derivations while standard deviation appears in reports. Population and sample versions differ by the divisor. Weighted standard deviation applies where observations carry different weights. Pooled standard deviation combines groups assumed to share a common spread. Median absolute deviation and the interquartile range are robust alternatives. Standard error is the standard deviation of a statistic rather than of the data, and confusing the two is a common error in reporting, since standard error shrinks with sample size while standard deviation does not. In computation, the naive approach of summing squares and subtracting the squared mean is numerically unstable for data with a large mean and small variance, where catastrophic cancellation can produce a negative variance, and Welford's online algorithm computes it stably in a single pass and is what library implementations use. For streaming data, online algorithms update the estimate incrementally without storing all values, which matters at scale.
Using standard deviation correctly
Use the sample formula with n minus one when estimating a population from a sample, which is the usual case, and the population formula only when the data genuinely is the whole population. Report standard deviation rather than variance for interpretation, since it carries the original units while variance is in squared units. Check whether the data is roughly symmetric before relying on the two thirds and 95% rules, which hold for normal data and fail for skewed or heavy-tailed distributions. Use Chebyshev's bounds where distribution shape is unknown, which are weaker and hold universally. Consider robust alternatives including median absolute deviation where outliers are present, since squaring deviations weights extreme values heavily. Distinguish standard deviation from standard error, since the first describes the data and the second describes the precision of an estimate and shrinks with sample size. Remember that precision improves with the square root of sample size, so quadrupling a sample only halves the uncertainty. And use Welford's algorithm or a library implementation rather than summing squares, which is numerically unstable.
What people get wrong
- Dividing by n when estimating a population from a sample, which systematically understates spread because deviations from the sample mean are smaller than deviations from the true mean.
- Confusing standard deviation with standard error, when the first describes the spread of the data and the second the precision of an estimate and shrinks with sample size.
- Applying the 68 and 95 percent rules to skewed or heavy-tailed data, where the standard deviation still computes but describes the spread poorly.
- Computing variance by summing squares and subtracting the squared mean, which is numerically unstable and can return a negative value for data with a large mean.
Where the math comes from
Sample standard deviation = √(Σ(xᵢ − x̄)² / (n − 1)), where the divisor of n − 1 is Bessel's correction. It makes the variance estimate unbiased, because deviations measured from the sample mean are systematically smaller than deviations from the true population mean. The population version divides by n instead.
Questions and answers
Sample vs population SD - which should I use?
Sample (n-1 denominator) is correct unless you have data from the entire population. Most calculators default to sample formula. Population formula is rarely needed in practice.
What does standard deviation mean?
In a normal distribution, roughly 68% of data falls within 1 SD of the mean, 95% within 2 SD, 99.7% within 3 SD. This is the 68-95-99.7 rule.
How is SD related to variance?
Variance is SD squared. SD is in the same units as your data (more interpretable); variance is in squared units.
What if my data is not normal?
SD still measures spread, but the 68-95-99.7 rule does not apply. For skewed data, use median and interquartile range (IQR) instead.
How do I interpret coefficient of variation?
CV = SD / mean, expressed as percent. Useful for comparing variability across datasets with different units or scales. CV under 15% is generally low variability; over 30% is high.
Why divide by n minus one?
Because the sample mean is estimated from the same data, and deviations from it are systematically smaller than deviations from the true population mean would be. Dividing by n would bias the estimate downward; n minus one corrects it exactly in expectation.
When should I use the population formula?
Only when your data genuinely is the entire population rather than a sample from one. That's rarer than it sounds, and using the sample formula when in doubt is the safer default since the difference is negligible for large n anyway.
What does the number actually tell me?
The typical deviation from the mean, in the same units as the data. For roughly normal data, about two thirds of values fall within one standard deviation and 95% within two, though those proportions fail for skewed or heavy-tailed distributions.
Why report standard deviation rather than variance?
Because variance is in squared units, so a variance of 229 on kilogram data is 229 squared kilograms, which isn't interpretable. Standard deviation restores the original units and can be compared directly against the mean.
Is standard deviation robust to outliers?
No, and it's quite sensitive since deviations are squared, so a single extreme value can dominate. Median absolute deviation and the interquartile range are robust alternatives where outliers are present or the data is skewed.
What's the difference from standard error?
Standard deviation describes the spread of the data itself; standard error describes the precision of an estimate and equals the standard deviation divided by the square root of sample size. Standard error shrinks with more data while standard deviation does not.
Why does more data improve precision so slowly?
Because standard error falls with the square root of sample size, so quadrupling a sample only halves the uncertainty. It's why increasing a survey from 1,000 to 2,000 respondents improves the margin of error by only around 30%.
Related calculators
Area · Probability · Matrix Determinant 2x2 · Modular Arithmetic · Sigma Notation Evaluator