Standard Deviation Calculator: Sample and Population, With Working
Sample and population standard deviation and variance of a list of numbers, with every deviation shown.
Inputs
| x | x − x̄ | (x − x̄)² |
|---|---|---|
| 2 | -3 | 9 |
| 4 | -1 | 1 |
| 4 | -1 | 1 |
| 4 | -1 | 1 |
| 5 | 0 | 0 |
| 5 | 0 | 0 |
| 7 | 2 | 4 |
| 9 | 4 | 16 |
- Working
- mean = 5; sum of squared deviations = 32; ÷ (n − 1 = 7) = 4.5714; √4.5714 = 2.1381
- Mean (x̄)
- 5.0000
- Sample variance (s²)
- 4.5714
- Population standard deviation (σ)
- 2.0000
- Population variance (σ²)
- 4.0000
- Sample size
- 8
Use this calculator on your own site
Free embed
- Two lines of HTML, unlimited views
- Shows a small CalculateEveryday bar, with a credit link under the calculator
What each Standard Deviation input means
- Numbers
- At least two values, separated by commas, spaces or line breaks, so a column pasted from a spreadsheet works. Don't put commas inside numbers (1000, not 1,000). Decimals and negatives are fine, and lists of up to 40 values get a row each in the deviation table.
Standard Deviation formula
s = √(Σ(x − mean)² ÷ (n − 1)) · σ = √(Σ(x − mean)² ÷ n)
Standard deviation measures how far values typically sit from their mean. Work out the mean, subtract it from every value, square those deviations so negatives don't cancel positives, and add them up. Divide by n − 1 for a sample or by n for a whole population — OpenStax Introductory Statistics explains that dividing a sample by n − 1 gives a better estimate of the population's variance — and take the square root. The headline is the sample figure, which matches a spreadsheet's STDEV.S; the population figure, matching STDEV.P, is shown beneath it with both variances and a table of each value's deviation.
Standard Deviation worked example
The values 2, 4, 4, 4, 5, 5, 7, 9 have a mean of 5. Their squared deviations — 9, 1, 1, 1, 0, 0, 4, 16 — add up to 32. As a population, 32 ÷ 8 = 4 and σ = 2 exactly; as a sample, 32 ÷ 7 = 4.571 and s = 2.138. OpenStax's own example, the ages of 20 fifth-graders, gives s = 0.72.
More Standard Deviation examples
Eight test scores: the mean is 80.25 and the squared deviations add up to 837.5. Treated as a sample, 837.5 ÷ 7 = 119.6429 and s = 10.9381; as the whole class, 837.5 ÷ 8 = 104.6875 and σ = 10.2317. A typical score sits roughly 10 to 11 points from the average.
Same mean, different spread, part one: 45, 50, 55 and 50 average 50, and their squared deviations are 25, 0, 25 and 0, totalling 50. 50 ÷ 3 = 16.6667, so s = 4.0825.
Part two: 20, 50, 80 and 50 also average 50, but the squared deviations are 900, 0, 900 and 0, totalling 1,800. 1,800 ÷ 3 = 600, so s = 24.4949 — six times the spread of the first list with the same mean.
Where the Standard Deviation calculator can give the wrong answer
- At least two values are needed; one number has no spread.
- Use the sample figure when your numbers are a sample from something larger (most data), the population figure when they are every member of the group.
- Identical values give 0: no variation at all.
- Commas separate values, so type 1000, not 1,000.
Spotted a mistake? Tell us
Standard Deviation reference table
| Within | Share of values | Outside, both tails together |
|---|---|---|
| ±1 standard deviation | 68.27% | 31.73% |
| ±1.645 | 90% | 10% |
| ±1.96 | 95% | 5% |
| ±2 | 95.45% | 4.55% |
| ±2.576 | 99% | 1% |
| ±3 | 99.73% | 0.27% |
Standard Deviation FAQ
- The divisor. A sample divides the sum of squared deviations by n − 1, a population by n, so the sample figure is a little larger — 2.138 against 2.000 for the example above.
- Find the mean, subtract it from each value, square the results, add them, divide by n − 1 (or n), and take the square root. The page's table shows each step.
- The square of the standard deviation — the average squared deviation before the square root. Variance is in squared units, which is why the standard deviation is easier to read.
- STDEV.S is the sample figure (the headline here) and STDEV.P the population figure. The older STDEV is the same as STDEV.S.
- There is no universally good value; it only means something beside the mean and the units. 10 points on test scores averaging 80 is moderate spread; 10 g on bags meant to weigh 500 g is a lot. The coefficient of variation, s ÷ mean, compares spreads on different scales: 10.9381 ÷ 80.25 is about 14%.
- Squaring makes every deviation positive, weighs large ones more, and gives variance useful algebra — the variances of independent quantities add. The mean absolute deviation is a valid alternative: for 2, 4, 4, 4, 5, 5, 7, 9 it is 12 ÷ 8 = 1.5. It is just not what s or σ report.
- Take its square root. A sample variance of 119.6429 gives s = √119.6429 = 10.9381; going the other way, square the standard deviation to get the variance.