Standard Deviation Calculator
Calculate standard deviation and variance for population or sample data.
Quick Examples
Standard Deviation Formula
Standard deviation measures how spread out the data is from the mean.
Population Standard Deviation
Sample Standard Deviation
Use sample standard deviation when working with a sample from a larger population. Use population standard deviation when you have data for the entire population.
What Is Standard Deviation?
Standard deviation tells you how spread out a set of numbers is around their average. A small standard deviation means the values cluster tightly near the mean; a large one means they are scattered widely. Imagine two classes that both average 75%: in one, every student scores between 72 and 78; in the other, scores range from 40 to 100. Same average, completely different stories — and the standard deviation captures that difference. It is the most widely used measure of spread because it is expressed in the same units as the data itself: measure heights in centimeters and the standard deviation comes out in centimeters too, which makes it directly interpretable in a way its squared cousin, variance, is not.
Variance and the Range Rule of Thumb
Variance is simply the square of the standard deviation: σ² for a population, s² for a sample. It is the average squared distance of each value from the mean. A handy shortcut is the range rule of thumb: for roughly bell-shaped data, the standard deviation is about one quarter of the range (maximum minus minimum). If test scores run from 60 to 100, expect a standard deviation near 10. It is only an estimate, but it makes a fast sanity check for whatever a calculator tells you.
Step-by-Step Calculation
Step 1: Find the mean: add all the values and divide by how many there are.
Step 2: For each value, subtract the mean to get its deviation. Some deviations will be negative — that is expected.
Step 3: Square every deviation. This turns negatives positive and gives extra weight to values far from the mean.
Step 4: Add up all the squared deviations.
Step 5: Divide: by N for a whole population, or by n−1 for a sample. The n−1 correction (Bessel’s correction) removes the bias that comes from estimating the mean from the sample itself.
Step 6: Take the square root. That root is the standard deviation.
Worked Examples
Example 1: Population standard deviation
Data: 2, 4, 4, 4, 5, 5, 7, 9. The mean is 40/8 = 5. Squared deviations: (2−5)²=9, (4−5)²=1, 1, 1, (5−5)²=0, 0, (7−5)²=4, (9−5)²=16. Sum = 32. Variance = 32/8 = 4, so σ = √4 = 2.
Example 2: Same data as a sample
Divide the same sum of 32 by n−1 = 7 instead: variance = 32/7 ≈ 4.571, so s = √4.571 ≈ 2.138. Notice the sample value is a little larger — the n−1 correction compensates for the smaller dataset, and the gap shrinks as samples grow.
Example 3: A tiny dataset
Data: 10, 12, 14. Mean = 12. Squared deviations: 4, 0, 4; sum = 8. As a population: variance = 8/3 ≈ 2.667, so σ ≈ 1.633. As a sample: variance = 8/2 = 4, so s = 2. With only three values the choice of formula matters a lot.
Common Mistakes
- Wrong formula for the data type: using the population formula on sample data (or vice versa) is the most common error. Ask first: is this everyone, or just a subset?
- Forgetting the final square root: the sum of squared deviations divided by N is the variance, not the standard deviation.
- Squaring before subtracting: you must subtract the mean first and then square. Squaring the raw values first produces nonsense.
- Mixing up units: variance is in squared units (cm²), standard deviation in the original units (cm). Report the one your audience expects.
Frequently Asked Questions
Can standard deviation be negative? No — it is the square root of a sum of squares, so it is always zero or positive. A value of zero means every data point is identical.
When do I divide by n−1 instead of n? Divide by n−1 when your data is a sample from a larger population; use n when you have measured every member of the group.
What counts as a “good” standard deviation? There is no universal answer — compare it with the mean. A standard deviation of 2 is negligible next to a mean of 1000 but huge next to a mean of 5.
How does one outlier affect the result? Strongly. Because deviations are squared, a single far-off value inflates the standard deviation more than several small wobbles combined.
The Empirical Rule: 68–95–99.7
For roughly bell-shaped (normal) data, the standard deviation carves the distribution into predictable slices:
- About 68% of values fall within ±1 standard deviation of the mean.
- About 95% fall within ±2 standard deviations.
- About 99.7% fall within ±3 standard deviations.
Example: IQ-style scores (mean 100, SD 15) put about 68% of people between 85 and 115, and about 95% between 70 and 130. A value more than 3 SD from the mean is a genuine rarity — worth double-checking rather than accepting at face value.
A Shortcut Formula
Squaring every deviation is tedious by hand. An equivalent formula works from two running totals — the sum of the values and the sum of their squares:
For data 10, 12, 14: Σx = 36 and Σx² = 100 + 144 + 196 = 440. Sample variance = (440 − 36²/3) / 2 = (440 − 432)/2 = 4, so s = √4 = 2 — matching the long method exactly, with far less arithmetic. (Divide by n instead of n−1 for the population version.)
Where Standard Deviation Is Used
- Finance: the volatility of an investment is its return's standard deviation — higher SD, riskier ride.
- Manufacturing: a process with a small SD produces consistent parts; a large SD means the line needs attention.
- Science: error bars on a graph are usually ±1 SD (or standard error), showing how repeatable a measurement is.
- Testing: standardized exams are scaled so scores have a fixed mean and SD, making different years comparable.
Standard Deviation vs Variance vs Range
| Measure | What it is | Units |
|---|---|---|
| Range | Max − min; the crudest spread | Original |
| Variance | Average squared deviation | Squared |
| Standard deviation | √variance; typical distance from the mean | Original |