Standard Deviation Calculator
Your details
Result
Standard deviation
- Variance
- 8.2857
- Mean
- 13.5
- Count
- 8 values
- The other measure
- 2.6926 (population)
- Sum of squared deviations
- 58
- Range
- 9 to 18 (9)
- Coefficient of variation
- 21.32%
- Standard error of the mean
- 1.0177
- Dividing by n−1 = 7 gives 2.8785. The other convention gives 2.6926 — a difference of 6.9%. Using n when you have a sample understates the spread, which is why Bessel's correction exists.
- With only 8 values the estimate is imprecise. The standard error of the mean is 1.0177, which is the uncertainty on the mean itself.
- 6 of 8 values (75%) fall within one standard deviation of the mean. For a normal distribution the expected figure is about 68%.
Every deviation from the mean
Each value less the mean of 13.5, then squared. Squaring is what stops the positive and negative deviations cancelling to zero.
| Value | − mean | Squared |
|---|---|---|
| 12 | -1.5 | 2.25 |
| 15 | 1.5 | 2.25 |
| 9 | -4.5 | 20.25 |
| 18 | 4.5 | 20.25 |
| 14 | 0.5 | 0.25 |
| 11 | -2.5 | 6.25 |
| 16 | 2.5 | 6.25 |
| 13 | -0.5 | 0.25 |
| Total | 0 | 58 |
Sample versus population
| Measure | Divisor | Variance | Standard deviation |
|---|---|---|---|
| Sample | n−1 = 7 | 8.2857 | 2.8785 |
| Population | n = 8 | 7.25 | 2.6926 |
How do you calculate standard deviation?
To calculate standard deviation, find the mean, subtract it from each value and square the result, add those squares, divide by n−1 for a sample or n for a population, then take the square root. The square root returns the answer to the original units.
s = √[ Σ(xᵢ − x̄)² / (n − 1) ] σ = √[ Σ(xᵢ − μ)² / n ]- xᵢ
- Each individual value in the data set
- x̄ or μ
- The mean of the sample or of the population
- n
- How many values there are
- s vs σ
- Sample standard deviation versus population
Standard deviation answers how far a typical value sits from the mean. The obvious approach — average the deviations — fails immediately, because deviations above and below the mean cancel to exactly zero every time. Squaring them removes the sign, and the square root at the end returns the answer to the original units, which is why standard deviation is more useful than variance for interpretation even though variance is the quantity the maths works with. The divisor is the part that trips people up. For a population, divide by n. For a sample, divide by n−1 — Bessel's correction. The reason is that a sample's own mean is itself estimated from the same data, which pulls the deviations slightly too small, so dividing by n would systematically understate the spread. With eight values the two differ by about 7%; with 500 the difference is negligible. If you are estimating something about a wider group from a subset, you have a sample. Only use n when your data genuinely includes every member.
- Add all the values and divide by the count to get the mean.
- Subtract the mean from each value to get its deviation.
- Square every deviation so the negatives stop cancelling out.
- Add all of the squared deviations together into one total.
- Divide by n−1 for a sample, or by n for a population.
- Take the square root to return to the original units.
Worked example: The sample 12, 15, 9, 18, 14, 11, 16, 13
The sample 12, 15, 9, 18, 14, 11, 16, 13
The eight values sum to 108, so the mean is 13.5. Subtracting the mean from each gives deviations of −1.5, 1.5, −4.5, 4.5, 0.5, −2.5, 2.5 and −0.5, which add to exactly zero — the reason the raw deviations cannot be averaged. Squaring them gives 2.25, 2.25, 20.25, 20.25, 0.25, 6.25, 6.25 and 0.25, summing to 58. As a sample, divide by n−1 = 7 for a variance of 8.2857, and the square root is a standard deviation of 2.8785. Treating the same eight numbers as a whole population instead divides by 8, giving a variance of 7.25 and a standard deviation of 2.6926 — about 6.9% smaller. That gap is Bessel's correction, and it shrinks as the sample grows. Six of the eight values, or 75%, lie within one standard deviation of the mean — in the region of the 68% a normal distribution predicts, though with only eight values that proportion is far too noisy to read anything into.
What each standard deviation input means
- Your data
- Your numbers, separated by commas, spaces or line breaks. Anything that is not a number is ignored.
- Is this a sample or the whole population?
- A sample is a subset you are using to estimate a larger group, and divides by n−1. A population is every member, and divides by n. Both figures are shown either way.
What this standard deviation does not account for
- Use n−1 for a sample and n only when your data genuinely includes every member of the population. Dividing by n on a sample systematically understates the spread.
- The raw deviations always sum to zero, which is why they are squared. Averaging them directly would give zero for every data set.
- Standard deviation is in the same units as the data; variance is in units squared. That is why standard deviation is the figure usually reported.
- Standard deviation is sensitive to outliers because deviations are squared — one extreme value can dominate the result. The interquartile range is more robust.
- A single value has no spread, so standard deviation is undefined. Sample standard deviation needs at least two values because the divisor n−1 would otherwise be zero.
- The coefficient of variation expresses spread relative to the mean, which allows comparison between data sets of different magnitudes. It is undefined when the mean is zero.
- The 68-95-99.7 rule only applies to normally distributed data. For a skewed distribution those percentages can be badly wrong.
Frequently asked questions
What is the difference between sample and population standard deviation?
The divisor. A population divides by n; a sample divides by n−1, which is Bessel's correction. A sample's mean is estimated from the same data, so dividing by n would understate the true spread.
Should I use n or n−1?
Use n−1 unless your data includes every member of the group you are describing. In practice almost all real data is a sample, so n−1 is the usual choice and what most software defaults to.
What is the difference between variance and standard deviation?
Standard deviation is the square root of variance. Variance is in squared units, which makes it hard to interpret; the square root returns the figure to the original units of the data.
Why are the deviations squared?
Because deviations above and below the mean always sum to exactly zero, so averaging them directly gives zero for any data set. Squaring removes the sign, and the final square root undoes the scaling.
What does a standard deviation of 2.88 mean?
A typical value sits about 2.88 units from the mean. For roughly normal data, about 68% of values fall within one standard deviation of the mean and about 95% within two.
Can standard deviation be negative?
No. It is a square root of a sum of squares, so it is always zero or positive. A standard deviation of zero means every value in the data set is identical.
Sources and review
Last reviewed .