Standard deviation calculator
This standard deviation calculator finds the sample and population standard deviation of a list of numbers, along with the variance, mean and sum of squares. It shows the formula with your numbers and a table of every deviation.
- Paste numbers separated by commas, spaces or new lines
- Sample (n − 1) and population (N) side by side
- Step-by-step working with a deviation table
Last updated
How to use the standard deviation calculator
- Type or paste your numbers. Separate them with commas, spaces or line breaks; a column copied from a spreadsheet works.
- Choose sample if your numbers are a sample from a larger group, or population if they are every member of the group.
- Read the standard deviation. The working underneath shows the mean, the sum of squares, the variance and the square root.
- Open “Show the deviation for every value” to check each line of a hand calculation.
The standard deviation formula
Standard deviation measures how spread out numbers are around their mean. It is the square root of the variance, which is the average squared distance from the mean.
sample: s = √( Σ(x − x̄)² ÷ (n − 1) ) population: σ = √( Σ(x − μ)² ÷ N )
Σ(x − x̄)² is the sum of squares: subtract the mean from each value, square the result, and add them up. The sample formula divides by n − 1 instead of n (Bessel’s correction), because a sample’s own mean sits closer to its values than the true population mean does, and dividing by n would understate the spread.
Worked example
Find the standard deviation of 2, 4, 4, 4, 5, 5, 7, 9.
- Mean: (2 + 4 + 4 + 4 + 5 + 5 + 7 + 9) ÷ 8 = 40 ÷ 8 = 5.
- Deviations from the mean: −3, −1, −1, −1, 0, 0, 2, 4.
- Squared: 9, 1, 1, 1, 0, 0, 4, 16. Sum of squares = 32.
- Sample variance: 32 ÷ (8 − 1) = 4.5714. Sample standard deviation: √4.5714 = 2.1381.
- Population variance: 32 ÷ 8 = 4. Population standard deviation: √4 = 2.
Sample or population?
Use the population formula only when your data includes every member of the group you care about, such as the test scores of every student in one class when you only care about that class. Use the sample formula when your numbers are a subset used to describe a bigger group, such as 50 surveyed customers out of thousands. In homework and lab reports, sample is the usual default.
| Sample | Population | |
|---|---|---|
| Symbol | s | σ (sigma) |
| Mean symbol | x̄ | μ (mu) |
| Divide by | n − 1 | N |
| Excel / Sheets | STDEV.S | STDEV.P |
Common questions
How do you calculate standard deviation?
Find the mean, subtract it from each value, square the results, add them up, divide by n − 1 (sample) or N (population), and take the square root. For 2, 4, 4, 4, 5, 5, 7, 9 that gives s = √(32 ÷ 7) = 2.14.
What is the difference between sample and population standard deviation?
Population standard deviation divides the sum of squares by N; sample standard deviation divides by n − 1. The sample value is always a little larger: 2.14 versus 2.00 for the eight numbers above.
What is the relationship between variance and standard deviation?
Standard deviation is the square root of variance. A variance of 4.5714 gives a standard deviation of 2.1381. Standard deviation is in the same units as the data; variance is in squared units.
What does a standard deviation tell you?
How far values typically sit from the mean. For data that follows a normal (bell-shaped) distribution, about 68% of values fall within one standard deviation of the mean and about 95% within two.
How do I calculate standard deviation in Excel?
Use =STDEV.S(A1:A8) for a sample or =STDEV.P(A1:A8) for a population.
Can standard deviation be negative or zero?
It can never be negative, because it is a square root of squared distances. It is zero only when every value is the same.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.6 Measures of Scale. Variance and standard deviation formulas with N − 1, and units of each
- OpenStax Introductory Statistics 2e, 6.1 The Standard Normal Distribution. The 68-95-99.7 (empirical) rule for normal data
- Microsoft Support: STDEV.S function. STDEV.S uses the n − 1 method; STDEV.P is for a whole population
See the methodology page for how Studyfigure builds and checks its calculators.