Standard Deviation Calculator
Paste a list of numbers to get the sample and population standard deviation, variance, mean, range and coefficient of variation, with step-by-step working.
What is a standard deviation calculator?
This standard deviation calculator measures how spread out a list of numbers is. Paste or type your values and it returns the sample standard deviation (s) and the population standard deviation (σ), the sample and population variance, the mean, the count, the sum, the sum of squared deviations, the minimum, maximum and range, and the coefficient of variation. A one-line summary of the working is included, so you can check each stage of a hand calculation against it.
Standard deviation is, roughly, the typical distance between a value and the mean. A small standard deviation means the values sit close to the mean; a large one means they are scattered far from it. It is measured in the same units as the data (points, inches, seconds), which makes it easier to interpret than the variance, whose units are squared.
The two versions differ only in the final division. Use the sample standard deviation when your numbers are a sample drawn from a larger group, which covers most homework, lab and survey data. Use the population standard deviation when your numbers are the entire group you want to describe. The calculator shows both side by side, so you can report the one your course or software expects. If you also need the median, mode, quartiles or outliers, use the statistics calculator.
Formula
For a list of n values x₁, x₂, …, xₙ:
- Mean: x̄ = Σx ÷ n, the sum of the values divided by how many there are.
- Sum of squared deviations: Σ(x − x̄)². Subtract the mean from every value, square each difference, and add the squares.
- Sample variance: s² = Σ(x − x̄)² ÷ (n − 1), and sample standard deviation: s = √s².
- Population variance: σ² = Σ(x − x̄)² ÷ n, and population standard deviation: σ = √σ².
- Range = maximum − minimum.
- Coefficient of variation = s ÷ |x̄| × 100%.
Why divide by n − 1 for a sample?
A sample's deviations are measured from the sample's own mean, and that mean always sits in the middle of those particular values. As a result, the squared deviations come out a little smaller, on average, than they would if they were measured from the true population mean, and dividing by n would understate the population's spread. Dividing by n − 1 instead (Bessel's correction) makes the sample variance an unbiased estimate of the population variance. Because n − 1 is smaller than n, the sample standard deviation is always somewhat larger than the population standard deviation for the same data, and the gap shrinks as n grows.
Coefficient of variation
The coefficient of variation expresses the sample standard deviation as a percentage of the mean, so you can compare spread between data sets with different units or very different averages. This calculator divides by the absolute value of the mean and multiplies by 100, the percentage form that NIST also calls the relative standard deviation. It is not reported when the mean is 0 or when there is only one value. It is only meaningful for ratio-scale data, where zero means "none" (lengths, weights, times, counts). Do not use it for temperatures in °F or °C, and be wary of it when the mean is close to zero, where small changes in the mean swing it wildly.
Worked example
Example 1: the full calculation by hand
Data: 2, 4, 4, 4, 5, 5, 7, 9 (n = 8).
- Mean: 40 ÷ 8 = 5.
- Subtract the mean from each value: −3, −1, −1, −1, 0, 0, 2, 4.
- Square the differences: 9, 1, 1, 1, 0, 0, 4, 16. Their sum is 32.
- Sample variance: 32 ÷ 7 ≈ 4.5714, so s = √4.5714 ≈ 2.1381.
- Population variance: 32 ÷ 8 = 4, so σ = √4 = 2.
The range is 9 − 2 = 7, and the coefficient of variation is 2.1381 ÷ 5 × 100 ≈ 42.76%. The calculator's Step-by-step working line shows the same mean, sum of squared deviations and divisions.
Example 2: the default data
Data: 4, 8, 15, 16, 23, 42 (n = 6). The sum is 108, so the mean is 108 ÷ 6 = 18.
- Deviations from the mean: −14, −10, −3, −2, 5, 24.
- Squared: 196, 100, 9, 4, 25, 576, which add up to 910.
- Sample variance (s²) = 910 ÷ 5 = 182, so the sample standard deviation (s) = √182 ≈ 13.4907.
- Population variance (σ²) = 910 ÷ 6 ≈ 151.6667, so the population standard deviation (σ) ≈ 12.3153.
- Range = 42 − 4 = 38; coefficient of variation ≈ 74.95%.
Notice that the single value 42 contributes 576 of the 910, about 63% of the total. Squaring gives large deviations a heavy weight, which is why one extreme value can inflate the standard deviation so much.
Example 3: same mean, different spread
Two classes take the same quiz. Both have a mean of 80, but their scores are spread differently.
| Class | Scores | Σ(x − mean)² | Sample SD (s) | Population SD (σ) | Coefficient of variation |
|---|---|---|---|---|---|
| A | 70, 75, 80, 85, 90 | 250 | 7.9057 | 7.0711 | 9.88% |
| B | 60, 70, 80, 90, 100 | 1000 | 15.8114 | 14.1421 | 19.76% |
Every score in Class B is twice as far from 80 as the matching score in Class A, so its standard deviation is exactly twice as large. The mean alone would make the two classes look identical; the standard deviation shows that Class B's results are far less consistent.
How to use this calculator
- Type or paste your numbers into the box. Separate them with commas, spaces, semicolons, tabs or new lines; a column copied from Excel or Google Sheets can go straight in.
- Check that Count (n) matches the number of values you meant to enter. Anything that is not a plain number is skipped without a warning.
- Read the headline Sample standard deviation (s), or use Population standard deviation (σ) if your data is the whole group.
- Compare your own working with Step-by-step working, which shows the mean, the sum of squared deviations and both divisions.
Input tips
- Do not use commas as thousands separators: 1,250 is read as two numbers, 1 and 250.
- Negative numbers can be typed with the hyphen-minus key (-2.5) or pasted with a typographic minus sign (−2.5) from a word processor or PDF; both are read as negative.
- Dollar and percent signs are ignored, so $5 is read as 5 and 85% as 85. A unit written straight after a number (5kg) or a word such as n/a makes that entry unreadable, and it is skipped.
- Decimals are fine. Results are shown to 4 decimal places, and the coefficient of variation to 2.
Which result should I use?
- Sample standard deviation (s): the usual choice for a sample, and what Excel's STDEV.S and a TI-84's Sx give.
- Population standard deviation (σ): when the list is every member of the group, such as all students in one class.
- Variance: when a later formula asks for it; it is the standard deviation squared, in squared units.
- Coefficient of variation: when comparing spread between data sets with different means or units.
- Range: a quick check only, because it depends on just the two most extreme values.
For more on interpreting the result, read standard deviation explained and the 68-95-99.7 rule. If your data is skewed, mean vs median vs mode explains why the median may describe it better.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods — Measures of Scale (variance, standard deviation and range)
- NIST Dataplot — Coefficient of Variation
- Texas Instruments — Solution 12009: Calculating Variance on the TI-83 Plus Family of Graphing Calculators (Sx and σx)
Frequently asked questions
Should I use the sample or the population standard deviation?
Use the population standard deviation (σ) only when your numbers are every member of the group you are describing, for example the scores of every student in one class when you care only about that class. Use the sample standard deviation (s) when your numbers are a sample used to say something about a larger group, such as 30 measurements from a production run or a survey of some students in a school. If you are unsure, report the sample version and say so.
Why is the sample standard deviation larger than the population standard deviation?
Both start from the same sum of squared deviations, but the sample version divides it by n − 1 and the population version by n. Dividing by a smaller number gives a larger result. For the default data (4, 8, 15, 16, 23, 42) the sum of squared deviations is 910, giving s ≈ 13.4907 and σ ≈ 12.3153. With large data sets the two become almost equal.
What does the standard deviation actually tell me?
It tells you how far values typically fall from the mean, in the data's own units. If a class's test scores have a mean of 80 and a standard deviation of 5, most scores are a few points from 80; with a standard deviation of 15 they are scattered much more widely. For data that is roughly bell-shaped (normal), about 68% of values lie within 1 standard deviation of the mean, about 95% within 2 and about 99.7% within 3. That rule does not hold for strongly skewed data. See the 68-95-99.7 rule for details.
Why is the sample standard deviation undefined for a single number?
The sample formula divides by n − 1, which is 0 when there is only one value, and division by zero is undefined. With one value the population standard deviation and the population variance are 0, because there is no spread at all, and the calculator says so in Step-by-step working. You need at least two values for a sample standard deviation.
What is the difference between variance and standard deviation?
The variance is the average squared deviation from the mean (dividing by n − 1 for a sample or n for a population), and the standard deviation is its square root. Variance is in squared units, so test scores give a variance in "points squared," which is hard to picture. Taking the square root returns the spread to the original units. In Example 1 above, the population variance is 4 and the population standard deviation is 2.
Does this match my TI-84 or Excel?
It should. On a TI-84, 1-Var Stats shows Sx, the sample standard deviation (n − 1), and σx, the population standard deviation (n). In Excel, STDEV.S uses the n − 1 method and STDEV.P the n method. For 2, 4, 4, 4, 5, 5, 7, 9 all of them should give 2.1381 for the sample version and 2 for the population version. If your answer differs, check which version you used and whether a value was skipped or mistyped.
Can a standard deviation be zero or negative?
It can never be negative, because it is the square root of a sum of squares. It is zero only when every value is identical; for 5, 5, 5, 5 both standard deviations are 0. Any spread at all, however small, gives a positive result.
What counts as a high coefficient of variation?
There is no universal cutoff. What counts as high depends on the field and what is being measured, so compare the coefficient of variation with similar data sets rather than with a fixed number. In Example 3, Class B's 19.76% is twice Class A's 9.88%, which tells you Class B's scores are relatively twice as spread out.