Standard deviation (SD) measures how far, on average, individual observations sit from the mean of a dataset. It answers a question the mean alone cannot: not just “where is the centre of these data,” but “how spread out are they around that centre.” A small SD means observations cluster tightly around the mean; a large SD means they are widely scattered. SD is reported in the same units as the original data — centimetres, milligrams, response-time seconds — which is precisely why it is preferred over variance for communicating spread.
Building the formula step by step
The standard deviation formula looks dense on first encounter, but each piece answers a specific problem with the piece before it.
Step 1: Start with deviations from the mean
For each observation x, the deviation from the mean is x − x̄ (or x − μ for a population). This is the raw distance of a point from the centre, and it can be positive or negative.
Step 2: Deviations sum to zero — so averaging them directly fails
By definition of the mean, the positive and negative deviations always cancel out exactly: they sum to zero. Averaging raw deviations therefore always produces zero, no matter how spread out the data are. A useful measure of spread has to neutralise the sign first.
Step 3: Why square, rather than take the absolute value
Two ways to remove the sign: take the absolute value, or square the deviation. Mean Absolute Deviation (MAD) uses the first approach and is a legitimate, sometimes preferable, statistic in its own right (see Mean Absolute Deviation for when to use it instead). Squaring is the more common convention because it is mathematically better-behaved: it is differentiable everywhere (useful for the calculus behind estimation methods like least squares), it weights larger deviations more heavily, which is often desirable when large errors matter more, and it leads directly to variance, which has convenient additive properties that absolute deviations lack.
Step 4: Average the squared deviations — this is variance
Sum the squared deviations and divide by the number of observations (population) or by one less than the number of observations (sample — see below). This average squared deviation is the variance.
Step 5: Take the square root to return to the original units
Because the deviations were squared, variance is expressed in squared units — square centimetres, square milligrams — which are rarely meaningful to report or interpret. Taking the square root of variance undoes the squaring and returns the statistic to the original, interpretable units. That square root is the standard deviation. This is the whole reason SD, not variance, is the number that appears in results tables and abstracts: it is the version of spread you can actually picture on the same scale as the data.
Population vs. sample formula
The formula takes two forms depending on whether the dataset is the entire population of interest or a sample drawn from a larger population.
Population standard deviation (σ)
σ = √[ Σ(x − μ)² / N ]
Used when the dataset genuinely is the whole population — every unit you care about, not a subset. N is the population size and μ is the true population mean.
Sample standard deviation (s)
s = √[ Σ(x − x̄)² / (n − 1) ]
Used when the dataset is a sample used to estimate a larger population’s spread — the far more common case in research. n is the sample size and x̄ is the sample mean.
Why divide by n − 1, not n? Bessel’s correction
The sample formula divides by n − 1 rather than n. This adjustment, known as Bessel’s correction, exists because the deviations in the sample formula are taken from the sample mean, x̄ — an estimate calculated from the same data — rather than from the true, usually unknown, population mean μ.
The sample mean is, by construction, the value that minimises the sum of squared deviations from itself. That means the squared deviations calculated around x̄ are systematically slightly smaller than the squared deviations would be if calculated around the true μ. Dividing by n would therefore underestimate the population variance on average. Dividing by n − 1 corrects for this bias by inflating the result slightly. In degrees-of-freedom terms, estimating x̄ from the data itself “uses up” one degree of freedom, leaving n − 1 independent pieces of information to estimate spread. See Degrees of Freedom in Statistics for the fuller explanation of why this matters beyond standard deviation.
Worked example (illustrative data)
The following is an illustrative dataset for demonstration only, not drawn from any real study: five measured reaction times, in seconds — 4, 8, 6, 5, 3.
- Mean: (4 + 8 + 6 + 5 + 3) / 5 = 26 / 5 = 5.2
- Deviations from the mean: 4 − 5.2 = −1.2; 8 − 5.2 = 2.8; 6 − 5.2 = 0.8; 5 − 5.2 = −0.2; 3 − 5.2 = −2.2
- Squared deviations: 1.44; 7.84; 0.64; 0.04; 4.84
- Sum of squared deviations: 1.44 + 7.84 + 0.64 + 0.04 + 4.84 = 14.80
- Sample variance (divide by n − 1 = 4): 14.80 / 4 = 3.70
- Sample standard deviation: √3.70 ≈ 1.92 seconds
If this same set of five values were treated as the entire population of interest (dividing by N = 5 instead), the population variance would be 14.80 / 5 = 2.96, and the population standard deviation would be √2.96 ≈ 1.72 seconds. The two answers differ because they answer different questions: one describes this exact set of five values; the other estimates the spread of a larger population from a sample of five.
Interpreting standard deviation: the empirical rule and its precondition
For data that are approximately normally distributed, standard deviation has a well-known interpretation, the empirical rule (also called the 68–95–99.7 rule):
- Approximately 68% of observations fall within ±1 SD of the mean
- Approximately 95% fall within ±2 SD of the mean
- Approximately 99.7% fall within ±3 SD of the mean
This rule holds only when the underlying distribution is approximately normal (bell-shaped). It is not a universal property of standard deviation and should not be applied to skewed, multimodal, or heavy-tailed data without first checking the distribution’s shape. See Normality of Distribution for how to check this assumption before relying on the empirical rule, and Skewness: Left-Skewed vs. Right-Skewed Distributions for what to do when it doesn’t hold.
Chebyshev’s inequality: the distribution-free fallback
When normality cannot be assumed, Chebyshev’s inequality provides a weaker but universally valid guarantee that holds for any distribution with finite variance: at least 1 − 1/k² of observations fall within k standard deviations of the mean, for any k > 1. For k = 2, that guarantees at least 75% of observations within ±2 SD (versus the ~95% the empirical rule would suggest for normal data) — a noticeably looser bound, but one that requires no distributional assumption at all.
Standard deviation vs. standard error: the most consequential mix-up in applied reporting
SD and standard error (SE) are routinely confused, and the confusion is not cosmetic — it changes how variable a result looks to a reader.
- Standard deviation describes the spread of individual observations in the data itself. It does not shrink as sample size grows — it estimates a property of the underlying population or process.
- Standard error describes the precision of a sample statistic (typically the sample mean) as an estimate of the true population parameter. SE = SD / √n, so it shrinks as sample size increases — larger samples give more precise estimates of the mean, even though the underlying data’s spread (SD) stays roughly the same.
Reporting SE where SD belongs makes variability in the underlying data look artificially small, because SE is always smaller than SD for n > 1 and keeps shrinking with sample size. A results table that reports “mean ± SE” to describe how spread out individual subjects’ values were is describing something different from what it looks like it’s describing. See Sampling Distribution for the full derivation of standard error and how it relates to the central limit theorem.
Standard deviation vs. variance vs. MAD vs. IQR vs. coefficient of variation
Standard deviation is one of several spread statistics, and it is not always the right one.
| Statistic | Best used when |
|---|---|
| Standard deviation | Data are roughly symmetric, not heavily skewed, and not dominated by extreme outliers; you want a measure in the original units suited to further parametric analysis. |
| Variance | You need the algebraic properties of squared deviations (e.g. as an input to further statistical calculations) rather than an interpretable, unit-matched summary to report directly. |
| Mean Absolute Deviation (MAD) | You want a spread measure less sensitive to extreme values than SD, still in original units, without moving to rank-based statistics. See Mean Absolute Deviation. |
| Interquartile Range (IQR) | Data are skewed or contain outliers; you want a spread measure based on ranks (the middle 50% of values) that isn’t distorted by extreme values the way SD is. See Interquartile Range & Five-Number Summary. |
| Coefficient of Variation (CV) | You need to compare relative spread across variables measured in different units or with very different means — CV expresses SD as a proportion of the mean. See Coefficient of Variation. |
Sensitivity to outliers and skew
Because standard deviation squares each deviation, a single extreme value contributes disproportionately to the total — a point twice as far from the mean contributes four times the squared deviation. This makes SD sensitive to outliers and to skewed distributions, where a long tail on one side inflates SD in a way that doesn’t reflect the “typical” spread most of the data actually show. For strongly skewed or outlier-heavy data, SD paired with the mean can be a misleading summary; the median with IQR is often a more robust and honest description of the data’s centre and spread. Check shape with a histogram before deciding.
Reporting conventions
- “Mean ± SD” vs. “mean (SD)”: Both appear in the literature. “Mean (SD)” is often preferred by style guides because the ± symbol is ambiguous — without an explicit statement of what follows it (SD? SE? a confidence interval?), readers cannot tell what the range represents. If you use ±, always state explicitly what it denotes in the text or table footnote.
- Significant figures: Report SD to a precision consistent with the underlying measurement — typically one more significant figure than the raw data, not an arbitrary number of decimal places that implies false precision.
- State the divisor: When it matters (e.g. software defaults differ), it can be worth being explicit that a sample SD (n − 1) was used, since this is the overwhelmingly standard convention for research data but is not universal in every tool.
Common errors
- Using the population formula (÷N) on sample data. This understates variability; almost all research data is a sample, and the sample formula (÷n−1) is the correct default unless the dataset genuinely is the entire population.
- Confusing SD with SE. See the dedicated section above — check which one a results table is actually reporting before interpreting it.
- Applying the empirical rule to skewed data. The 68/95/99.7 percentages assume approximate normality; on skewed or multimodal data they can be substantially wrong. Check distribution shape first.
- Comparing SDs across variables in different units, or with very different means, without standardising. An SD of 5 on a variable with mean 10 represents far more relative spread than an SD of 5 on a variable with mean 1,000. Use the coefficient of variation for this kind of comparison, not raw SD.
Frequently asked questions
What does standard deviation tell you?
It tells you the typical distance between individual observations and the mean of the dataset, expressed in the same units as the data — a single-number summary of how spread out the values are.
What is a “good” standard deviation?
There is no universal threshold. A standard deviation is only meaningful relative to the scale and mean of the variable it describes, or when compared against another SD on the same variable (e.g. across groups or time points). Use the coefficient of variation to compare spread across variables with different units or means.
Why do we square the deviations instead of using absolute values?
Squaring removes the sign (so positive and negative deviations don’t cancel), is mathematically differentiable everywhere, weights large deviations more heavily, and connects directly to variance, which has useful additive properties absolute deviations lack. Mean Absolute Deviation, which uses absolute values instead, is a valid alternative when those squaring effects are undesirable.
Should I use n or n − 1 to calculate standard deviation?
Use n − 1 (the sample formula) unless your dataset is genuinely the entire population you care about, not a sample from a larger one. Dividing by n−1, Bessel’s correction, corrects for the bias introduced by estimating the mean from the same data used to calculate the deviations.
Is standard deviation the same as standard error?
No. Standard deviation describes the spread of the data itself and does not shrink with sample size. Standard error describes the precision of an estimate (usually the sample mean) and shrinks as sample size increases. See the comparison above and Sampling Distribution.







