How to Calculate Standard Deviation: Step-by-Step Formula with Examples
What Is Standard Deviation?
Standard deviation (SD) measures how spread out numbers are from their average (mean). A low standard deviation means the data points cluster tightly around the mean. A high standard deviation means they're spread widely.
Think of it this way: if the average test score in a class is 75, a standard deviation of 5 means most students scored between 70-80 (tight cluster). A standard deviation of 15 means scores ranged from 60-90 (wide spread).
The Standard Deviation Formula
There are two versions depending on whether you're analyzing an entire population or a sample:
Population Standard Deviation (ฯ)
ฯ = โ[ฮฃ(xแตข โ ฮผ)ยฒ / N]
Where: xแตข = each data point, ฮผ = population mean, N = total number of data points.
Use this when you have data for the entire group (e.g., all students in a class, all products in inventory).
Sample Standard Deviation (s)
s = โ[ฮฃ(xแตข โ xฬ)ยฒ / (n โ 1)]
Where: xแตข = each data point, xฬ = sample mean, n = sample size.
Use this when you have data from a subset of the group (e.g., surveying 100 of 10,000 customers). The (n โ 1) denominator (called Bessel's correction) corrects for the tendency of samples to underestimate population variability.
Step-by-Step Calculation Example
Calculate the sample standard deviation for this data set: 4, 8, 6, 5, 3, 7
Step 1: Find the Mean
xฬ = (4 + 8 + 6 + 5 + 3 + 7) / 6 = 33 / 6 = 5.5
Step 2: Find Each Deviation from the Mean
- 4 โ 5.5 = โ1.5
- 8 โ 5.5 = 2.5
- 6 โ 5.5 = 0.5
- 5 โ 5.5 = โ0.5
- 3 โ 5.5 = โ2.5
- 7 โ 5.5 = 1.5
Step 3: Square Each Deviation
- (โ1.5)ยฒ = 2.25
- (2.5)ยฒ = 6.25
- (0.5)ยฒ = 0.25
- (โ0.5)ยฒ = 0.25
- (โ2.5)ยฒ = 6.25
- (1.5)ยฒ = 2.25
Step 4: Sum the Squared Deviations
ฮฃ = 2.25 + 6.25 + 0.25 + 0.25 + 6.25 + 2.25 = 17.5
Step 5: Divide by (n โ 1)
Variance (sยฒ) = 17.5 / (6 โ 1) = 17.5 / 5 = 3.5
Step 6: Take the Square Root
s = โ3.5 = 1.87
The sample standard deviation is 1.87. This means on average, each data point deviates about 1.87 units from the mean of 5.5.
The Empirical Rule (68-95-99.7)
For normally distributed data, the standard deviation predicts what percentage of data falls within certain ranges:
- 68% of data falls within ยฑ1 standard deviation of the mean
- 95% of data falls within ยฑ2 standard deviations
- 99.7% of data falls within ยฑ3 standard deviations
Example: If the average adult height is 5'9" with SD of 3 inches:
- 68% of adults are between 5'6" and 6'0"
- 95% are between 5'3" and 6'3"
- 99.7% are between 5'0" and 6'6"
Variance vs. Standard Deviation
Variance (ฯยฒ or sยฒ) is the average of squared deviations โ it's step 5 above (3.5 in our example). Standard deviation is simply the square root of variance.
Why not just use variance? Because variance is in squared units (if your data is in dollars, variance is in "dollars squared" โ not meaningful). Standard deviation converts back to the original units, making it interpretable.
Real-World Applications
Finance: Standard deviation measures investment volatility. A stock with SD of 30% is much riskier than one with SD of 10%. Higher SD = higher potential returns but also higher potential losses.
Quality control: Manufacturing uses ยฑ3 standard deviations as tolerance limits. Products outside 3ฯ are defective (Six Sigma methodology aims for 3.4 defects per million).
Test scores: SAT scores are designed with a mean of ~1050 and SD of ~200. A score of 1250 is exactly 1ฯ above the mean โ better than ~84% of test-takers.
Science: Experimental results are "statistically significant" when they fall 2+ standard deviations from the null hypothesis (p < 0.05).
Calculate Standard Deviation
Use our free Standard Deviation Calculator to compute population and sample SD instantly for any data set. Explore related tools: Mean, Median, Mode Calculator for central tendency, or our Probability Calculator for distribution analysis.
Frequently Asked Questions
When should I use population vs. sample standard deviation?
Use population SD (ฯ, divide by N) when your data represents the entire group. Use sample SD (s, divide by nโ1) when your data is a subset of a larger group โ which is the case in most real-world analyses.
What does a standard deviation of 0 mean?
A standard deviation of 0 means all values in the dataset are identical โ there is zero variation. Every data point equals the mean.
Can standard deviation be negative?
No. Standard deviation is always zero or positive because squared deviations are always positive, and the square root of a positive number is positive.
What is a "high" vs. "low" standard deviation?
It depends on context. A standard deviation should be compared relative to the mean (this ratio is called the coefficient of variation). SD of 10 is high if the mean is 20 (50% variation) but low if the mean is 1,000 (1% variation).
What is the relationship between standard deviation and standard error?
Standard error (SE) = Standard deviation / โn. SE measures the precision of a sample mean as an estimate of the population mean. It decreases as sample size increases โ larger samples give more precise estimates.