Standard Deviation Calculator
Paste a list of numbers — commas, spaces, tabs or new lines all work — and get the sample and population standard deviation side by side, with the variance, the standard error of the mean, and the deviation of every single value.
Measure the spread
Paste or type up to 1,000 numbers. Commas, spaces, tabs, and new lines all separate — so a spreadsheet column pastes straight in. Because a comma separates, do not use one as a thousands separator: type 1234, not 1,234.
Sample is the usual answer: measurements, survey responses, and test scores are nearly always a slice of something bigger. Choose population only when the list is genuinely everything.
8 values, mean 5, summed squared deviations divided by n − 1 = 7. The other divisor gives 2.
- Population standard deviation (σ)
- 2
- Sample variance (s²)
- 4.571429
- Population variance (σ²)
- 4
- Standard error of the mean
- 0.755929
- Values (n)
- 8
- Sum (Σx)
- 40
- Mean (x̄)
- 5
- Minimum
- 2
- Maximum
- 9
- Range
- 7
Two formulas, one sum of squared deviations
Both standard deviations start from the same quantity: add up how far each value is from the mean, squared. What separates them is the number you divide that total by.
σ = √(Σ(x − x̄)² ÷ n) • s = √(Σ(x − x̄)² ÷ (n − 1)) • SE = s ÷ √n- x̄
- The mean — the sum of the values divided by how many
- n
- How many values there are
- σ
- Population standard deviation — the spread of this exact list
- s
- Sample standard deviation — an estimate of the spread of the larger group
- SE
- Standard error of the mean — how far this sample's mean is likely to sit from the true one
Why the sample formula divides by n − 1
That is Bessel's correction, and the reason for it is specific. The sample mean is the value that makes the sum of squared deviations smallest for that sample — pick any other centre and the total goes up. But the population mean the sample came from is almost never exactly the sample mean, so deviations measured from the sample mean are systematically smaller than the deviations that actually exist in the population. Dividing by n − 1 rather than n inflates the estimate by exactly the amount needed to cancel that bias in expectation. It is not a fudge for small samples; it is a correction for measuring from the wrong centre, and the correction happens to matter most when samples are small.
Why this calculator makes two passes over your data
Most textbooks give a one-pass shortcut, Σx² − (Σx)²/n, which is algebraically identical and was genuinely useful when the pass was a person with a pencil. In floating-point arithmetic it is dangerous. When the mean is large relative to the spread, the two terms become nearly equal and very large, and subtracting them cancels away every digit they share — leaving an answer built out of whatever rounding noise was underneath.
Take three values: 100000000.1, 100000000.2 and 100000000.3. They are 0.1 apart, so their sample variance is 0.01 and their standard deviation is 0.1. In double precision the shortcut returns a variance of −2 — not merely imprecise but negative, which a sum of squares divided by a positive number cannot possibly be. This calculator finds the mean first, then sums the real deviations, and returns 0.01. Try those three numbers in the box above; the answer holds up. That is the whole reason for the second pass.
The set 2, 4, 4, 4, 5, 5, 7, 9
This is the list every introductory text uses, and it is the default above. There are eight values and they sum to 40, so the mean is 40 ÷ 8 = 5.
Now the deviations from that mean: −3, −1, −1, −1, 0, 0, +2, +4. Squared, they are 9, 1, 1, 1, 0, 0, 4 and 16, which add to 32. That single number, 32, is everything the two formulas share.
Treat the eight values as the whole population and divide by n = 8: the variance is 32 ÷ 8 = 4 and the standard deviation is √4 = 2, exactly. Treat them as a sample and divide by n − 1 = 7: the variance is 32 ÷ 7 = 4.571429 and the standard deviation is 2.138090. The sample figure is about 7% larger, and that gap is the entire practical effect of Bessel's correction at n = 8.
The standard error of the mean follows from the sample figure: 2.138090 ÷ √8 = 0.755929. Read that as — if this really is a sample of something bigger, the mean of that bigger thing is probably within a point or so of 5, not pinned to 5 exactly.
What this calculator assumes
- Your list is raw observations, not grouped or binned data. A frequency table like “12 values of 4” needs those values written out, or a weighted formula this tool does not implement.
- Every value counts equally. There is no weighting, and nothing is dropped as an outlier — an extreme value moves the mean and inflates the deviation, which is the honest result. If you want it excluded, remove it yourself and say so.
- Commas separate values, so they cannot also be thousands separators. Type 1234, not 1,234, or the tool will read two numbers.
- The standard error is always built from the sample standard deviation, whichever basis you pick. A complete population has no sampling error to report, so on that basis the figure is shown for reference rather than as a claim about your data.
- Nothing here assumes a normal distribution. The standard deviation itself never needed one — but the familiar 68–95–99.7 reading of it does, and that reading fails on skewed data. The histogram is there to let you check.
- Results are rounded to six decimal places for display. The arithmetic underneath runs at full double precision, and the rounding happens once, at the end.
Standard deviation FAQ
Should I use the sample or the population formula?
Ask what the list is. If it is every member of the group you care about — the marks of all 31 students in one class, when the class is the whole question — use the population formula and divide by n. If it is a slice of something larger you want to describe — 31 measurements from a process that will keep producing them, 31 survey responses out of thousands — use the sample formula and divide by n − 1. Sample is the right answer far more often than people expect, because most data is a sample of something.
Why does the sample formula divide by n − 1 instead of n?
This is Bessel's correction, and the reason is subtler than 'small samples need a nudge'. The sample mean is, by construction, the point that makes the sum of squared deviations as small as it can possibly be for that sample — no other centre gives a smaller total. But the true population mean is almost never exactly the sample mean, so measuring spread from the sample mean systematically understates it. Dividing by n − 1 rather than n inflates the result by exactly enough to cancel that bias on average. The shortfall shrinks as n grows, which is why the two formulas converge: at n = 5 the sample figure is about 12% larger, at n = 100 about 0.5%.
What is the difference between standard deviation and standard error?
Standard deviation describes the data: how far a typical single value sits from the mean. Standard error of the mean describes an estimate: how far this sample's mean is likely to sit from the mean of the group it was drawn from. It is s ÷ √n, so it shrinks as you collect more data while the standard deviation does not. If eight values have a standard deviation of 2.14, collecting eight hundred more will not change that much — but it will shrink the standard error from 0.76 towards nothing.
Is a standard deviation of 2 high or low?
Neither on its own — it carries the units of the data, so it is only meaningful next to the mean. Two points of spread around a mean of 5 is enormous; two points around a mean of 5,000 is nothing. The usual way to compare across scales is the coefficient of variation, standard deviation divided by the mean, which for the default list here is 2.14 ÷ 5 = 0.43, or 43%.
Why not use the Σx² − (Σx)²/n shortcut my textbook shows?
Because it breaks on real data. The shortcut is algebraically identical and needs only one pass, which mattered when the pass was a person with a pencil. In floating-point arithmetic it subtracts two nearly equal, very large numbers, and the leading digits they share cancel away — leaving an answer assembled from rounding noise. For the values 100000000.1, 100000000.2 and 100000000.3, whose sample variance is plainly 0.01, the shortcut returns −2 in double precision: a negative variance, which is arithmetically impossible. This calculator finds the mean first and then sums the actual deviations, so it returns 0.01.
Does standard deviation assume the data is a bell curve?
No. The calculation is just the root-mean-square distance from the mean and works on any list of numbers. What does assume a bell curve is the familiar interpretation — that about 68% of values fall within one standard deviation and 95% within two. On skewed data, or data with a long tail, those percentages are wrong, sometimes badly. The histogram above is there so you can check the shape before you lean on that rule.
Sources and review notes
- NIST/SEMATECH e-Handbook of Statistical Methods §1.3.5.6 — measures of scale, including the definitions of variance and standard deviation used here
- NIST/SEMATECH e-Handbook of Statistical Methods — the full handbook, jointly produced by NIST and SEMATECH
The formulas here are definitional and have no data behind them to go stale. What can go wrong is the arithmetic, which is why the engine behind this page is a pure function under unit test, including a case built specifically to fail if the one-pass shortcut ever creeps back in.