Standard deviation measures how far values typically sit from their mean. Two classes can both average 70 on a test, but if one class’s scores have a standard deviation of 3 and the other’s 15, the first class scored much more evenly. Enter your numbers to get the standard deviation, variance, mean and standard error.
Choose “sample” when your data is part of a larger group, which is the usual case for surveys, experiments and measurements. Choose “population” only when you have every value you want to describe.
What is standard deviation?
Standard deviation is a measure of spread: roughly, how far a typical value is from the mean. A small standard deviation means the values cluster tightly; a large one means they are widely scattered. It is the square root of the variance, which is the average squared distance from the mean.
It is the spread measure behind most of statistics. Quality control flags parts more than three standard deviations from target, test scores are reported as z-scores in standard-deviation units, and confidence intervals and margins of error are built from it. There are two versions: the population standard deviation (σ) divides by n, and the sample standard deviation (s) divides by n − 1 to correct for estimating from a sample.
How to use the standard deviation calculator
- Paste or type your values, separated by commas, spaces or new lines.
- Choose sample or population.
- Read the standard deviation, and use the standard error if you are estimating a mean.
Formula
s = √( Σ(xᵢ − x̄)² ÷ (n − 1) )
Subtract the mean from each value, square the differences, add them up, divide by n − 1 and take the square root. For a whole population divide by n instead: σ = √( Σ(xᵢ − μ)² ÷ n ).
The variance is the value before the square root. It is in squared units (cm², dollars²), which is why the standard deviation is easier to interpret.
Worked examples
A sample of measurements
- Data set
- 2, 4, 4, 4, 5, 5, 7, 9
- Your data is a…
- Sample (divide by n − 1)
- Sample standard deviation (s)
- 2.13809
- Variance
- 4.571429
- Mean
- 5
The mean is 40 ÷ 8 = 5. The squared deviations add up to 32. Divide by n − 1 = 7 for a variance of 4.571, and take the square root: s ≈ 2.138.
The same data as a whole population
- Data set
- 2, 4, 4, 4, 5, 5, 7, 9
- Your data is a…
- Whole population (divide by n)
- Population standard deviation (σ)
- 2
- Variance
- 4
- Mean
- 5
Divide the same sum of squares by n = 8 instead: variance = 4, so σ = 2. The population version is always a little smaller.
A week of daily highs
- Data set
- 18, 19, 21, 22, 20
- Your data is a…
- Sample (divide by n − 1)
- Sample standard deviation (s)
- 1.581139
- Variance
- 2.5
- Mean
- 20
The mean is 100 ÷ 5 = 20 °C. The deviations are −2, −1, 1, 2 and 0, whose squares add to 10. Dividing by 4 gives a variance of 2.5 °C², so s = √2.5 ≈ 1.58 °C.
The 68–95–99.7 rule for normal data
| Range | Share of values inside | Share outside |
|---|---|---|
| Mean ± 1 SD | 68.27% | 31.73% |
| Mean ± 2 SD | 95.45% | 4.55% |
| Mean ± 3 SD | 99.73% | 0.27% |
| Mean ± 1.96 SD | 95% | 5% |
| Mean ± 2.576 SD | 99% | 1% |
Sample or population?
The test is what you want to say something about. A teacher describing only this year’s class has the whole population. A survey of 500 voters, ten measurements of a part, or a month of sales used to predict next month are all samples, because the conclusion is about something bigger than the data.
The difference shrinks as n grows. With 8 values the sample version is about 7% larger than the population version; with 100 values it is about 0.5% larger.
Standard deviation or standard error?
The standard deviation describes how spread out individual values are. The standard error, s ÷ √n, describes how precisely the sample mean estimates the true mean. Adding more data barely changes the standard deviation but keeps shrinking the standard error. Use the first to describe your data and the second for confidence intervals.
Comparing spread across scales
A standard deviation of 5 kg means a lot for newborns and very little for elephants. The coefficient of variation, s ÷ mean, expresses the spread as a percentage of the mean so that different scales can be compared.
Common mistakes
- Using the population formula for a sample, which understates the spread.
- Reporting the variance when you mean the standard deviation. The variance is in squared units.
- Rounding the mean before working out the deviations, which adds error to every term.
- Assuming the 68–95–99.7 rule holds for data that is clearly skewed.
Frequently asked questions
Why divide by n − 1 for a sample?
A sample’s values sit closer to their own mean than to the true population mean, so dividing by n underestimates the spread. Dividing by n − 1 (Bessel’s correction) removes that bias from the variance.
What does a standard deviation tell me?
The typical distance from the mean. For roughly bell-shaped data, about 68% of values fall within one standard deviation of the mean and about 95% within two.
Can the standard deviation be zero or negative?
It can be zero, when every value is the same. It can never be negative, because it is the square root of an average of squares.
Which Excel function should I use?
STDEV.S for a sample (divides by n − 1) and STDEV.P for a population (divides by n). The older STDEV function is the same as STDEV.S.
What is the difference between variance and standard deviation?
The standard deviation is the square root of the variance. Both measure spread, but the standard deviation is in the same units as the data.
Sources
- Measures of Scale, NIST/SEMATECH e-Handbook of Statistical Methods
- Introductory Statistics 2e, 2.7: Measures of the Spread of the Data, OpenStax, Rice University
Last updated · Calculations checked by automated tests· Editorial policy