The standard deviation measures how far values typically sit from their mean. Two classes can share an average mark of 12, yet in one most students score between 11 and 13 while in the other marks range from 4 to 19 — the standard deviation captures that difference in a single number, expressed in the same unit as the data.
Paste a list of numbers, or switch to values with frequencies when your data come as a table (mark 14 obtained by 8 students, and so on). The calculator returns:
- the sample standard deviation and variance (divide by ),
- the population standard deviation and variance (divide by ),
- the mean, count, sum and sum of squared deviations,
- the coefficient of variation (spread relative to the mean) and the standard error of the mean.
A table lists every deviation from the mean and its square, so you can check the working by hand or copy it into a report.
Accuracy matters more than it seems: the textbook shortcut can lose every significant digit when the values are large and close together. This calculator uses Welford’s algorithm on exactly centred data and reproduces the certified results of the NIST Statistical Reference Datasets, including the "NumAcc" tests designed to trip up spreadsheets.
How to use this calculator
- Choose List of values or Values with frequencies.
- Type or paste your numbers, or fill one row per distinct value with how many times it occurs.
- Read the sample standard deviation (the headline) and the population figures underneath.
- Open the steps and the deviations table to see how each figure was obtained.
Sample or population? If your data cover every member of the group you care about (all employees of a small company, every match of a season), use . If they are a sample used to describe a bigger group, use .
The formula
For values with mean :
The variance is the square of the standard deviation. With frequencies , each squared deviation is counted times and .
Dividing by (Bessel’s correction) makes an unbiased estimate of the population variance, because deviations are measured from the sample mean rather than the unknown true mean.
Welford’s method updates the mean and the sum of squares one value at a time: , , . It never subtracts two huge, nearly equal sums.
Worked example
List. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the squared deviations add up to 32. The population variance is , so . The sample variance is and . The coefficient of variation is 42.76% and the standard error 0.7559.
Frequency table. Twenty students obtained these marks:
| Mark | 10 | 12 | 14 | 16 | 18 |
|---|---|---|---|---|---|
| Students | 2 | 5 | 8 | 4 | 1 |
The sum of the marks is 274, so the mean is 13.7. The squared deviations, each multiplied by its frequency, total 82.2; hence , and .
Variance vs standard deviation
The variance is the average squared deviation; the standard deviation is its square root. Variances are convenient in theory — the variances of independent quantities add up — but they are expressed in squared units (cm², €²). The standard deviation returns to the original unit, which is why it is the figure usually reported alongside the mean, as in "mean 12.4, SD 2.1".
For data that roughly follow a normal distribution, about 68% of values lie within one standard deviation of the mean, 95% within two and 99.7% within three. To find the matching critical values, see the critical value calculator; for medians and quartiles, use the percentile calculator.
Tested against NIST certified values
The NIST Statistical Reference Datasets publish values certified to 15 significant digits. Dataset NumAcc1 (10000001, 10000003, 10000002) must give a mean of 10000002 and a standard deviation of 1. NumAcc4 has 1001 values such as 10000000.2, 10000000.1, 10000000.3 and must give a mean of 10000000.2 and a standard deviation of 0.1. Naive formulas fail these tests; this calculator passes all four NumAcc datasets in its automated test suite.
Frequently asked questions
Should I use the sample or the population standard deviation?
Use the population formula (divide by n) when your data include every member of the group. Use the sample formula (divide by n − 1) when the data are a subset used to draw conclusions about a larger group — the usual case in surveys and experiments.
What is the difference between variance and standard deviation?
The standard deviation is the square root of the variance. The variance is in squared units, the standard deviation in the same unit as the data, which makes it easier to interpret.
Can the standard deviation be negative?
No. It is a square root of an average of squares, so it is 0 or positive. It equals 0 only when all values are identical.
What is the coefficient of variation used for?
It expresses the spread as a percentage of the mean, so you can compare variability between data sets with different units or scales, such as the weights of mice and of elephants. It is meaningful only for data measured from a true zero.
What is the standard error of the mean?
It is s ÷ √n: how much the sample mean would typically vary from one sample to another. It shrinks as the sample grows, while the standard deviation of the data does not.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.6 Measures of Scale
- NIST Statistical Reference Datasets — Univariate Summary Statistics (NumAcc1–4)
- B. P. Welford (1962), Note on a method for calculating corrected sums of squares and products, Technometrics 4(3)
- OpenStax, Introductory Statistics 2e, §2.7 Measures of the Spread of the Data
Last updated: