How a Standard Deviation Calculator Works
Standard deviation summarises how spread out a set of values is around its mean. This guide walks through the sample and population formulas, why the divisor changes from n to n − 1, the worked example the calculator uses by default, the 68-95-99.7 rule that gives standard deviation its power, and the misreadings that trip up almost every first-course student.
What standard deviation actually measures
Standard deviation is a single number that summarises how spread out a set of values is around its own mean. Two datasets can have the same average and look nothing alike — one tightly clustered, the other scattered across a wide range — and standard deviation is the compact quantity that separates them. Feed a raw list of numbers into the standard deviation calculator and you get the standard deviation, the variance, the mean, the sum of squared deviations, the count and the range in a single pass.
Where the average tells you the centre of the data, the standard deviation tells you the typical distance from that centre. A small standard deviation says most values sit close to the mean; a large one says the observations swing far above and below it. Because that distance is expressed in the same units as the underlying data — pounds, seconds, millimetres, dollars — the standard deviation reads naturally in whatever context you drew the numbers from.
Sample versus population — and why the divisor changes
Every introductory statistics book presents two versions of the same formula. The population standard deviation σ uses n in the denominator; the sample standard deviation s uses n − 1. The calculator offers a toggle between the two because the choice depends on what your list of numbers actually represents.
Use the population formula when the numbers in front of you are the whole thing — every member of the group you care about, not a sample from it. The scores of every student in a classroom, the daily readings from every sensor in a fixed array, the lap times of every car in a specific race. There is no estimation involved: you have the whole population, so divide by n and take the square root.
Use the sample formula when the numbers are a subset drawn from a larger population you want to say something about. That is the ordinary case in survey research, clinical trials, quality assurance sampling and any A/B test — you never observe the whole underlying population, only a slice of it. Dividing by n − 1 rather than n is called Bessel's correction, and it exists because the sample mean is computed from the same data you are measuring deviations from. That reuse biases the raw sum of squared deviations slightly downward; dividing by the smaller number n − 1 corrects the bias, so s² becomes an unbiased estimator of the underlying population variance σ².
The practical consequence: the sample standard deviation is always a touch larger than the population standard deviation for the same data. For n = 5 the divisor moves from 5 to 4 — a 25% adjustment. For n = 100 it moves from 100 to 99 — a 1% adjustment. For n in the thousands the two variants are indistinguishable to three decimal places. When in doubt, pick the sample variant: real datasets are almost always samples, and choosing the sample formula when you had the whole population only widens the reported spread very slightly.
The formula, in plain English
The recipe is the same whichever variant you choose. First, compute the mean of every value. Second, for each value work out its deviation from that mean (positive if the value is above, negative if below). Third, square each deviation — this discards the sign and gives greater weight to values further from the centre. Fourth, sum all the squared deviations. Fifth, divide by n (population) or n − 1 (sample) to get the variance. Sixth, take the square root to get the standard deviation.
Population: σ = √( Σ(xᵢ − μ)² / n ) Sample: s = √( Σ(xᵢ − x̄)² / (n − 1) )
Both formulas trace back to OpenStax Introductory Statistics §2.7 (Measures of the Spread of the Data) and the NIST/SEMATECH e-Handbook of Statistical Methods §1.3.5.6. The squaring step is what makes the standard deviation a slightly opinionated summary of spread: values twice as far from the mean contribute four times as much to the total, so the standard deviation is sensitive to outliers. For heavy-tailed distributions the median absolute deviation is a more robust alternative, but for the ordinary mound-shaped data that dominate business and science, the standard deviation is the universal reporting convention.
Worked example
Take the dataset used in the calculator's default preview: 2, 4, 4, 4, 5, 5, 7, 9 (eight values). The step-by-step workings show why the sample and population variants differ by a small but non-zero amount.
Values: 2, 4, 4, 4, 5, 5, 7, 9 Count n: 8 Sum: 40 Mean x̄: 40 / 8 = 5 Deviations x − x̄: −3, −1, −1, −1, 0, 0, 2, 4 Squared deviations: 9, 1, 1, 1, 0, 0, 4, 16 Σ(x − x̄)²: 32 Population variance: 32 / 8 = 4.0000 Population SD σ: √4.0000 = 2.0000 Sample variance s²: 32 / 7 ≈ 4.5714 Sample SD s: √4.5714 ≈ 2.1381
Feeding the same eight numbers into the standard deviation calculator returns exactly those figures, plus the min (2), the max (9), the range (7) and the sum of squared deviations (32) as a check on your workings. The population value is a clean integer here because the dataset was chosen to make the squared deviations sum to a multiple of n; real data almost never behaves so tidily.
The 68–95–99.7 rule
The reason standard deviation dominates statistics is that it plugs directly into a rule of thumb that describes almost every roughly bell-shaped dataset. For a normal distribution, about 68% of values fall within one standard deviation of the mean, about 95% within two, and about 99.7% within three. This is the "empirical rule" or "68–95–99.7 rule", covered in every first-year statistics course and in NIST §1.3.6.6.1.
For height, blood pressure, test scores, measurement error and countless other quantities, the rule turns the abstract number "the standard deviation is 12" into something you can picture: about a third of observations lie more than 12 units from the mean, about one in twenty lie more than 24 units, and only three in a thousand lie more than 36 units. The rule breaks down for strongly skewed data, for heavy tails and for anything with hard bounds (proportions near 0 or 1, counts near zero), but for the well-behaved distributions that dominate applied work it is a shortcut worth internalising.
The rule also explains why standard deviation feeds directly into confidence intervals and z-scores. The confidence interval calculator uses σ (or s) as an input; so does the sample size calculator. Every one of those tools relies on the standard deviation being an accurate summary of spread, which in turn relies on you having chosen the sample or population variant correctly.
Variance, standard deviation and units
The variance is the standard deviation squared. It appears in the intermediate steps of the formula but is rarely reported on its own because its units are the square of the data — square dollars, square millimetres, square seconds — and squared units are hard to reason about. The standard deviation restores the original units and, in doing so, becomes the report-friendly summary.
Variance has one property that keeps it in the background of every calculation: for independent random variables, variances add. Standard deviations do not — the standard deviation of a sum is not the sum of the standard deviations, but the square root of the sum of the variances. That is why probability theory, portfolio maths and error propagation all work in variance space and only switch to standard deviation for the final display.
Factors that shift the standard deviation
Outliers
The squaring step means points far from the mean carry disproportionate weight. A single extreme value in a modest-sized sample can pull the standard deviation up sharply, even though it barely moves the median or the interquartile range. Before reporting a standard deviation from real data, plot the values and check whether one or two observations are driving the number. Sensor faults, data-entry mistakes and genuine but rare events all create outliers, and each needs a different treatment — never silently drop them.
Sample size
The estimate of the population standard deviation from a small sample is itself noisy: two samples of five drawn from the same population can produce sample standard deviations that differ by 30% or more. That noise falls as √n grows, but slowly. It is why the sample size calculator pushes for larger n when the goal is a precise estimate of σ — and why the sample-versus- population divisor correction matters most when n is small.
Measurement units and scale
Multiply every value in a dataset by a constant and the standard deviation multiplies by the same constant. Add a constant to every value and the standard deviation is unchanged. Standard deviation is a measure of spread, not location — shifting the data leaves the spread untouched, but rescaling it stretches or compresses the spread linearly. This is the property that lets you convert between units (metres ↔ feet, °C ↔ °F) by multiplying the standard deviation by the same conversion factor as the mean.
Distribution shape
The standard deviation summarises spread in a single number. For symmetric mound-shaped distributions that summary is close to complete; for skewed or multi-modal distributions it can be actively misleading. Bimodal data with one peak at −5 and another at +5 can have a mean of 0 and a moderate standard deviation, yet no observation actually sits near 0. Always pair the standard deviation with a look at the distribution — a histogram, a box plot, or the min/max and range that the calculator surfaces alongside.
How to use the calculator well
- Choose the correct variant. Sample if the numbers are a subset of a larger population you want to say something about, population if the numbers are the whole thing. When in doubt, pick sample.
- Paste, do not type. The parser accepts commas, spaces, tabs and line breaks. Copy directly from a spreadsheet column and it will work without pre-formatting.
- Check the count. The result card shows the count next to the mean. If the count does not match how many numbers you thought you pasted, an entry was unrecognised — check for stray letters or currency symbols.
- Read the sum of squared deviations. If you are cross-checking against a textbook or a spreadsheet, the Σ(x − x̄)² field is the intermediate you can compare without touching the sample-versus-population choice.
- Match units. If your data is a mix of feet and metres, or currencies, the standard deviation will be meaningless. Convert everything to the same units before you paste.
- Pair with a mean. A standard deviation without its mean is context-free. Report both — the calculator does, so copy them together.
Common mistakes
Using the population formula on a sample. The result will be slightly too small — biased downward — and every downstream statistic that plugs it in (confidence intervals, hypothesis tests, power calculations) inherits the bias. The correction is cheap: switch the toggle to Sample.
Comparing standard deviations across different-scale datasets. A standard deviation of 5 is huge for exam scores out of 100 and tiny for household incomes. To compare spread across datasets on different scales, use the coefficient of variation (standard deviation ÷ mean), which is unitless.
Reporting standard deviation for skewed data as if the empirical rule applies. Response times, income distributions and time-to-failure data are typically right-skewed; the 68–95–99.7 rule does not hold and the standard deviation does not describe them well. Report the interquartile range or a percentile summary instead, and consider a log transform before any further analysis.
Confusing standard deviation with standard error. Standard deviation describes the spread of individual observations. Standard error describes the spread of the sample mean and equals σ / √n. The two differ by a factor of √n — potentially a large number — and mixing them up is one of the most common errors in first-course statistics.
Trusting one decimal too many. If your sample size is 10, the standard deviation itself has about 25% uncertainty. Reporting σ = 4.7381 from a sample of ten is false precision; σ ≈ 4.7 is honest. Round the standard deviation to two significant figures at most, and to one when the sample is small.
When to move beyond a single standard deviation
For a rough summary of spread in a well-behaved dataset, the number on this page is usually enough. Move beyond it when the data is skewed (report percentiles, median absolute deviation, or transform the data), when observations are correlated in time (use a rolling standard deviation or a time-series model), when you are combining measurements with different variances (weighted variance), or when you are working with subgroups (report a standard deviation per group as well as the pooled figure). The formula extends cleanly to every one of these cases — the standard deviation you compute here is the foundation, not the ceiling.
Related calculators and further reading
For upstream and downstream statistics, the average calculator returns the mean, median, mode and range from the same list of numbers; the confidence interval calculator takes the mean and standard deviation and builds a plausible range for the population mean; the sample size calculator inverts the confidence-interval formula to work out how many observations you need for a target margin of error; and the percent error calculator compares an estimate with a known value in percentage terms. For the authoritative source material behind the formulas, OpenStax Introductory Statistics §2.7 and the NIST/SEMATECH e-Handbook of Statistical Methods §1.3.5.6 both cover sample and population standard deviation with worked examples and reference tables. For the deeper mathematics, Bessel's correction is derived from first principles in Casella and Berger's Statistical Inference.
Return to the standard deviation calculator to plug in your own numbers.
Frequently asked questions
What is the difference between sample and population standard deviation?
Both measure how spread out the values are around the mean. Population standard deviation (σ) divides the sum of squared deviations by the count n — it assumes the numbers are the entire population, so no estimation correction is needed. Sample standard deviation (s) divides by n − 1 instead — this is Bessel's correction, and it makes s² an unbiased estimator of the unknown population variance when the data is only a sample. Real datasets are almost always samples, so the sample formula is the default; use the population formula only when you genuinely have every member of the population.
Why divide by n − 1 for a sample instead of n?
The sample mean is computed from the same data you are measuring deviations from. The mean is, by construction, the point that minimises the sum of squared deviations within your sample, so using it as the reference under-estimates the true spread around the unknown population mean. Dividing by n − 1 instead of n compensates for that reuse and yields an unbiased estimator of the population variance. The correction matters most for small samples — for n = 5 the divisor changes by 25%; for n = 1,000 it changes by 0.1% and the two variants converge.
What is variance and how does it relate to standard deviation?
Variance is the average squared deviation from the mean. Standard deviation is the square root of variance — it brings the value back to the original units of the data. Variance has the useful mathematical property that variances of independent variables add, which is why it appears throughout probability theory; standard deviation is more intuitive to report because its units match the data (pounds, seconds, dollars). The calculator returns both — s and s² for the sample variant, σ and σ² for the population variant.
What does the 68-95-99.7 rule say?
For a roughly normal, mound-shaped distribution, about 68% of values fall within one standard deviation of the mean, about 95% within two, and about 99.7% within three. This is the empirical rule, or 68-95-99.7 rule, from NIST's e-Handbook §1.3.6.6.1. It turns the abstract number 'the standard deviation is 12' into a picture: about a third of observations lie more than 12 units from the mean, about one in twenty lie more than 24 units, and only three in a thousand lie more than 36 units. The rule breaks down for skewed or heavy-tailed distributions, but for well-behaved data it is the shortcut that makes standard deviation so useful.
Can standard deviation be negative or zero?
Never negative — it is a square root of an average of squared quantities, which cannot be negative. It is zero only when every value in the dataset is identical: the sum of squared deviations is zero, and its square root is zero. Any variation in the data at all produces a strictly positive standard deviation.
What if I only have one number?
Population standard deviation is defined as zero — a single value has no spread from itself. Sample standard deviation is undefined because the formula divides by n − 1, which is zero when n = 1. The calculator surfaces this directly: with one value and the sample setting selected, it returns an em-dash and a note that you should either add another value or switch to the population variant.
How is standard deviation different from standard error?
Standard deviation describes the spread of individual observations. Standard error describes the spread of the sample mean and equals σ / √n. The two differ by a factor of √n — potentially a large number — and mixing them up is one of the most common errors in first-course statistics. Confidence intervals use the standard error, not the standard deviation directly; the standard deviation you compute here is the input σ that gets divided by √n to build the interval on the confidence interval calculator.
Should I trust every decimal the calculator returns?
Only up to the precision your sample supports. The standard deviation itself is estimated with error, and that error shrinks slowly with sample size. At n = 10 the standard deviation has roughly 25% uncertainty; at n = 100 it is about 7%; at n = 1,000 about 2%. Reporting four decimal places from a sample of ten is false precision. Round to two significant figures for medium samples and one for small samples — the honest report matches the amount of information the data actually contains.
Informational only. Not personalised financial, legal, or tax advice.