What is the standard deviation?
Paste your numbers, pick sample or population, and get the standard deviation as you type.
- Standard deviation
- 2.13809
Sample standard deviation of 2, 4, 4, 4, 5, 5, 7, 9: 2.13809, with a mean of 5.
- Variance
- 4.571429
- Mean
- 5
- Count (n)
- 8
- Sum
- 40
- Sum of squares
- 32
- Standard error of the mean
- 0.755929
- Coefficient of variation
- 42.76%
Standard deviation: 2.13809. Sample standard deviation of 2, 4, 4, 4, 5, 5, 7, 9: 2.13809, with a mean of 5.
How are your numbers spread?
How to calculate
Computes the sample or population standard deviation of a list of numbers, with the variance, mean, standard error of the mean, and coefficient of variation.
Example with the default inputs (Your numbers [2, 4, 4, 4, 5, 5, 7, 9], Your numbers are a Sample): Sample standard deviation of 2, 4, 4, 4, 5, 5, 7, 9: 2.13809, with a mean of 5.
Method: Sample: s = √(Σ(x − mean)² ÷ (n − 1)); population: σ = √(Σ(x − mean)² ÷ n); standard error = s ÷ √n; coefficient of variation = SD ÷ mean × 100%.
- A sample divides the sum of squares by n − 1 (Bessel’s correction) and needs at least 2 numbers. A population divides by n.
- The mean is found first, then the squared differences from it are added up (the two-pass method).
- The standard error of the mean is shown for a sample only. The coefficient of variation is shown only when the mean is above 0.
Worked examples
Each example is checked against the calculator on every build.
- Your numbers 2, 4, 4, 4, 5, 5, 7, 9, Your numbers are a Sample gives Standard deviation 2.13809, Variance 4.571429, Mean 5, Sum of squares 32, Standard error of the mean 0.755929, Coefficient of variation 42.761799%.Source: hand calculation in content.mdx: SS = 32, 32 ÷ 7 = 4.5714, √4.5714 = 2.1381; Python statistics.stdev
- Your numbers 2, 4, 4, 4, 5, 5, 7, 9, Your numbers are a Population gives Standard deviation 2, Variance 4, Mean 5, Coefficient of variation 40%.Source: hand calculation in content.mdx: 32 ÷ 8 = 4, √4 = 2; Python statistics.pstdev
- Your numbers 10,000,001, 10,000,003, 10,000,002, Your numbers are a Sample gives Standard deviation 1, Variance 1, Mean 10,000,002, Standard error of the mean 0.57735.Source: NIST StRD univariate dataset NumAcc1: certified sample standard deviation 1 (exact); SEM = 1 ÷ √3
- Your numbers 2.0018, 2.0017, 2.0018, 2.0019, 2.0018, 2.0017, 2.0015, 2.0014, 2.0015, 2.0015, 2.0017, 2.0018, 2.0018, 2.0019, 2.0019, 2.0021, 2.002, 2.0016, 2.0014, 2.0013, 2.0013, 2.0015, 2.0015, 2.0016, 2.0015, 2.0014, 2.0013, 2.0014, 2.0015, 2.0014, 2.0015, 2.0016, 2.0015, 2.0016, 2.0019, 2.002, 2.002, 2.0021, 2.0022, 2.0023, 2.0024, 2.0025, 2.0027, 2.0026, 2.0026, 2.0026, 2.0027, 2.0026, 2.0025, 2.0024, Your numbers are a Sample gives Standard deviation 0.000429, Mean 2.001856.Source: NIST StRD univariate dataset Mavro: certified sample standard deviation 0.000429123454003053 (15 digits; the data are stored as binary doubles, so the tolerance is 1e-12; Python statistics.stdev agrees to 7.5e-14)
- Your numbers 7, Your numbers are a Population gives Standard deviation 0, Variance 0, Mean 7.Source: hand calculation in content.mdx: the only difference from the mean is 0
How it works
For a list of n numbers x₁, …, xₙ with mean x̄ = (x₁ + … + xₙ) ÷ n:
- Sum of squares: SS = Σ(xᵢ − x̄)², each number's difference from the mean, squared, then added up.
- Variance: SS ÷ (n − 1) for a sample (s², NIST e-Handbook 1.3.5.6), or SS ÷ n for a whole population (σ²).
- Standard deviation: the square root of the variance, s = √s² or σ = √σ².
- Standard error of the mean (sample only): s ÷ √n, the scale term in NIST's confidence limits for the mean (e-Handbook 1.3.5.2).
- Coefficient of variation: the standard deviation of your choice divided by the mean, times 100%, shown only when the mean is above 0 (NIST Dataplot, cv = s ÷ x̄).
The calculator also shows the mean, the count n, and the sum.
Assumptions
- Sample is the default. It needs at least 2 numbers, because dividing by n − 1 = 0 is not defined. Population works from 1 number.
- The mean is found first, then the squared differences from it are added up (the two-pass method). This keeps full precision when the numbers share a large common part, such as 10000001, 10000003, 10000002.
- The standard error of the mean is left out for a population, and the coefficient of variation is left out when the mean is 0 or less.
Worked examples by hand
2, 4, 4, 4, 5, 5, 7, 9 as a sample (the default). The sum is 40 and n = 8, so the mean is 40 ÷ 8 = 5. The differences from the mean are −3, −1, −1, −1, 0, 0, 2, 4, and their squares are 9, 1, 1, 1, 0, 0, 4, 16, so SS = 32. The sample variance is 32 ÷ 7 = 4.5714, and the sample standard deviation is √4.5714 = 2.1381. The standard error is 2.1381 ÷ √8 = 0.7559, and the coefficient of variation is 2.1381 ÷ 5 × 100% = 42.76%.
The same list as a population. The population variance is 32 ÷ 8 = 4, and the population standard deviation is √4 = 2. The coefficient of variation is 2 ÷ 5 × 100% = 40%.
10000001, 10000003, 10000002 (NIST's NumAcc1 test data). The mean is 10000002. The differences are −1, 1, 0, so SS = 1 + 1 + 0 = 2. The sample variance is 2 ÷ 2 = 1, and the standard deviation is 1, NIST's certified value. The standard error is 1 ÷ √3 = 0.5774.
7 as a population. The mean is 7, the only difference from it is 0, so the variance and the standard deviation are both 0.
Other questions people ask
How do I calculate the standard deviation by hand?
Find the mean. Subtract the mean from each number and square the result. Add the squares to get the sum of squares. Divide it by n − 1 for a sample, or by n for a whole population, to get the variance. The standard deviation is the square root of the variance.
Should I use the sample or the population standard deviation?
Use the sample standard deviation (divide by n − 1) when your numbers are a sample from a larger group, such as 30 people from a city. Use the population standard deviation (divide by n) only when your numbers are the whole group you care about, such as every student in one class. When unsure, use the sample.
Why does the sample standard deviation divide by n − 1?
The squared differences are measured from the sample mean, which sits closer to the sample than the true mean does. Dividing by n would make the variance too small on average. Dividing by n − 1 (Bessel’s correction) fixes this for the variance.
What does a large or small standard deviation mean?
A small standard deviation means the numbers sit close to their mean. A large one means they are spread out. It is in the same units as your data, so a standard deviation of 2 kg on weights of about 70 kg is a small spread.
What is the standard error of the mean?
It is the sample standard deviation divided by √n. It measures how much the sample mean would vary from sample to sample, so it shrinks as the sample grows. NIST uses it to build confidence limits for the mean: mean ± t × s ÷ √n.
What is the coefficient of variation?
It is the standard deviation as a percent of the mean. It lets you compare the spread of data on different scales. It only makes sense for data with a true zero, such as weights or times, and not when the mean is near 0, so the calculator shows it only when the mean is above 0.
Can the standard deviation be negative?
No. It is the square root of an average of squares, so it is 0 or more. It is 0 only when every number is the same.
What is the difference between variance and standard deviation?
The variance is the average squared difference from the mean, so its units are squared (kg²). The standard deviation is its square root, back in the units of the data (kg), which makes it easier to read.