Standard Deviation Calculator
Standard deviation measures how far values typically sit from their mean. Divide the sum of squared deviations by n for the population standard deviation, or by n − 1 for the sample standard deviation, then take the square root. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5, the population standard deviation is 2 and the sample standard deviation is 2.1381. Paste your own numbers above to see both, with every squared deviation.
Sample SD (s)
2.1381
Population SD (σ)
2
Sample variance
4.5714
Population variance
4
Count (n)
8
Mean
5
Working
- Mean x̄ = 40 ÷ 8 = 5
- (2 − 5)² = 9
- (4 − 5)² = 1
- (4 − 5)² = 1
- (4 − 5)² = 1
- (5 − 5)² = 0
- (5 − 5)² = 0
- (7 − 5)² = 4
- (9 − 5)² = 16
- Sum of squared deviations = 32
- Population: σ² = 32 ÷ 8 = 4, σ = √4 = 2
- Sample: s² = 32 ÷ 7 = 4.5714, s = √4.5714 = 2.1381
Example: 2, 4, 4, 4, 5, 5, 7, 9
- Mean x̄ = 40 ÷ 8 = 5
- (2 − 5)² = 9
- (4 − 5)² = 1
- (4 − 5)² = 1
- (4 − 5)² = 1
- (5 − 5)² = 0
- (5 − 5)² = 0
- (7 − 5)² = 4
- (9 − 5)² = 16
- Sum of squared deviations = 32
- Population: σ² = 32 ÷ 8 = 4, σ = √4 = 2
- Sample: s² = 32 ÷ 7 = 4.5714, s = √4.5714 = 2.1381
Sample or population?
Use the population standard deviation (σ, dividing by n) only when your numbers are every member of the group you care about. Use the sample standard deviation (s, dividing by n − 1) when the numbers are a sample drawn from a larger group, which is the usual case in class, in labs and in surveys. Dividing by n − 1 corrects for the fact that a sample sits closer to its own mean than to the true population mean, so the n version tends to underestimate the spread.
The standard deviation is the square root of the variance, which brings the spread back to the original units. A data set with a standard deviation of 2.1 points on a test, for example, has typical deviations of about two points from the average.
How the calculator works
It computes the mean, subtracts it from each value, squares the differences and adds them up. The working is displayed line by line, so you can match it to your textbook. With a single number the sample standard deviation is undefined, because n − 1 is 0, and the calculator says so instead of returning a misleading value. Values can be separated by commas, spaces or new lines, and negative numbers and decimals are accepted.
Standard deviation is sensitive to outliers because the deviations are squared. If one extreme value dominates, compare it with the interquartile range from the five number summary calculator, which ignores the extremes.
Frequently asked questions
- Why divide by n − 1?
- A sample tends to sit closer to its own mean than to the population mean, so dividing by n − 1 corrects the variance estimate upward (Bessel’s correction).
- How is variance related to standard deviation?
- The standard deviation is the square root of the variance. Variance is in squared units; standard deviation is in the original units.
- Can the standard deviation be negative?
- No. It is a square root, so it is zero or positive. It is zero only when every value is identical.
- Which button does my calculator use?
- Most calculators label the sample version s or Sx and the population version σ or σx. Use the sample version unless you have the whole population.
Sources and references
- OpenStax Introductory Statistics 2e: Measures of the Spread of the Data: sample and population standard deviation.