Free Standard Deviation Calculator with Steps
Enter your data and get the sample and population standard deviation with every step shown: the mean, each deviation, the squared deviations, the sum, the divisor, and the square root. Variance is included, so you never need a separate calculator for it.
Enter your data
Separate values with commas, spaces, or new lines. 2 to 500 values.
Negative numbers and decimals are fine: -3.5, 0.25, 1.2e3
Sample
Use when your data is a sample drawn from a larger group.
s = 2.1380899
Variance s² = 4.5714286
Population
Use when your data is the entire group, nothing left out.
σ = 2
Variance σ² = 4
Step-by-step solution
Step 1 · Find the mean (x̄)
Add every value, then divide by how many there are (n = 8).
x̄ = (2 + 4 + 4 + 4 + 5 + 5 + 7 + 9) / 8 = 40 / 8 = 5
Step 2 · Subtract the mean from each value, then square it
Each deviation is xᵢ − x̄ = xᵢ − 5. Squaring makes every deviation positive so they cannot cancel out.
| xᵢ | xᵢ − x̄ | (xᵢ − x̄)² |
|---|---|---|
| 2 | 2 − 5 = -3 | (-3)² = 9 |
| 4 | 4 − 5 = -1 | (-1)² = 1 |
| 4 | 4 − 5 = -1 | (-1)² = 1 |
| 4 | 4 − 5 = -1 | (-1)² = 1 |
| 5 | 5 − 5 = 0 | (0)² = 0 |
| 5 | 5 − 5 = 0 | (0)² = 0 |
| 7 | 7 − 5 = 2 | (2)² = 4 |
| 9 | 9 − 5 = 4 | (4)² = 16 |
| Sum of squared deviations (Σ) | 32 | |
Step 3 · Divide the sum to get the variance
This is the only place the sample and population formulas differ: the sample divides by n − 1 = 7, the population divides by n = 8.
Sample: s² = 32 / (8 − 1) = 32 / 7 = 4.5714286
Population: σ² = 32 / 8 = 4
Step 4 · Take the square root
The square root undoes the squaring from Step 2, putting the answer back in the same units as your data.
Sample: s = √4.5714286 = 2.1380899
Population: σ = √4 = 2
Summary: n = 8, sum = 40, mean = 5, Σ(xᵢ − x̄)² = 32.
The formula, piece by piece
The sample standard deviation formula is s = √[ Σ(xᵢ − x̄)² / (n − 1) ]. It looks dense, but it is four small operations chained together, and each one has a job.
x̄ is the mean — add every value and divide by n, the number of values. Each (xᵢ − x̄) is a deviation: how far one value sits from the mean, negative if below it, positive if above. Squaring each deviation does two things: it makes everything positive so distances below the mean cannot cancel distances above it, and it weights big deviations more heavily than small ones. Σ just means "add them all up."
Dividing that sum by n − 1 gives the sample variance s²; dividing by n instead gives the population variance σ². The square root at the end undoes the squaring, so the final answer is in the same units as your data — if you measured heights in centimeters, the standard deviation is in centimeters too.
A worked example you can follow by hand
Take the data set 2, 4, 4, 4, 5, 5, 7, 9 — the same one pre-loaded in the calculator above, so you can check every line.
Step 1, the mean: the sum is 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40, and there are n = 8 values, so x̄ = 40 / 8 = 5.
Step 2, deviations and squares: subtracting 5 from each value gives −3, −1, −1, −1, 0, 0, 2, 4. Squaring each gives 9, 1, 1, 1, 0, 0, 4, 16. Their sum is 32.
Step 3, variance: as a sample, s² = 32 / (8 − 1) = 32 / 7 ≈ 4.5714. As a population, σ² = 32 / 8 = 4 exactly.
Step 4, square root: s = √4.5714 ≈ 2.1381 and σ = √4 = 2. Notice the sample answer is always a bit larger — that is the n − 1 divisor at work.
Sample or population: which divisor do you need?
Use the population formula (divide by n) only when your data is the entire group you care about — every student in one specific class, every game a team played this season. Nothing was left out, so the mean you computed is the true mean, and dividing by n is exact.
Use the sample formula (divide by n − 1) when your data is a subset standing in for a larger group — 50 surveyed customers out of thousands, 20 measured plants out of a whole field. A sample's values tend to sit closer to their own sample mean than to the true population mean, which makes the raw average of squared deviations come out slightly too small. Dividing by n − 1 instead of n corrects that bias; the correction is called Bessel's correction.
In practice, statistics courses and real research almost always work with samples, so when a problem does not say which to use, sample standard deviation is usually the intended answer. But read the problem: words like "the entire population," "all," or "every" signal the population formula.
Common mistakes that produce wrong answers
- Forgetting to square the deviations. The raw deviations always sum to zero — that is a property of the mean, not a coincidence — so skipping the squaring step gives a variance of 0 every time.
- Using n when the problem wants n − 1, or the reverse. This is the single most common lost point on homework. State which divisor you used and why.
- Taking the square root too early. The square root is the last step, applied to the variance — not to each squared deviation and not to the sum.
- Rounding the mean before computing deviations. If x̄ = 4.6667 and you round it to 4.7, every deviation inherits the error and the squares amplify it. Keep full precision until the final answer.
- Reporting the variance as the standard deviation. They differ by exactly one square root; if your answer's units are squared (cm², points²), you stopped one step early.
- Dropping a data value or typing one twice. Recount n before dividing — the calculator above shows n explicitly so you can compare it against your list.
How to check your answer
Three quick sanity checks catch most errors. First, the deviations in your table must sum to zero (allowing for tiny rounding). If they do not, your mean is wrong, and everything after it is too.
Second, compare your two answers: the sample standard deviation must be larger than the population standard deviation for the same data, because you divided by a smaller number. If yours came out equal or reversed, the divisors got swapped.
Third, check the scale. Standard deviation can never be negative, is zero only when every value is identical, and can never exceed the range of your data (the max minus the min). For most bell-shaped data, roughly two-thirds of the values fall within one standard deviation of the mean — if your data spans 2 to 9 and you got a standard deviation of 40, something went wrong. Re-enter the data in the calculator above and compare its step table against yours line by line to find where the numbers diverge.
Related free tools
Frequently Asked Questions
Why divide by n − 1 instead of n?
Because a sample's values are measured against the sample's own mean, not the true population mean, their squared deviations come out systematically a little small. Dividing by n − 1 (Bessel's correction) inflates the result just enough to make the sample variance an unbiased estimate of the population variance. When you truly have the whole population, no correction is needed and you divide by n.
What is the difference between standard deviation and variance?
Variance is the average of the squared deviations; standard deviation is its square root. They carry the same information, but variance is in squared units (cm², points²) while standard deviation is in the original units, which makes it easier to interpret. This calculator reports both, from the same worked steps.
Can standard deviation be negative or zero?
It can never be negative — it is the square root of a sum of squares, so it is zero or positive. It equals zero exactly when every value in the data set is identical, meaning there is no spread at all. If your hand calculation produced a negative number, a squaring step was skipped or a sign error crept in.
Which one does my homework want, sample or population?
Look at how the data is described. "A sample of 30 students," "randomly selected," or "surveyed" means sample (divide by n − 1). "All employees at the company" or "every game this season" means population (divide by n). If the problem gives no signal, sample standard deviation is the safer default in a statistics course — but show your divisor so the grader can see your reasoning.
Why does my TI-84 or Excel give a different answer than my hand calculation?
Almost always it is the divisor. A TI-84 reports both Sx (sample) and σx (population) on the same 1-Var Stats screen; Excel's STDEV.S uses n − 1 while STDEV.P uses n. Check which one you read off. If the answers differ only in the last decimal places, the cause is rounding the mean too early in the hand calculation — keep full precision until the final step.
How many decimal places should I round to?
A common convention is to report one more decimal place than the raw data has, so data measured in whole numbers gets a standard deviation like 2.1. Follow your course's stated rule if it has one, and either way, round only the final answer — never the mean or the intermediate squared deviations, because those rounding errors compound through the remaining steps.
