Standard Deviation Calculator
Paste or type your data set (commas, spaces, or new lines all work), choose sample or population, and get the standard deviation, variance, mean, and margin of error — with every step of the math shown below the results.
Steps
Sample vs. population — which to pick
Use population when your list is the entire group you care about (every student in one class). Use sample when the list is a slice of a bigger group you want to generalize to (30 shoppers out of all shoppers). The sample formula divides by n − 1 instead of n — Bessel’s correction — which slightly enlarges the result to offset the fact that a sample underestimates spread. The margin of error line multiplies the standard error (SD ÷ √n) by a z-value for your confidence level, telling you how far the sample mean is likely to sit from the true mean.
How it’s calculated
Mean x̄ = Σxᵢ ÷ n. Sum of squared deviations SS = Σ(xᵢ − x̄)². Population variance σ² = SS ÷ n; sample variance s² = SS ÷ (n − 1). SD is the square root of the variance. Standard error = SD ÷ √n, and margin of error = z × SE (z = 1.645, 1.96, or 2.576 for 90%, 95%, 99%).
Results update as you type and are for education, not professional advice — double-check any number that matters.
Worked example
For the data set 10, 12, 23, 23, 16, 23, 21, 16: n = 8, sum = 144, mean = 18, and Σ(xᵢ − 18)² = 192. As a sample: variance = 192 ÷ 7 = 27.43 and SD = 5.2372. As a population: variance = 192 ÷ 8 = 24 and SD = 4.899. The standard error is 5.2372 ÷ √8 = 1.8516, so the 95% margin of error is 1.96 × 1.8516 = ±3.63.
Common mistakes
- Using the population formula on survey or sample data — it understates the spread you should report.
- Mixing units in one list (inches with centimeters) — the SD becomes meaningless.
- Reading SD as a maximum: roughly 32% of normal data falls more than 1 SD from the mean.
Where it is used
- Grading curves and test-score spread in classrooms.
- Quality control — how consistent a process or machine is.
- Finance, where SD of returns is the standard volatility measure.
Frequently asked questions
What is the difference between sample and population standard deviation?
The population formula divides the squared deviations by n and describes a complete group. The sample formula divides by n − 1 to correct for the fact that a sample tends to understate the true spread. If in doubt and your data is a subset of something larger, use sample.
Why divide by n − 1 instead of n?
Deviations are measured from the sample mean, which is itself fitted to the data, so the raw average of squared deviations runs low. Dividing by n − 1 (Bessel’s correction) removes that bias in the variance.
What does the margin of error line mean?
It estimates how far your sample mean is likely to be from the true population mean. For the example data, 18 ± 3.63 at 95% confidence means that if you repeated the sampling many times, about 95% of intervals built this way would contain the true mean.
Can standard deviation be zero or negative?
It can be zero — only when every value is identical — but never negative, because it is the square root of an average of squared numbers.
How many numbers do I need?
Two or more for a sample SD (n − 1 must be at least 1). More data gives a steadier estimate; below roughly 10 values, expect the SD to move a lot as numbers are added.