Standard Deviation & Variance Calculator
The Standard Deviation & Variance Calculator computes σ (or s) and σ² for any comma-separated dataset — instantly, with no sign-in required. Enter your numbers, choose Population (÷N) or Sample (÷N−1, Bessel's correction), and get the result plus a coefficient-of-variation interpretation. Use it for statistics homework, quality control, financial volatility, or scientific data analysis.
Standard deviation (σ) measures how spread out data is around the mean. For a population: σ = √[Σ(xᵢ − μ)² / N]. For a sample: s = √[Σ(xᵢ − x̄)² / (n−1)]. Classic example — dataset {2,4,4,4,5,5,7,9}: mean = 5, population σ = 2, variance σ² = 4.
When to use this calculator
- A high school teacher grading a 30-student exam needs to report the class's standard deviation to identify whether scores cluster tightly around the mean or are widely spread.
- A quality-control engineer at a manufacturing plant measures the diameter of 50 bolts and uses population standard deviation to determine whether production variance exceeds the ±0.02 mm tolerance spec.
- A financial analyst computing the historical volatility of a stock's daily returns over 252 trading days uses sample standard deviation (N−1) because those 252 days are a sample of all possible trading days.
- A clinical researcher at a university hospital compares the variance of blood-pressure readings between a treatment group and a control group to assess whether the experimental drug reduces measurement spread.
- A meteorologist uses NOAA temperature records to compute the standard deviation of daily high temperatures across a decade, identifying years with abnormally volatile weather patterns.
- A student completing AP Statistics homework verifies the step-by-step variance calculation for a small dataset before submitting, using this calculator to check their manual work.
Worked Example
- Dataset: 2,4,4,4,5,5,7,9 (N=8, Population)
- Mean μ = (2+4+4+4+5+5+7+9) / 8 = 40 / 8 = 5
- Σ(xᵢ−μ)² = 9+1+1+1+0+0+4+16 = 32
- Variance σ² = 32 / 8 = 4
- Std Dev σ = √4 = 2
How it works
3 min readFormulas
There are two versions depending on whether your dataset is an entire population or a sample from a larger population.
Population Standard Deviation (σ)
μ = (Σ xᵢ) / N ← mean
σ² = Σ(xᵢ − μ)² / N ← population variance
σ = √[ Σ(xᵢ − μ)² / N ] ← population std devSample Standard Deviation (s)
x̄ = (Σ xᵢ) / n ← sample mean
s² = Σ(xᵢ − x̄)² / (n − 1) ← sample variance (Bessel's correction)
s = √[ Σ(xᵢ − x̄)² / (n − 1) ] ← sample std dev> Why (n−1)? A sample mean is itself estimated from the data, which slightly underestimates the true population variance. Bessel's correction (÷ n−1) produces an unbiased estimator.
---
Quick-Reference Table: Population vs. Sample
| Feature | Population (σ) | Sample (s) |
|---|---|---|
| Divisor | N | n − 1 |
| Symbol | σ (sigma) | s |
| Use when | You have ALL the data | You have a subset |
| Excel function | =STDEV.P() | =STDEV.S() |
| Python (NumPy) | np.std(x, ddof=0) | np.std(x, ddof=1) |
| Typical context | Census, full production run | Survey, lab sample |
---
Coefficient of Variation (CV) Reference Table
| CV (%) | Dispersion Level | What it means |
|---|---|---|
| < 15% | Low | Data is homogeneous / consistent |
| 15–30% | Moderate | Noticeable but manageable spread |
| > 30% | High | Data is highly heterogeneous |
> CV = (σ / μ) × 100 — dimensionless, allows comparing datasets with different units.
---
Worked Examples
Example 1 — Classic Textbook Dataset (Population, N=8)
Dataset: 2, 4, 4, 4, 5, 5, 7, 9
Step 1 — Mean: μ = (2+4+4+4+5+5+7+9) / 8 = 40 / 8 = 5
Step 2 — Deviations squared:
(2−5)²=9, (4−5)²=1, (4−5)²=1, (4−5)²=1,
(5−5)²=0, (5−5)²=0, (7−5)²=4, (9−5)²=16
Step 3 — Sum: 9+1+1+1+0+0+4+16 = 32
Step 4 — Variance: σ² = 32 / 8 = 4
Step 5 — Std Dev: σ = √4 = 2Result: σ = 2, σ² = 4 — This is the canonical example used in most statistics textbooks.
---
Example 2 — Quality Control (Sample, n=5)
Measured diameters (mm): 9.98, 10.01, 10.00, 9.99, 10.02
Step 1 — Mean: x̄ = 50.00 / 5 = 10.00 mm
Step 2 — Σ(xᵢ − x̄)² = 0.0004+0.0001+0+0.0001+0.0004 = 0.0010
Step 3 — Sample Variance: s² = 0.0010 / 4 = 0.00025 mm²
Step 4 — Sample Std Dev: s = √0.00025 ≈ 0.0158 mmResult: s ≈ 0.016 mm — well within a ±0.02 mm tolerance band.
---
Example 3 — Student Exam Scores (Sample, n=7)
Scores: 68, 72, 75, 80, 85, 90, 92
x̄ ≈ 80.29
Σ(xᵢ − x̄)² ≈ 496.43
s² = 496.43 / 6 ≈ 82.74
s ≈ 9.10 pointsResult: s ≈ 9.1 points — a reasonable spread for a 100-point exam.
---
Real-World Benchmarks
| Domain | Dataset | Typical Mean | Typical σ | Interpretation |
|---|---|---|---|---|
| US adult male height | NHANES | 69.1 in | 2.9 in | 68% of men: 66.2–72.0 in |
| IQ scores | Standardized tests | 100 | 15 | Score 130 = +2σ |
| S&P 500 daily returns | ~252 trading days | ~0.03% | ~1.0% | Annual vol ≈ 15–20% |
| Bolt diameter (CNC) | Manufacturing | 10.00 mm | 0.01 mm | 6σ: 3.4 defects/million |
| Classroom exam scores | Typical class | 75 pts | 10–12 pts | Well-designed test |
---
Common Mistakes
1. Using population formula on sample data. Dividing by N instead of N−1 underestimates σ by a factor of √(n−1)/n. With n = 5, the error is ~10.6%.
2. Confusing standard deviation with standard error (SE). Std dev describes spread in your dataset; SE = s/√n describes uncertainty in your estimate of the mean.
3. Different units for variance. If data is in meters, variance is in m² and std dev is in m.
4. Ignoring outliers. Because deviations are squared, a single extreme outlier can drastically inflate σ.
5. Computing std dev on non-numeric or ordinal data. Standard deviation requires interval or ratio scale data.
Frequently asked questions
What is the difference between population and sample standard deviation?
Population standard deviation (σ) divides by N and is used when you have data for every member of the group. Sample standard deviation (s) divides by N−1 (Bessel's correction) and is used when your data is a subset of a larger population. For large samples (N > 100), the difference is negligible, but for N = 5, the population formula underestimates true variability by about 10–11%.
Why does the classic dataset {2,4,4,4,5,5,7,9} give exactly σ = 2?
The mean is 5, the squared deviations sum to exactly 32, and 32 ÷ 8 = 4 (variance), so √4 = 2. This dataset was deliberately constructed for textbooks to produce clean integers at every step, making it the most widely used teaching example in introductory statistics.
What does a standard deviation of 0 mean?
A standard deviation of exactly 0 means every value in your dataset is identical — there is zero spread. For example, {7, 7, 7, 7} has μ = 7 and σ = 0. In practice, σ = 0 can also signal a data-entry error or that a constant was accidentally entered as repeated values.
What is the Empirical Rule (68-95-99.7) and how does it use standard deviation?
For normally distributed data, approximately 68% of values fall within ±1σ of the mean, 95% within ±2σ, and 99.7% within ±3σ. For US adult male heights (mean = 69.1 in, σ = 2.9 in), about 95% of men are between 63.3 in and 74.9 in. This rule only applies to roughly normal distributions, not skewed or bimodal data.
How is standard deviation used in finance and investing?
In finance, standard deviation of returns is the primary measure of volatility. The S&P 500 has a historical daily σ of roughly 1.0%, annualizing to ~15–20% (× √252 trading days). Portfolio managers use σ to calculate Value-at-Risk (VaR): with annualized σ = 15%, there is approximately a 5% chance of losing more than 24.7% in a year (under normal distribution assumptions).
What is Six Sigma and how does it relate to standard deviation?
Six Sigma is a quality-management methodology targeting 6 standard deviations between the process mean and specification limits. Statistically, a ±6σ process (with a 1.5σ mean shift) produces only 3.4 defects per million opportunities (DPMO), versus 66,807 DPMO for a ±3σ process.
Can standard deviation be negative?
No. Standard deviation is always zero or positive (σ ≥ 0). Each deviation is squared before summing, so variance is always non-negative, and its square root is non-negative. A negative result from manual calculation indicates an arithmetic error.
How many data points do I need for a reliable standard deviation?
With n = 2, you get a valid but very imprecise estimate. Most statisticians consider n ≥ 30 the threshold at which sample standard deviation becomes a reliably stable estimator of population σ. For small samples (n < 10), the 95% confidence interval around s is extremely wide.
What is the coefficient of variation (CV) and when should I use it?
CV = (σ / μ) × 100%. It expresses standard deviation as a percentage of the mean, allowing comparison of variability across datasets with different units or scales. For example, Dataset A: σ = 10, μ = 100 (CV = 10%) vs Dataset B: σ = 3, μ = 15 (CV = 20%) — Dataset B is more variable relative to its mean despite having a smaller absolute σ.
How do I calculate standard deviation in Excel or Google Sheets?
Use =STDEV.P(range) for population (divides by N) or =STDEV.S(range) for sample (divides by N−1). The older =STDEV() is equivalent to STDEV.S. For variance, use =VAR.P() (population) or =VAR.S() (sample). Always choose the correct function based on whether your data is the entire population or a subset.