Standard Deviation and Variance Calculator
Calculate the standard deviation and variance of any data set, for both a sample (s, ÷n−1) and a population (σ, ÷n). Also shows the mean, sum, range and a step-by-step deviation table.
Sample s = √[ Σ(x−x̄)² ÷ (n−1) ] — use for samples (nearly always). · Population σ = √[ Σ(x−μ)² ÷ n ] — only if you have ALL the data. · Excel STDEV() = sample · STDEVP() = population.
How to Calculate Standard Deviation (Step by Step)
- Find the mean: add all values and divide by n.
x̄ = Σx ÷ n - Find each deviation: subtract the mean from each value,
(x − x̄). - Square each deviation:
(x − x̄)², then sum them:Σ(x − x̄)². - Divide: by
nfor population variance σ², or byn−1for sample variance s². - Square root: the standard deviation is
√variance.
Variance and Standard Deviation
Variance is the result of step 4: the average squared distance from the mean. Standard deviation is its square root. For the data 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the squared deviations add up to 32. The population variance is 32 ÷ 8 = 4, so the population standard deviation is √4 = 2. The sample variance is 32 ÷ 7 ≈ 4.57, so the sample standard deviation is about 2.14.
Quote the standard deviation when you describe spread to a reader, because it is in the same units as the data. Use variance in calculations: variances of independent quantities add together, while standard deviations do not, which is why analysis of variance, portfolio risk and error propagation all work in variance.
Population vs Sample: Which One Do I Use?
Use population standard deviation (σ, ÷n) only when your data covers the entire group you care about — every employee in a company, every product made in one shift. Use sample standard deviation (s, ÷n−1) when your data is a sample used to estimate a larger population — a survey of 200 voters, test scores from one class representing all students. In nearly all real analysis you have a sample, so ÷n−1 is the safe default.
Why ÷(n−1)? Bessel's Correction
A sample tends to cluster slightly closer to its own mean than the full population does, so dividing by n would underestimate the true spread. Dividing by n−1 — Bessel's correction — inflates the result just enough to make the sample standard deviation an unbiased estimator of σ. This is why Excel, R, and most scientific calculators default to ÷n−1 for the "s" key.
Standard Deviation by Country, Tool & Curriculum
| Country / Tool | Taught / Default Formula | Calculator Key | Software |
|---|---|---|---|
| 🇺🇸 US (AP Stats, Excel) | Sample (÷n−1) | Sx on TI-84 | STDEV() in Excel |
| 🇬🇧 UK (A-Level, Casio) | Sample (÷n−1) | σn−1 on Casio | sd() in R |
| 🇩🇪 Germany (Gymnasium) | Sample (÷n−1) | s on calc | numpy std(ddof=1) |
| 🇯🇵 Japan (高校数学B) | Population (÷n) | σn on Casio FX | numpy std(ddof=0) |
| 🇨🇳 China (高中数学) | Population (÷n) | σn on calc | STDEVP() in Excel |
| 🇮🇳 India (CBSE/ISC) | Population (÷n) | σ on Casio fx-82 | STDEVP() in Excel |
Frequently Asked Questions
What is the difference between variance and standard deviation?
Variance is the average of the squared deviations from the mean. Standard deviation is the square root of the variance. They carry the same information, but standard deviation is in the same units as the data, which makes it easier to interpret: heights in centimetres have a standard deviation in centimetres and a variance in square centimetres.
How do I calculate variance?
Find the mean, subtract it from each value, square each result and add the squares. Divide that total by n for population variance (σ²) or by n − 1 for sample variance (s²). For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the squared deviations sum to 32, so the population variance is 32 ÷ 8 = 4 and the sample variance is 32 ÷ 7 ≈ 4.57.
What is the difference between population and sample standard deviation?
Population standard deviation (σ) divides the sum of squared deviations by n and is used when your data covers the ENTIRE group. Sample standard deviation (s) divides by n−1 (Bessel's correction) and is used when your data is a sample drawn from a larger population. In practice the sample formula (÷n−1) is almost always correct, because you rarely have data on the complete population.
Why divide by n−1 for sample standard deviation?
Dividing by n−1 instead of n is called Bessel's correction. It compensates for the fact that a sample's spread tends to underestimate the true population spread, making s an unbiased estimator of σ. This is the default in Excel STDEV(), Python statistics.stdev(), R sd(), and the s/Sx key on Casio and TI calculators.
Which standard deviation does Excel use?
Excel STDEV() and STDEV.S() use the sample formula (÷n−1). STDEVP() and STDEV.P() use the population formula (÷n). Python's numpy.std() defaults to population (÷n) unless you pass ddof=1; pandas .std() and R's sd() default to sample (÷n−1). Always confirm which one a tool uses before reporting a result.
How do school curricula differ on standard deviation?
US AP Statistics and UK A-Level introduce sample standard deviation (÷n−1) early because they focus on inferential statistics. Japan (数学B) and China (高中数学) teach population standard deviation (÷n) first, treating the data set as the population to be described. India's CBSE/ISC also commonly uses ÷n. The arithmetic is identical apart from the divisor.
What does the empirical (68-95-99.7) rule say?
For roughly normal data, about 68% of values lie within 1 standard deviation of the mean, 95% within 2, and 99.7% within 3. This is why standard deviation is used to flag outliers and define confidence intervals.
What does a standard deviation actually tell you?
Standard deviation measures how spread out the data is around the mean, in the same units as the data. A small value means values cluster tightly near the mean; a large value means they are widely scattered. For roughly normal data, about 68% of values fall within one standard deviation of the mean and about 95% within two (the empirical rule).
Sources & Methodology
Population (÷n) and sample (÷n−1) standard deviation and variance are computed client-side from the squared deviations about the mean. Curriculum and software defaults reflect published exam-board specifications and documented function behaviour.
- NIST/SEMATECH e-Handbook of Statistical Methods — Standard Deviation
- Microsoft Support — STDEV vs STDEVP functions
- NumPy documentation — numpy.std (ddof parameter)
Standards and figures reviewed June 2026.
Related Calculators
Cite this page APA · MLA · BibTeX
APA
WorldCalculators.org. (n.d.). Standard Deviation & Variance Calculator, Step by Step. https://worldcalculators.org/calculators/standard-deviation/
MLA
“Standard Deviation & Variance Calculator, Step by Step.” WorldCalculators.org, worldcalculators.org/calculators/standard-deviation/.
BibTeX
@misc{worldcalculatorscalculatorsstandarddevia,
title = {Standard Deviation & Variance Calculator, Step by Step},
author = {{WorldCalculators.org}},
year = {n.d.},
howpublished = {\url{https://worldcalculators.org/calculators/standard-deviation/}}
} Figures change when tax years or guidance change. Cite the date shown and link the page so readers see the current version.