Frequently Asked Questions
Why does the sample formula divide by n − 1?
The mean is calculated from the same values, which makes the deviations slightly too small on average. Dividing by n − 1 instead of n corrects that bias in the variance.
How do I calculate standard deviation step by step?
Find the mean, subtract it from each value, square each difference, and add the squares. Divide that total by n − 1 for a sample or by n for a whole population, then take the square root. For the default eight scores the squares add to 650.875, giving s = 9.643 and σ = 9.02. The deviation table shows each step.
Should I use sample or population standard deviation?
Use population (divide by n) when your list includes every member of the group you are describing. Use sample (divide by n − 1) when the list is a subset and you want to estimate the spread of a bigger group. Most real data is a sample, which is why the sample figure is shown as the main result here.
Why does the sample standard deviation divide by n − 1?
Because the mean is calculated from the same values, the data sits slightly closer to its own mean than to the true mean of the wider group. That makes the squared deviations a bit too small. Dividing by n − 1 instead of n corrects the bias. With the default eight scores it raises the result from 9.02 to 9.643.
What is the difference between variance and standard deviation?
Variance is the average squared deviation, and standard deviation is its square root. On the default list the sample variance is 92.982 and the sample standard deviation is 9.643. Standard deviation is in the same units as the data, so it is easier to interpret. Variance is more convenient inside formulas, because independent variances add.
What does the standard error of the mean tell me?
It shows how precisely your sample estimates the true average, not how spread out the values are. It is s divided by the square root of n, which gives 3.409 for the default list. Adding more data shrinks the standard error, while the standard deviation of the values stays roughly the same.
What is a good coefficient of variation?
There is no universal threshold. It depends on the field. The default scores give 11.777%, meaning the typical deviation is about an eighth of the mean. The figure is most useful for comparing the relative spread of two datasets measured on different scales, rather than for judging one dataset alone.
Why does the middle column of the table add to zero?
Because the mean is the balance point of the data. The amounts above it and below it cancel exactly. That is also why spread is measured with squared deviations: averaging the raw deviations would always give zero. Squaring makes every term positive, and the squared column then adds up to 650.875 for the default list.
How many numbers can I enter?
Any number of values from two upwards. Separate them with commas, spaces or new lines, so a column pasted from a spreadsheet works. Two values are enough for the formula, but very small lists give unstable estimates. Each value you add gets its own row in the deviation table so you can check it.
Does adding a constant to every value change the standard deviation?
No. Shifting every value by the same amount moves the mean by that amount too, so every deviation stays the same. Adding ten to each default score leaves s at 9.643. Multiplying every value by a factor does change it: doubling each score doubles the standard deviation, while the coefficient of variation stays the same.
How much can one outlier change the result?
A lot, because deviations are squared. In the default list the lowest score, 66, supplies 38.7% of the squared total by itself. Changing it to 36 raises the sample standard deviation to about 18.48, and removing it lowers it to about 7.78. Check the deviation table for any single row that dominates the total.
Why does my spreadsheet give a different answer?
Most likely it is using the other divisor. In common spreadsheets, STDEV and STDEV.S divide by n − 1 like the sample figure here, while STDEV.P divides by n like the population figure. For the default eight scores those give 9.643 and 9.02. If neither matches, check for blank cells counted as zero or a stray total row.
Eight test scores and a spread of 9.643
The default list is eight scores from one class: 72, 85, 90, 66, 78, 95, 88 and 81. Their mean is 81.875. The sample standard deviation is 9.643, and the population standard deviation, a little lower, is 9.02.
In plain terms, a typical score sits about nine or ten points from the class average. That is the whole job of standard deviation: one number for how far values usually stray from their mean. A class where everyone scored between 80 and 84 would have a small one. A class with scores from 40 to 100 would have a large one, even with the same average.
The page also lists the pieces the result is built from, because standard deviation is easy to get wrong by hand and hard to check from the final figure alone. The deviation table shows every score's distance from the mean and the square of that distance. The squares add up to 650.875. Everything else on the page, both variances and both standard deviations, comes from that one sum.
Reading the deviation table
Each row of the table takes one value, subtracts the mean, and squares the result. The score of 72 sits 9.875 below the mean. The 95 sits 13.125 above it. The 81 is almost exactly average, just 0.875 below.
The middle column always adds up to zero, and the table's last row shows this. That is not a coincidence or a rounding accident. The mean is defined as the point where the distances above and below balance. It is also why you cannot measure spread by averaging the raw deviations: you would get zero every time. Squaring makes every deviation positive, so they stop cancelling out.
Squaring has a side effect worth seeing in the table. Big deviations count for far more than small ones. The 66, the lowest score, contributes 38.7% of the 650.875 total on its own. The 95 contributes another 26.5%. Those two scores together account for almost two thirds of the spread, while the 81 contributes almost nothing. When one value dominates the right-hand column, it is dominating your standard deviation too.
Sample or population: n − 1 versus n
The page gives two answers because there are two different questions. The sample standard deviation, 9.643, divides the squared deviations by n − 1, which is 7 here. The population standard deviation, 9.02, divides by n, which is 8.
Use the population figure when the list is everyone you care about. If these eight scores are the whole class and you only want to describe this class, σ = 9.02 is the right number. Use the sample figure when the list is a sample from something larger and you want to estimate the spread of that larger group. If these eight are a handful of students picked to represent the whole year group, s = 9.643 is the better estimate.
The reason for n − 1 is that the mean was worked out from the same eight scores. The data always sits slightly closer to its own mean than to the true mean of the wider group, so the squared deviations come out a little too small on average. Dividing by one fewer nudges the result back up to correct for it. With a small list the difference is noticeable. With a list of hundreds of values the two answers become almost identical.
If you are not sure which to use, ask whether you would want the answer to change if more data from the same source arrived. If yes, you are estimating, and the sample version is the one.
Variance, and why it is in squared units
The sample variance is 92.982 and the population variance is 81.359. Each is simply the corresponding standard deviation squared, or, put the other way, standard deviation is the square root of variance.
Variance is awkward to read because its units are squared. If the scores are in points, the variance is in points squared, which has no everyday meaning. That is why people usually report standard deviation, which is back in the original units and can be compared directly with the mean.
Variance earns its place in calculations rather than in reports. Variances of independent quantities add together, which standard deviations do not. If you are combining sources of variation, or running a test that compares groups, it is the variance that goes into the formula. The page shows both so you have whichever one the next step needs.
Standard error and coefficient of variation
Two more figures appear beneath the main result. The standard error of the mean is 3.409. It is the sample standard deviation divided by the square root of n, and it measures something different: not how spread out the scores are, but how precisely these eight scores pin down the true average. Collect more scores and the standard error shrinks, even if the spread of scores stays the same.
The coefficient of variation is 11.777%. It is the standard deviation expressed as a percentage of the mean. That makes it useful for comparing spread between things measured on different scales. A spread of nine points means a lot on a test averaging 20 and very little on one averaging several hundred. Dividing by the mean puts them on the same footing.
The coefficient of variation only makes sense when all the values are positive and measured from a true zero, such as weights, prices or times. For temperatures in Celsius, or any data that can be negative, it can be misleading or undefined. The page leaves it out when the mean is zero.
What moves the result, and what does not
Adding the same amount to every value does not change the standard deviation at all. Give every student ten bonus points and the mean rises by ten, but s stays 9.643, because every deviation from the mean is unchanged. The coefficient of variation does change, falling to about 10.5%, because the mean it divides by has grown.
Multiplying every value by the same factor multiplies the standard deviation by that factor. Double every score and s doubles too, while the coefficient of variation stays at 11.777%. That is why converting units, say from metres to centimetres, scales the standard deviation but not the coefficient of variation.
Single values can move the result a long way. Change the 66 to 36 and the sample standard deviation almost doubles, to about 18.48. Remove the 66 entirely and it falls to about 7.78. One unusual value is enough to change the story, which is a good reason to look at the deviation table before trusting the headline figure.
Mistakes that give the wrong answer
The most common slip is using the wrong divisor. Spreadsheets make this easy to do without noticing. In most of them, STDEV and STDEV.S give the sample version and STDEV.P gives the population version. If your spreadsheet and this page disagree, compare its result with both of the figures shown here. For the default list, one will match 9.643 and the other 9.02.
The second slip is rounding the mean too early. If you round 81.875 to 82 before working out the deviations, every row of the table shifts slightly, and the squared total comes out larger than 650.875. On a short list the error is small. On data with many decimal places it can be noticeable. The page keeps full precision until the end.
The third is mixing up what the list represents. If the eight scores are averages of eight classes rather than eight students, the standard deviation describes how class averages vary, which is a much smaller spread than how individual students vary. The arithmetic is identical, but the meaning is not.
Finally, check for stray values before you trust the answer. A missing decimal point, a 0 typed for a blank cell, or a total row pasted in with the data will all show up as a single very large row in the squared column.
When standard deviation is the wrong summary
Standard deviation works best for data that clusters around a middle value and tails off evenly on both sides. For that kind of data, roughly two thirds of the values fall within one standard deviation of the mean. In the default list, five of the eight scores sit between 72.232 and 91.518, which is about what you would expect.
It works less well for skewed data such as incomes, house prices or waiting times, where a few very large values stretch one tail. There the standard deviation is pulled up by the extremes and describes the typical value poorly. The median and interquartile range are usually better summaries, and the statistics calculator on this site gives both.
It is also worth remembering that a list of two or three values gives a very rough estimate. The page accepts as few as two numbers because the formula works, but the result will move a lot if you add a third. For anything you plan to act on, more data is the cure.