Standard Deviation Calculator
Calculate standard deviation and variance for any data set. Get both sample and population values, plus the mean, sum, and count.
| Count (n) | 6 |
| Sum | 108 |
| Sample variance (s²) | 182 |
| Population variance (σ²) | 151.667 |
Use sample (s) when your data is a sample of a larger group; use population (σ) when it's the entire set.
How to use this calculator
Paste or type your numbers separated by commas, spaces, or new lines. The calculator returns the sample standard deviation (s) and population standard deviation (σ), the variance for each, plus the mean, sum, and count. You can paste a column directly from a spreadsheet — any whitespace or commas between values are treated as separators.
How standard deviation works
Standard deviation is the most widely used measure of variability in statistics. It answers the question: "On average, how far are individual data points from the mean?" A set where values are tightly clustered around the mean will have a small standard deviation; a set where values are spread far apart will have a large one.
The steps are always the same:
- Calculate the mean (average) of the data.
- Subtract the mean from each value and square the result. Squaring removes negative signs and emphasizes larger deviations.
- Sum all the squared differences.
- Divide by n (for population) or n − 1 (for a sample) to get the variance.
- Take the square root to return to the original units.
Sample vs. population standard deviation
The choice between dividing by n and dividing by n − 1 is not arbitrary. When you compute the variance of asample and divide by n, the result systematically underestimates the true population variance because the sample mean is not the same as the population mean. Dividing by n − 1 (called Bessel's correction) corrects for this bias. In practice:
- Use population standard deviation (σ, divides by n) when you have data for every member of the group you care about — for example, the test scores of all 30 students in a single class.
- Use sample standard deviation (s, divides by n − 1) when your data is a sample drawn from a larger population — for example, 100 randomly selected adults representing all adults in a country. This is by far the more common case.
For large n the difference is tiny. For small n (fewer than 30 or so) the correction matters more.
Worked example — step by step
Data: 4, 8, 15, 16, 23, 42
- Count: n = 6
- Sum: 4 + 8 + 15 + 16 + 23 + 42 = 108
- Mean: 108 ÷ 6 = 18
Squared differences from the mean:
- (4 − 18)² = (−14)² = 196
- (8 − 18)² = (−10)² = 100
- (15 − 18)² = (−3)² = 9
- (16 − 18)² = (−2)² = 4
- (23 − 18)² = 5² = 25
- (42 − 18)² = 24² = 576
- Sum of squared differences = 196 + 100 + 9 + 4 + 25 + 576 = 910
- Population variance: 910 ÷ 6 ≈ 151.67 → σ ≈ 12.32
- Sample variance: 910 ÷ 5 = 182 → s ≈ 13.49
The range is 42 − 4 = 38, but the standard deviation of about 12–13 tells a richer story: most values sit within roughly one standard deviation of the mean (18), though 42 is an outlier that pulls both the mean and the standard deviation upward.
What standard deviation tells you in context
In a normal (bell-curve) distribution, a precise rule applies:
- About 68% of values fall within 1 standard deviation of the mean.
- About 95% fall within 2 standard deviations.
- About 99.7% fall within 3 standard deviations.
This is known as the empirical rule or the 68-95-99.7 rule. It is useful for spotting outliers — any value more than 3 standard deviations from the mean is rare in a normal distribution and worth investigating.
Common mistakes to avoid
- Using population standard deviation on a sample. If you surveyed 50 people to represent a city of millions, use n − 1. Dividing by n will underestimate the true spread.
- Interpreting standard deviation without context. A standard deviation of 10 is large for measuring the heights of adults in centimeters but tiny for the distance between stars in light-years. Always consider the units and the scale of the data.
- Confusing variance and standard deviation. Variance is in squared units; standard deviation is in the original units. For communicating results to non-specialists, standard deviation is almost always easier to interpret.
- Forgetting that standard deviation is sensitive to outliers. A single extreme value can dramatically increase the standard deviation, just as it inflates the mean. Consider also reporting the interquartile range (IQR) as a robust alternative.
The formulas
σ = √( Σ(x − x̄)² ÷ n ) · s = √( Σ(x − x̄)² ÷ (n − 1) )
Variance: σ² = Σ(x − x̄)² ÷ n · s² = Σ(x − x̄)² ÷ (n − 1)
How we calculate this
Frequently asked questions
How do you calculate standard deviation?
Find the mean, subtract it from each value and square the result, average those squared differences to get the variance, then take the square root. Use n in the denominator for a population, or n − 1 for a sample.
What is the difference between sample and population standard deviation?
Population standard deviation (σ) divides by n and is used when you have every data point in the group. Sample standard deviation (s) divides by n − 1 (Bessel's correction) and is used when your data is a sample of a larger group. Dividing by n − 1 removes the bias that would otherwise cause sample variance to underestimate the true population variance.
What does standard deviation tell me?
It measures how spread out the data is around the mean. A small standard deviation means values cluster close to the average; a large one means they are widely scattered. For a normal distribution, about 68% of values fall within one standard deviation of the mean.
What is variance?
Variance is the average of the squared differences from the mean — equivalently, the square of the standard deviation. It is shown here for both the sample and population. Variance uses squared units (e.g., cm²), which is why the square root (standard deviation) is often more useful in practice.
Why do we square the differences when calculating variance?
Squaring serves two purposes: it makes all differences positive (so they do not cancel out), and it weights larger deviations more heavily than smaller ones. Taking the square root at the end returns the result to the original units.
What is a good or bad standard deviation?
There is no universally good or bad standard deviation — it depends entirely on context. A standard deviation of 5 kg in a weight-lifting study means something very different from a standard deviation of 5 kg in precision chemical measurements. Always compare standard deviation relative to the mean (the coefficient of variation) or to an expected value for your domain.
Can standard deviation be negative?
No. Standard deviation is always zero or positive. It equals zero only when every value in the data set is identical. It cannot be negative because it is the square root of variance, and variance is a sum of squared (non-negative) numbers.
What is the coefficient of variation (CV)?
The CV is the standard deviation divided by the mean, often expressed as a percentage: CV = (s ÷ mean) × 100. It lets you compare variability across data sets that have different units or very different mean values.