Standard deviation measures how spread out data points are from the mean — the single most important number for understanding data variability.
See it
- Left: Small SD — data points cluster tightly around the mean
- Right: Large SD — data points are spread out over a wide range
- The SD quantifies the average distance of each data point from the mean
Play with it
Adjust data values and see how standard deviation changes in real time.
Standard deviation explorer
Add, remove, or change data points and watch the standard deviation update.
When to use this
Use when
- Understanding how spread out your data is
- Comparing variability between two datasets
- Building confidence intervals and hypothesis tests
Avoid when
- Data is heavily skewed (use IQR instead)
- You only need the range (quick overview)
- Data has many outliers (use median absolute deviation)
What it answers
Standard deviation is the most widely used measure of variability in statistics. While the mean tells you where the center of your data is, standard deviation tells you how far individual data points typically fall from that center. Together, mean and standard deviation give you a complete picture of your data's distribution — the mean tells you the "address" and the standard deviation tells you the "neighborhood."
The core question standard deviation answers is: "How spread out are my data points around the average?" This matters because two datasets can have identical means but very different spreads:
- Class A exam scores: 78, 79, 80, 81, 82 — mean = 80, SD = 1.58. Students performed very similarly.
- Class B exam scores: 55, 65, 80, 95, 105 — mean = 80, SD = 19.36. Students performed very differently.
Both classes have the same average score, but Class B has much greater variability. If you were a teacher, this tells you something fundamentally different about each class: Class A is consistent, Class B has a wide range of abilities. The standard deviation captures this distinction numerically.
Why standard deviation matters: Standard deviation is not just an abstract number — it has direct practical implications across many fields:
- Finance: Standard deviation of stock returns measures investment risk. A stock with SD = 30% is much riskier than one with SD = 10%. Modern portfolio theory, developed by Harry Markowitz, uses standard deviation as the core measure of portfolio risk.
- Manufacturing: A factory producing bolts needs low standard deviation in bolt lengths. High SD means many bolts are too long or too short, leading to defects and customer complaints.
- Medicine: Drug effectiveness measured across patients needs to be consistent. A drug with low SD in response means most patients get a similar benefit; high SD means some benefit greatly while others don't respond at all.
- Education: Standard deviation of test scores helps teachers identify whether a class needs differentiated instruction (high SD) or can be taught uniformly (low SD).
- Quality control: Six Sigma methodology aims to reduce process standard deviation so that 99.99966% of products fall within specification limits.
Standard deviation vs. other measures of spread: While standard deviation is the most common, it is not always the best choice. The range (max - min) is simple but ignores all data between the extremes and is highly sensitive to outliers. The interquartile range (IQR) measures the spread of the middle 50% of data and is robust to outliers. The mean absolute deviation (MAD) is the average of absolute deviations from the mean and is more intuitive than standard deviation but less commonly used in inferential statistics. For most applications, standard deviation is preferred because of its mathematical properties (it is differentiable, additive for independent variables, and central to the normal distribution).
The normal distribution connection: Standard deviation is particularly meaningful for data that follows a normal (bell-shaped) distribution. In a normal distribution, approximately 68% of data falls within 1 SD of the mean, 95% within 2 SD, and 99.7% within 3 SD. This is called the Empirical Rule or the 68-95-99.7 rule. It allows you to quickly assess how unusual any particular data point is. For example, if adult male heights have mean = 175 cm and SD = 7 cm, then about 68% of men are between 168-182 cm, and a man who is 196 cm tall (3 SD above the mean) is in the top 0.15% — unusually tall.
The formula
There are two formulas depending on whether you are working with a population (the entire group of interest) or a sample (a subset of the group). The key difference is the denominator: N for population, n-1 for sample.
Population: σ = √[ Σ(xi − μ)² / N ]
Where μ is the population mean, xi are individual values, and N is the population size.
Sample: s = √[ Σ(xi − x̄)² / (n − 1) ]
Where x̄ is the sample mean, xi are individual values, and n is the sample size. The n-1 is Bessel's correction.
Variance is simply the standard deviation squared (or vice versa, SD = √variance). Variance has useful mathematical properties — variances of independent random variables add together — but its units are squared (e.g., cm² instead of cm), making it harder to interpret directly. That is why standard deviation, which has the same units as the original data, is preferred for reporting.
Step-by-step calculation: Let us compute the standard deviation for the dataset: 4, 8, 6, 5, 3.
- Step 1 — Calculate the mean: x̄ = (4 + 8 + 6 + 5 + 3) / 5 = 26 / 5 = 5.2
- Step 2 — Calculate each deviation from the mean: (4-5.2) = -1.2, (8-5.2) = 2.8, (6-5.2) = 0.8, (5-5.2) = -0.2, (3-5.2) = -2.2
- Step 3 — Square each deviation: (-1.2)² = 1.44, (2.8)² = 7.84, (0.8)² = 0.64, (-0.2)² = 0.04, (-2.2)² = 4.84
- Step 4 — Sum the squared deviations: 1.44 + 7.84 + 0.64 + 0.04 + 4.84 = 14.8
- Step 5a (Population): Divide by N = 5: σ² = 14.8 / 5 = 2.96, so σ = √2.96 = 1.72
- Step 5b (Sample): Divide by n-1 = 4: s² = 14.8 / 4 = 3.70, so s = √3.70 = 1.92
The sample standard deviation (1.92) is slightly larger than the population standard deviation (1.72) because dividing by n-1 instead of n inflates the estimate. This is intentional — it corrects for the tendency of samples to underestimate population variability.
Why Bessel's correction (n-1) works: When you compute deviations from the sample mean (x̄) rather than the true population mean (μ), the squared deviations are systematically too small because the sample mean is chosen to minimize the sum of squared deviations for that particular sample. Dividing by n-1 instead of n compensates for this bias, giving an unbiased estimate of the population variance. The intuition is that you "lose" one degree of freedom because you estimated the mean from the data itself.
Shortcut formula: There is an algebraically equivalent formula that is sometimes easier for hand calculation:
s² = [Σxi² − (Σxi)²/n] / (n − 1)
This avoids computing the mean first and can be faster for manual calculations with large datasets.
Standard error vs. standard deviation: These two concepts are related but fundamentally different. Standard deviation describes the spread of individual data points. Standard error (SE = s / √n) describes the precision of the sample mean as an estimate of the population mean. As sample size increases, the standard error decreases (the mean becomes more precise), but the standard deviation stays roughly the same (the data's spread doesn't change). Confusing these two is one of the most common statistical errors. Use SD to describe your data; use SE to construct confidence intervals for the mean.
Reading the result
Interpreting standard deviation depends on context — the same numerical SD can be large in one setting and small in another. Here is how to think about it:
- Relative to the mean (coefficient of variation): CV = (SD / mean) × 100%. A CV of 5% means the SD is 5% of the mean — quite precise. A CV of 50% means the SD is half the mean — very spread out. This allows comparison of variability across datasets with different units or scales.
- Empirical Rule (for normal distributions): If data is roughly normal, 68% of values fall within μ ± 1σ, 95% within μ ± 2σ, and 99.7% within μ ± 3σ. This is the most practical way to interpret SD for bell-shaped data.
- Rule of thumb benchmarks: For many real-world measurements, an SD that is less than about one-third of the range suggests moderate spread; more than half the range suggests high spread. However, these are rough guidelines, not formal rules.
Practical interpretation examples:
- Heights of adult men: Mean = 175 cm, SD = 7 cm. About 68% of men are between 168-182 cm. A man who is 190 cm is about 2.1 standard deviations above average — notably tall but not extreme.
- Test scores: Mean = 72, SD = 12. A student scoring 84 is exactly 1 SD above the mean. In a normal distribution, this puts them in the 84th percentile — better than about 84% of students.
- Daily stock returns: Mean = 0.05%, SD = 1.2%. On a typical day, the stock moves up or down about 1.2%. A 3% move (2.5 SD) would be unusually large and might make headlines.
- Manufacturing tolerance: Bolt length target = 50.0 mm, SD = 0.1 mm. If specifications require 49.7-50.3 mm (within 3 SD), about 99.7% of bolts will pass. If the process degrades to SD = 0.15 mm, only 95% will pass — a significant quality problem.
When standard deviation can be misleading:
- Skewed data: For highly skewed distributions (e.g., income data), SD is inflated by extreme values and may not represent typical spread. The IQR (interquartile range) is more robust.
- Outliers: A single extreme value can dramatically increase SD. If one person in a group of 20 earns $10 million while others earn $50K, the SD will be enormous despite everyone else being similar.
- Bimodal distributions: If data has two distinct peaks (e.g., heights of men and women combined), the SD might be large even though data clusters tightly around each peak. Always look at the distribution shape, not just the SD.
- Non-normal data: The Empirical Rule (68-95-99.7) only applies to normal distributions. For heavily skewed or heavy-tailed distributions, the percentage of data within 1, 2, or 3 SD of the mean may differ substantially.
Effect size measures based on standard deviation: SD is the foundation for many effect size measures used in hypothesis testing:
- Cohen's d: (Mean₁ − Mean₂) / pooled SD. A d of 0.2 is small, 0.5 is medium, 0.8 is large. Used in t-tests and ANOVA.
- Coefficient of variation: SD / mean. Useful for comparing variability across different scales (e.g., comparing weight variability in kg vs. g).
- Z-score: (x − mean) / SD. Tells you how many standard deviations a value is from the mean. A z-score of 2.0 means the value is 2 SD above average.
Population vs. sample
One of the most important distinctions in statistics is whether you are working with a population (the entire group you care about) or a sample (a subset you actually measured). This distinction affects which standard deviation formula you use and why.
Population standard deviation (σ):
- Used when you have data for every member of the group of interest
- Formula: σ = √[ Σ(xi − μ)² / N ]
- Divides by N (the total population size)
- Gives the exact, true spread of the entire population
- Examples: average height of all 330 million Americans (if you actually measured everyone); the exact batting average of every player in a specific season
Sample standard deviation (s):
- Used when you have data from only a subset of the population (which is almost always the case in practice)
- Formula: s = √[ Σ(xi − x̄)² / (n − 1) ]
- Divides by n-1 instead of n (Bessel's correction)
- Provides an unbiased estimate of the population standard deviation
- Examples: height of 500 randomly selected Americans (to estimate the national average); test scores from 30 students in one class (to estimate all students' performance)
Why the n-1 correction? When you use a sample, two things happen that bias the calculation downward:
- You calculate deviations from the sample mean (x̄), not the true population mean (μ). The sample mean is always closer to the sample data points than the population mean is, making the squared deviations systematically too small.
- A sample of n values only provides n-1 independent pieces of information about variability. The nth value is determined once you know the mean and the other n-1 values. This is the "degrees of freedom" concept.
Dividing by n-1 instead of n inflates the result just enough to compensate for this underestimation, giving an unbiased estimate. The correction matters most for small samples; for large samples (n > 30), the difference between dividing by n and n-1 becomes negligible.
When to use which:
- In virtually all practical situations, you should use the sample standard deviation formula (divide by n-1). This is because you almost never have data for the entire population — you are always working with samples.
- The only time to use population SD is when you genuinely have the complete dataset for the group of interest (e.g., you are a government agency analyzing census data for all citizens, or you are analyzing every product from a small production run).
- Most calculators, Excel (STDEV.S vs. STDEV.P), R (sd()), and Python (numpy.std with ddof=1) default to the sample formula. Be explicit about which you are using when writing code or reporting results.
Common misconception: Some people believe that "population" and "sample" refer to the size of the dataset — that large datasets are "populations" and small ones are "samples." This is wrong. The distinction is about scope: a population is the complete set of individuals you want to draw conclusions about, while a sample is the subset you actually observe. You can have a small population (all 50 US states) or a large sample (1 million survey respondents). Always use the population formula only when you truly have data for the entire population of interest.
Try it yourself
Here's a quick example with sample data:
Sample Example
Five students scored: 72, 78, 80, 85, 95. What is the standard deviation?
Key Insight
Mean = 82, SD = 8.37. The scores are moderately spread, with the highest score (95) being about 1.6 standard deviations above the mean.