Standard deviation calculator with working
Sample and population standard deviation and variance from any list of numbers, with the full deviation table, the formula and a dot plot.
- Runs in your browser
- Nothing you enter is sent
- Free, no account
20 values recognised
Sample standard deviation (s)
Mean (x̄)
7
Count (n)
20
Σ(x − x̄)²
178
sum of squares
Sample variance (s²)
9.36842105
Sample SD (n − 1)
3.06078765
Population SD (n)
2.98328678
Standard error of the mean
0.68441293
s ÷ √n
Coefficient of variation
43.7255%
s ÷ |mean|
Step-by-step working
Find the mean of the data.
x̄ = (9 + 2 + 5 + 4 + 12 + 7 + …) ÷ 20 = 7Subtract the mean from each value to get its deviation.
9 − 7 = 2 2 − 7 = -5 5 − 7 = -2 4 − 7 = -3 … and 16 more (see the table below)Deviations always add up to zero, which is exactly why they get squared before being averaged.
Square every deviation and add them up.
Σ(x − x̄)² = 178Divide the sum of squares by n − 1 to get the sample variance.
s² = 178 ÷ 19 = 9.36842105Dividing by n − 1 (the Bessel correction) compensates for measuring deviations from the sample mean rather than the true mean.
Take the square root of the variance.
s = √9.36842105 = 3.06078765
Deviation table
| # | x | x − x̄ | (x − x̄)² |
|---|---|---|---|
| 1 | 9 | 2 | 4 |
| 2 | 2 | -5 | 25 |
| 3 | 5 | -2 | 4 |
| 4 | 4 | -3 | 9 |
| 5 | 12 | 5 | 25 |
| 6 | 7 | 0 | 0 |
| 7 | 8 | 1 | 1 |
| 8 | 11 | 4 | 16 |
| 9 | 9 | 2 | 4 |
| 10 | 3 | -4 | 16 |
| 11 | 7 | 0 | 0 |
| 12 | 4 | -3 | 9 |
| 13 | 12 | 5 | 25 |
| 14 | 5 | -2 | 4 |
| 15 | 4 | -3 | 9 |
| 16 | 10 | 3 | 9 |
| 17 | 9 | 2 | 4 |
| 18 | 6 | -1 | 1 |
| 19 | 9 | 2 | 4 |
| 20 | 4 | -3 | 9 |
| Σ = 140 | Σ ≈ 0 | Σ = 178 |
How to use it
- Paste your numbers. Any separator works — commas, spaces, tabs or one value per line.
- Choose the sample formula (÷ n − 1) or the population formula (÷ n).
- Read the standard deviation, then check the deviation table and the step list to see exactly how it was produced.
Both versions are always shown side by side in the results grid, so you can compare them without switching back and forth.
Sample or population?
This is the only decision the tool asks you to make, and it matters:
| Sample | Population | |
|---|---|---|
| Symbol | s | σ (sigma) |
| Divide by | n − 1 | n |
| Use when | Your numbers are a subset of a bigger group | Your numbers are the entire group |
| Typical case | A survey of 200 customers | The marks of all 30 pupils in one class, when that class is the whole question |
If you are unsure, use the sample formula. Almost all real data is a sample, and dividing by n − 1 errs on the side of reporting slightly more spread rather than less.
Why n − 1? The Bessel correction
Deviations are measured from the sample mean, and the sample mean is by construction the point that makes the sum of squared deviations as small as it can possibly be. Measured from the unknown true population mean, the squares would be larger. Dividing by n − 1 instead of n inflates the result just enough to cancel that bias, giving an unbiased estimate of the population variance. With large n the difference is negligible; with n = 5 it is a 12% difference in the variance, which is not.
The formula, step by step
- Find the mean: x̄ = Σx ÷ n.
- Subtract the mean from every value to get each deviation, x − x̄.
- Square each deviation, so that positive and negative distances both count.
- Add the squares: Σ(x − x̄)².
- Divide by n − 1 (sample) or n (population) to get the variance.
- Take the square root, which returns the answer to the original units.
The deviations always sum to zero — that is a useful check, and it is also the reason step 3 exists. Without squaring, the positive and negative deviations would cancel and every data set would have a spread of zero.
Reading the extra statistics
- Variance — the standard deviation squared. It lives in squared units (squared pounds, squared seconds), which is why the square root is taken for reporting.
- Standard error of the mean — s ÷ √n. How much the sample mean itself would wobble if you drew another sample of the same size. Quadrupling the sample size halves it.
- Coefficient of variation — s ÷ |mean|, as a percentage. Lets you compare the spread of quantities measured in different units.
- Sum of squares — the raw Σ(x − x̄)² before any division. Statistical software reports it constantly, and it is the quantity every variance formula divides.
What the dot plot shows
Each value appears as a dot on a number line, with identical values stacked upward. The dashed line marks the mean and the shaded bands cover one and two standard deviations either side of it. For roughly bell-shaped data you should expect about 68% of the dots inside the inner band and about 95% inside the outer one — the empirical rule. If the dots are lopsided or clustered at one end, the mean and standard deviation are describing the data poorly and the median with the interquartile range is a better summary.
A worked example
Take 2, 4, 4, 4, 5, 5, 7, 9. The mean is 40 ÷ 8 = 5. The deviations are −3, −1, −1, −1, 0, 0, 2, 4 and their squares are 9, 1, 1, 1, 0, 0, 4, 16, summing to 32. The population variance is 32 ÷ 8 = 4, so σ = 2. The sample variance is 32 ÷ 7 ≈ 4.571, so s ≈ 2.138. Paste those eight numbers into the tool and the deviation table will show precisely those rows.
Performance and privacy
The mean and sum of squares are computed in a single pass, so tens of thousands of values are handled instantly. The deviation table renders the first 200 rows to keep the page responsive, while the totals row and every headline statistic always cover the entire data set. Nothing leaves your device.
Questions
Should I use the sample or the population formula?
Use the sample formula, dividing by n − 1, when your numbers are a subset drawn from a larger group. Use the population formula, dividing by n, only when you have measured every member.
Why divide by n − 1 for a sample?
Deviations are measured from the sample mean rather than the unknown true mean, which makes them slightly too small. Dividing by n − 1, the Bessel correction, removes that bias.
What does the dot plot show?
Each value as a point on a number line, with the mean marked and shaded bands at one and two standard deviations, so you can see how spread out and how symmetric the data is.
How many numbers can I paste?
Tens of thousands are fine — the calculation runs in your browser in a single pass. The deviation table shows the first 200 rows so the page stays responsive.
Is the standard error included?
Yes. The standard error of the mean is the sample standard deviation divided by the square root of n, and it is reported alongside variance and the coefficient of variation.