STATISTICS GUIDE
Standard deviation formula: sample vs population
Standard deviation is the typical distance of values from their mean. Sample: s = √(Σ(x − x̄)² ÷ (n − 1)). Population: σ = √(Σ(x − μ)² ÷ n). Use the sample formula unless you measured every member of the group.Explore research statistics & data analysis →FORMULA OR CORE IDEA
Population: σ = √(Σ(x − μ)² ÷ n); Sample: s = √(Σ(x − x̄)² ÷ (n − 1))WORKED EXAMPLE
For the scores 58, 64, 72, 72, 78, 84, 91: the mean is 519 ÷ 7 = 74.14. The squared deviations add up to 768.86. Sample variance = 768.86 ÷ 6 = 128.14, so the sample standard deviation is √128.14 = 11.32. If these seven scores were the whole population, variance = 768.86 ÷ 7 = 109.84 and σ = 10.48.QUICK REFERENCE
Worked example: deviations from the mean (x̄ = 74.14)
Each row shows a score, how far it is from the mean, and that distance squared. The squared deviations sum to 768.86.| Score (x) | Deviation (x − x̄) | Squared deviation (x − x̄)² |
|---|---|---|
| 58 | −16.14 | 260.59 |
| 64 | −10.14 | 102.88 |
| 72 | −2.14 | 4.59 |
| 72 | −2.14 | 4.59 |
| 78 | 3.86 | 14.88 |
| 84 | 9.86 | 97.16 |
| 91 | 16.86 | 284.16 |
STEP BY STEP
Find the mean
Add all the values and divide by how many there are. For the example scores, 519 ÷ 7 = 74.14. Use μ for a population mean and x̄ for a sample mean.
Subtract the mean from each value
Each result (x − x̄) is a deviation: how far that value sits above or below the mean. The deviations always add up to zero, which is why they are squared next.
Square each deviation and add them up
Squaring removes the negative signs and gives extra weight to values far from the mean. The total, Σ(x − x̄)², is the sum of squares. In the example it is 768.86.
Divide to get the variance
Divide the sum of squares by n − 1 for a sample (768.86 ÷ 6 = 128.14) or by n for a whole population (768.86 ÷ 7 = 109.84). This is the variance, measured in squared units.
Take the square root
The square root of the variance is the standard deviation, back in the original units: s = √128.14 = 11.32 for a sample, σ = √109.84 = 10.48 for a population.
Check the result makes sense
The SD can never be negative and is zero only when every value is identical. A quick sense check: most values should lie within about two SDs of the mean (here 74.14 ± 22.64, or 51.5 to 96.8).
COMMON QUESTIONS
Frequently asked questions
What is the standard deviation formula?
For a sample: s = √( Σ(x − x̄)² ÷ (n − 1) ). For a whole population: σ = √( Σ(x − μ)² ÷ n ). In both, you subtract the mean from each value, square the results, add them up, divide, and take the square root. The only difference is dividing by n − 1 (sample) or n (population).
What do σ, s, μ, x̄, Σ and n mean?
σ (sigma) is the population standard deviation and s is the sample standard deviation. μ (mu) is the population mean and x̄ (x-bar) is the sample mean. Σ means "add up" every value that follows, x is each individual value, and n is the number of values.
What is the difference between variance and standard deviation?
Variance is the average squared deviation from the mean; standard deviation is its square root. Variance is in squared units (points², cm²), so standard deviation is easier to interpret because it is in the same units as the data. In the example, the sample variance is 128.14 and the sample SD is 11.32.
What are common mistakes when calculating standard deviation?
The most common are: dividing by n when the data are a sample (use n − 1); forgetting to square the deviations, so they cancel to zero; reporting the variance instead of its square root; rounding the mean too early, which makes the final SD drift; and using the mean and SD for strongly skewed data, where the median and IQR describe the data better.
Should I use the sample or population standard deviation?
Use the sample standard deviation (divide by n − 1) when your data are a sample used to describe a larger group, which is almost always the case in a thesis or survey. Use the population formula (divide by n) only when you have measured every member of the group you care about, such as every student in one class.
Why do we divide by n − 1 for a sample?
A sample's values sit closer to their own mean than to the true population mean, so dividing by n would underestimate the spread. Dividing by n − 1 (Bessel's correction) removes that bias in the variance.
What is a good or high standard deviation?
There is no universal cut-off; it depends on the scale. Compare the SD with the mean and the possible range: on a 1–5 Likert scale an SD near 1 is fairly spread out, while for exam scores out of 100 an SD of 10–15 is typical. The coefficient of variation (SD ÷ mean) helps compare spread across different scales.
What does standard deviation tell you?
It is the typical distance of values from the mean, in the same units as the data. For roughly normal data, about 68% of values fall within 1 SD of the mean and about 95% within 2 SD.
What is the difference between standard deviation and standard error?
Standard deviation describes the spread of individual values. Standard error (SE = SD ÷ √n) describes how precisely the sample mean estimates the population mean. In the example above, SE = 11.32 ÷ √7 = 4.28.
How do I report mean and standard deviation in APA style?
Write the mean and SD to two decimal places in the text, for example: "Participants scored M = 74.14, SD = 11.32 on the final exam," or use a table with M and SD columns. Italicise M and SD.
BEYOND RAW SCORES
Standard deviation formulas for frequency tables, grouped data, Excel and SPSS
Standard deviation formula for a frequency table
s = √( Σf(x − x̄)² ÷ (N − 1) ), x̄ = Σfx ÷ NUse this when your data come as values with counts, such as the number of respondents who chose each Likert option. Multiply each squared deviation by its frequency f before adding.
- Responses 1–5 with frequencies 2, 3, 8, 5, 2 (N = 20).
- Mean: Σfx = 62, so x̄ = 62 ÷ 20 = 3.10.
- Sum of squares: Σf(x − x̄)² = 23.80.
- Sample SD: s = √(23.80 ÷ 19) = 1.12. Population SD: σ = √(23.80 ÷ 20) = 1.09.
Standard deviation formula for grouped data (class intervals)
s = √( Σf(m − x̄)² ÷ (N − 1) ), m = class midpointWhen you only have class intervals (10–19, 20–29, …), replace each value with its class midpoint m. The answer is an estimate, because the real values inside each class are unknown.
- Classes 10–19, 20–29, 30–39, 40–49 with f = 4, 7, 6, 3 (N = 20); midpoints 14.5, 24.5, 34.5, 44.5.
- Mean: x̄ = Σfm ÷ N = 570 ÷ 20 = 28.5.
- Σf(m − x̄)² = 1,880.
- s = √(1,880 ÷ 19) = 9.95 (sample); σ = √(1,880 ÷ 20) = 9.70 (population).
Shortcut (computational) formula
s = √( [Σx² − (Σx)² ÷ n] ÷ (n − 1) )This gives the same answer without listing every deviation, which is why textbooks and calculators use it. For 58, 64, 72, 72, 78, 84, 91: Σx = 519 and Σx² = 39,249, so s = √((39,249 − 519² ÷ 7) ÷ 6) = 11.32, matching the worked example above.
Standard deviation in Excel, Google Sheets, SPSS and on a calculator
- Excel and Google Sheets, sample SD: =STDEV.S(A2:A51). Population SD: =STDEV.P(A2:A51). The older =STDEV() is the sample version.
- SPSS: Analyze → Descriptive Statistics → Descriptives (or Frequencies). SPSS always reports the sample SD, dividing by n − 1.
- Casio and TI calculators: sx or Sx is the sample SD; σx is the population SD.
- SolveGrid: the Standard Deviation Calculator shows both, for raw, frequency-table or grouped data, with each step.
Copy-and-paste versions of the formula
- Sample: s = √( Σ(x − x̄)² / (n − 1) )
- Population: σ = √( Σ(x − μ)² / N )
- Plain text for Word or email: s = sqrt( sum((x - mean)^2) / (n - 1) )