
If you’ve ever stared at a spreadsheet and wondered what those numbers actually tell you, standard deviation is probably the statistic you’re after. It answers the question: “How spread out is this data, really?” Whether you’re grading papers, tracking investment returns, or just trying to understand a dataset your manager dumped on you, knowing how to calculate standard deviation by hand, in Excel, or with Python gives you a real edge. One popular example — the dataset {5, 5, 9, 9, 9, 10, 5, 10, 10} — has a mean of 7.78 and yields a standard deviation of approximately 2.60, a number that immediately tells you how much the values jump around the average.
Population formula: √[Σ(xi – μ)² / N] · Sample formula: √[Σ(xi – x̄)² / (n-1)] · 3 SD rule: 99.7% of data falls within three standard deviations of the mean
Quick snapshot
- Sample standard deviation uses n-1 in the denominator (Khan Academy)
- Excel’s STDEV.S calculates sample SD; STDEV.P calculates population SD (Microsoft Support)
- The n-1 divisor (Bessel’s correction) was introduced in the 1810s for unbiased population estimates (Wikipedia)
- Precise attribution of the modern standard deviation formula to a single individual remains debated among historians of statistics
- The Karl Pearson formalization date varies slightly depending on which of his publications serves as the reference point
- 1810s: Bessel’s correction introduced (Wikipedia)
- Late 19th century: Karl Pearson formalizes the term (Scribbr)
- 2007: Excel distinguishes STDEV.S from STDEV.P (Microsoft Support)
- Python’s numpy.std() handles both population and sample SD via the ddof parameter
- Online calculators increasingly offer grouped data SD calculations, expanding accessibility
The table below consolidates the core definitions and values used throughout this guide.
| Label | Value |
|---|---|
| Definition | Square root of variance |
| Measures | Data dispersion from the mean |
| Population divisor | N (total data points) |
| Sample divisor | n-1 (degrees of freedom) |
| 3 SD rule | 99.7% of data within three standard deviations |
| Variance | Standard deviation squared |
How do I calculate standard deviation?
Calculating standard deviation follows a clear six-step sequence that works for any dataset. Khan Academy confirms the process works identically whether you’re calculating by hand or using software — the math doesn’t change (Khan Academy).
Step-by-step by hand
The NIH recommends starting by organizing your data and calculating the mean first — this single number becomes your reference point for every subsequent calculation (NIH).
- Calculate the mean (sum all values, divide by count)
- Find each deviation (subtract the mean from every data point)
- Square every deviation (eliminates negative values)
- Sum the squared deviations
- Divide by n-1 (for sample) or N (for population)
- Take the square root
For the dataset {2, 8, 10, 13, 17, 17, 19, 21, 23, 30}, this process yields a sample standard deviation of approximately 8.069 (Outlier.org).
Population vs sample
The critical difference between population and sample standard deviation lies in the divisor. Population standard deviation divides by N (the total number of data points), while sample standard deviation divides by n-1 (degrees of freedom). Outlier.org explains that sample standard deviation uses n-1 to provide an unbiased estimate of the population standard deviation — without this adjustment, you’d consistently underestimate variability (Outlier.org).
As MathsIsFun notes: “But hang on … we are calculating the Sample Standard Deviation, so instead of dividing by how many (N), we’ll divide by N−1” (MathsIsFun).
If you’re analyzing a sample (most real-world scenarios), use n-1. If you literally have every member of a population, use N. Mixing them up produces systematically wrong results.
The implication: picking the wrong divisor systematically skews your variability estimate in one direction — always verify whether your data represents a full population or a sample first.
What is the best formula for standard deviation?
The “best” formula depends entirely on what you’re measuring. Population standard deviation (σ = √[Σ(xi-μ)² / N]) applies when your dataset represents the entire group you care about. Sample standard deviation (s = √[Σ(xi-x̄)² / (n-1)]) applies when you’re working with a subset and want to estimate the larger population (Macabacus).
Population formula
The population formula uses the Greek letter sigma (σ) and divides by N. This gives you the true spread of your complete dataset. Macabacus provides the formal definition: sqrt(sum((x-mean)^2)/N) (Macabacus).
Sample formula
The sample formula divides by n-1 instead of N. This adjustment — called Bessel’s correction — corrects the underestimation that occurs when using a sample to estimate population variability. Wikipedia traces this correction to the 1810s (Wikipedia).
Vs variance
Variance is simply the standard deviation squared. MathsIsFun defines it as “the average of the squared differences from the mean” (MathsIsFun). Standard deviation is often preferred in practice because it’s expressed in the same units as your original data — variance gives you squared units, which can be harder to interpret.
When reporting results, standard deviation tells you “values typically differ from the mean by X.” Variance tells you the average squared difference — less intuitive but essential in statistical formulas and hypothesis testing.
The catch: variance is mathematically convenient for formulas, but standard deviation stays in your data’s native units — always report SD alongside variance for clarity.
How to calculate standard deviation on Excel?
Excel offers three main functions for standard deviation, and picking the right one matters. Ablebits confirms the distinction clearly: STDEV.P handles population data while STDEV.S handles samples (Ablebits).
STDEV.S function
For sample data, type =STDEV.S(range) into any cell. This uses n-1 in the denominator, giving you an unbiased estimate. UConn demonstrates this via the Insert Function tool, making it accessible for beginners (UConn).
From mean
If you already know your mean and want to calculate the standard deviation, Excel’s advanced users can build the formula manually: =SQRT(SUMSQ(range-mean)/8) for a sample of 9 data points. However, STDEV.S handles all this internally and produces the same result with less room for error.
For test scores {85, 76, 92, 88, 69}, the STDEV.S function returns approximately 9.65 — indicating typical score deviations of about 9.65 points from the mean (Macabacus).
Microsoft Support documents that the STDEV.S/STDEV.P distinction became available in Excel 2007 — earlier versions had only the combined STDEV function that defaulted to the sample calculation. If you’re working in an older spreadsheet, upgrade or account for this limitation.
What this means: older Excel files may silently use sample SD even when you intended population SD — audit your function choice before trusting legacy spreadsheets.
How to calculate standard deviation by hand?
Calculating by hand — while slower than using software — builds genuine intuition about what standard deviation actually measures. Scribbr argues this approach deepens understanding in ways that clicking through spreadsheet functions simply cannot (Scribbr).
Example with {5, 5, 9, 9, 9, 10, 5, 10, 10}
Step 1 — Mean: (5+5+9+9+9+10+5+10+10) ÷ 9 = 72 ÷ 9 = 8.00
Step 2 — Deviations: -3, -3, 1, 1, 1, 2, -3, 2, 2
Step 3 — Squared deviations: 9, 9, 1, 1, 1, 4, 9, 4, 4
Step 4 — Sum: 9+9+1+1+1+4+9+4+4 = 42
Step 5 — Divide (sample, n-1): 42 ÷ 8 = 5.25
Step 6 — Square root: √5.25 ≈ 2.29
This dataset’s standard deviation of 2.29 tells you that individual values typically fall about 2.29 points from the mean of 8.00. The relatively small SD compared to the mean indicates fairly tight clustering.
Other datasets
For the dataset {5, 3, 4, 7}, the process works identically:
Mean = (5+3+4+7) ÷ 4 = 4.75
Squared deviations = 7.5625 + 3.0625 + 0.5625 + 5.0625 = 16.25
Sample variance = 16.25 ÷ 3 = 5.4167
Sample SD = √5.4167 ≈ 2.33
For the dataset {2, 4, 4, 4, 5, 5, 7, 9}, following the same steps yields a sample standard deviation of approximately 2.05.
The pattern: students who master the manual process internalize what SD measures in a way that spreadsheet users often miss — this pays dividends when interpreting results rather than just generating numbers.
What is the standard deviation of 5 5 9 9 9 10 5 10 10?
This specific dataset appears frequently in search results, so here’s the complete breakdown. The nine values {5, 5, 9, 9, 9, 10, 5, 10, 10} sum to 72, giving a mean of exactly 8.00 — a clean number that makes the deviations particularly easy to follow.
Step-by-step solution
Deviations from mean (8.00):
- 5 − 8.00 = −3.00
- 5 − 8.00 = −3.00
- 9 − 8.00 = 1.00
- 9 − 8.00 = 1.00
- 9 − 8.00 = 1.00
- 10 − 8.00 = 2.00
- 5 − 8.00 = −3.00
- 10 − 8.00 = 2.00
- 10 − 8.00 = 2.00
Squared deviations: 9, 9, 1, 1, 1, 4, 9, 4, 4 → Sum = 42
Sample variance: 42 ÷ (9−1) = 42 ÷ 8 = 5.25
Sample standard deviation: √5.25 ≈ 2.29
Interpretation
A standard deviation of 2.29 against a mean of 8.00 means that roughly 68% of values fall between 5.71 and 10.29. The coefficient of variation (SD ÷ mean) equals 2.29 ÷ 8.00 = 28.6%, indicating moderate relative variability. In practical terms, this dataset clusters fairly tightly around its center — you wouldn’t expect many extreme values.
For researchers, this SD of 2.29 is useful for comparing against other similar datasets. For students, this dataset demonstrates all six calculation steps cleanly, with no awkward numbers to complicate the process.
If you divided by N instead of n-1, you’d get 42 ÷ 9 = 4.67 → √4.67 ≈ 2.16. That lower number looks better but underestimates true population variability. Always match your divisor to your goal: sample (n-1) for estimation, population (N) for complete census.
How to calculate standard deviation in Python?
Python’s standard approach uses NumPy, which provides straightforward functions for both population and sample calculations. The NumPy documentation specifies numpy.std(ddof=1) for sample standard deviation (NumPy Docs).
Here’s the basic Python code:
import numpy as np
data = [5, 5, 9, 9, 9, 10, 5, 10, 10]
# Sample standard deviation (ddof=1)
sample_sd = np.std(data, ddof=1)
print(f"Sample SD: {sample_sd:.2f}")
# Population standard deviation (ddof=0, default)
pop_sd = np.std(data, ddof=0)
print(f"Population SD: {pop_sd:.2f}")
This outputs approximately 2.29 for the sample SD and 2.16 for the population SD — exactly matching the hand calculations from earlier sections.
The ddof parameter (delta degrees of freedom) controls the divisor. Setting ddof=1 applies Bessel’s correction, dividing by n-1 instead of n. Setting ddof=0 uses the standard population formula.
“We use n-1 only when calculating a sample standard deviation in order to get a closer approximation of the population standard deviation.” — Outlier.org (Educational Resource)
“STDEV.S provides a slightly higher standard deviation, accounting for the uncertainty of not having data for the entire population.” — Macabacus (Excel Tutorial)
What’s confirmed
- Six-step calculation process verified by Khan Academy, NIH, and multiple educational sources
- Sample SD uses n-1 divisor confirmed by Outlier.org, Khan Academy, and Wikipedia
- Excel STDEV.S vs STDEV.P distinction documented by Microsoft Support and Ablebits
- Bessel’s correction (n-1) introduced in the 1810s per Wikipedia
What needs more context
- Exact year Karl Pearson formalized the term — sources cite “late 19th century” but no single publication date
- Application to grouped data requires additional formula adjustments not covered by basic hand calculations
Standard deviation is one of those tools that pays compound interest: the more you use it, the more patterns you see. For data analysts, it becomes a daily checkpoint. For students, it’s foundational for everything from psychology research to quality control. The formula’s universal nature — unchanged across regions and applications since Karl Pearson’s formalization — means that mastery transfers everywhere.
Related reading: 53 cm to Inches · Alberta Income Tax Calculator
This step-by-step process for standard deviation aligns closely with the Outback Watch tutorial, which quantifies data dispersion around the mean using similar examples.
Frequently asked questions
How to calculate standard deviation from mean?
Subtract the mean from each data point, square the result, sum all squared values, divide by n-1 (for samples) or N (for populations), then take the square root. For example, with mean 8.00 and data point 10, the deviation is 2.00, squared deviation is 4.00. Repeat for all points, sum, divide, and take the square root.
How to calculate standard deviation on Casio?
Casio scientific calculators typically have a STAT mode. Enter your data using the data entry keys (usually M+ or similar), then access the standard deviation function (σx for population, sx for sample). Consult your specific model’s manual for exact keystrokes, as the procedure varies between models.
How to calculate standard deviation in Python?
Use NumPy: import numpy as np, then sample_sd = np.std(data, ddof=1). The ddof=1 parameter applies Bessel’s correction (n-1 divisor) for sample standard deviation. For population standard deviation, use ddof=0 or omit the parameter.
How to calculate standard deviation of grouped data?
Grouped data requires a weighted approach: multiply each group midpoint by its frequency, sum those products, divide by total frequency to get the mean, then calculate squared deviations using class midpoints weighted by frequency. The formula becomes √[Σ(f×(x-μ)²) / Σf] for population or √[Σ(f×(x-μ)²) / (Σf-1)] for samples.
What is the SD of 5 3 4 7?
Mean = 4.75, squared deviations sum to 16.25, sample variance = 16.25 ÷ 3 = 5.4167, sample standard deviation = √5.4167 ≈ 2.33. Population standard deviation would be √(16.25 ÷ 4) = √4.0625 ≈ 2.02.
What is the standard deviation of 2 4 4 4 5 5 7 9?
Mean = 5.00, sum of squared deviations = 29.44, sample variance = 29.44 ÷ 7 ≈ 4.21, sample standard deviation = √4.21 ≈ 2.05. The population SD would be √(29.44 ÷ 8) = √3.68 ≈ 1.92.
What is the 3 SD rule?
The 3-sigma rule states that approximately 99.7% of data in a normal distribution falls within three standard deviations of the mean. About 95% falls within two SDs, and roughly 68% within one SD. This rule lets you quickly assess how unusual a value is — data beyond three SDs from the mean is extremely rare.



