Standard Deviation
Variance
Mean
Sum of squared deviations
Count (n)
Table of Contents
What is standard deviation?
Standard deviation measures how spread out a set of values is around the mean. If everyone in a class scored within a few points of the average, the standard deviation is low — the data is tightly clustered. If scores are scattered from very low to very high, the standard deviation is high. Together with the mean, standard deviation is one of the two most useful summary statistics in everyday data analysis.
The standard deviation formula
The formula for standard deviation depends on whether your data is a complete population or a sample drawn from a larger population.
Population standard deviation:
σ = √(Σ(xᵢ - μ)² / n)
Sample standard deviation:
s = √(Σ(xᵢ - x̄)² / (n - 1))
The only difference is the divisor: population SD divides by n, while sample SD divides by n - 1. The (n - 1) correction is called Bessel's correction and exists because a sample tends to slightly underestimate the variability of the full population.
Step by step calculation
- Find the mean (average) of the values.
- Subtract the mean from each value to get the deviations.
- Square each deviation.
- Sum the squared deviations.
- Divide by n (population) or n - 1 (sample) to get the variance.
- Take the square root of the variance to get the standard deviation.
Worked example
Data: 12, 15, 18, 22, 25, 27, 30, 33. Mean = 22.75.
Squared deviations: 115.5625, 60.0625, 22.5625, 0.5625, 5.0625, 18.0625, 52.5625, 105.0625. Sum = 379.5.
Sample variance = 379.5 / 7 = 54.214. Sample SD = √54.214 ≈ 7.36.
Population variance = 379.5 / 8 = 47.4375. Population SD = √47.4375 ≈ 6.89.
Population vs sample — which do I use?
Use population SD when your data set includes every member of the group you care about — for example, the test scores of all 30 students in a class, or the revenue of every store in your company.
Use sample SD when your data is a subset that you are using to estimate something about a larger population — for example, the heights of 100 random people drawn from a country of millions.
Most statistical software (Excel's STDEV.S, SPSS, R's sd()) defaults to sample standard deviation because most real-world analysis works with samples. This calculator defaults to sample SD for the same reason but lets you switch to population SD with one click.
Why standard deviation matters
Quality control: Manufacturers track the standard deviation of product dimensions to detect drift in their processes. A sudden rise in SD signals a problem on the production line.
Finance and investing: Standard deviation of returns is the most common measure of an asset's risk or volatility. Higher SD means a wider range of possible outcomes, which usually equates to higher risk.
Education: SD of test scores helps interpret an individual score — being one SD above the mean is roughly the 84th percentile in a normal distribution.
Scientific research: Error bars on graphs and confidence intervals on results are typically derived from the standard deviation of repeated measurements.
Related concepts
Variance is the standard deviation squared. It is mathematically more convenient in some contexts (no square roots) but harder to interpret because its units are squared. Coefficient of variation (SD / mean) gives a unit-free measure of relative variability, useful when comparing data sets with very different means.
FAQs
Standard deviation is a measure of how spread out the values in a data set are around the mean. A low standard deviation means the values are clustered tightly around the average, while a high standard deviation means they are spread out over a wider range. It is one of the most widely used summary statistics in science, finance and quality control.
Population standard deviation (denoted σ) is used when you have data for every member of the group you care about. Sample standard deviation (denoted s) is used when your data is just a sample drawn from a larger population. The sample formula divides by (n - 1) instead of n — this Bessel's correction adjusts for the fact that a sample tends to underestimate variability in the full population.
First, find the mean of the data. Subtract the mean from each value and square the result — these are the squared deviations. Sum the squared deviations, then divide by n (population) or n - 1 (sample) to get the variance. Take the square root of the variance to get the standard deviation.
Variance is the average of the squared deviations from the mean. It is the standard deviation squared, and it is denoted σ² (population) or s² (sample). Variance is mathematically convenient (no square roots) but is in squared units, which is why standard deviation — its square root — is more commonly reported.
Use population SD when your data covers the entire group of interest — for example, the test scores of every student in a single class. Use sample SD when you have collected data from a subset and want to estimate the variability of the larger population — for example, polling 500 voters from a city of 100,000. Statistical software defaults to sample SD, since most real-world data is from samples.
There is no universal threshold — context matters. In a stable manufacturing process, an SD of 0.01 mm could be high; in stock returns, an SD of 5% per month is moderate. A useful rule is to compare the SD to the mean: the coefficient of variation (SD / mean) gives a unit-free measure of relative variability. Values below 0.10 are typically considered low variability, values above 0.30 high.