# Standard Deviation Calculator

The standard deviation measures how far numbers typically sit from their mean. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5, the population standard deviation is 2 and the sample standard deviation is ≈ 2.13809. Use the sample version (divide by n − 1) when the numbers are a sample from a larger group, and the population version (divide by n) when they are every value you care about. Paste numbers separated by commas, spaces or new lines; the calculator also gives the variance, standard error, coefficient of variation, quartiles and a z-score for every value, and shows the working for up to 20 numbers.

Canonical page: https://ponderloop.com/tools/standard-deviation-calculator/
Updated: 2026-10-18

## How to use

How to calculate a standard deviation by hand

1. **Find the mean**: Add the numbers and divide by how many there are: 40 ÷ 8 = 5 for 2, 4, 4, 4, 5, 5, 7, 9.
2. **Find each deviation**: Subtract the mean from every number. For 2, 4, 4, 4, 5, 5, 7, 9 the deviations are −3, −1, −1, −1, 0, 0, 2, 4. They always add up to zero.
3. **Square the deviations**: Square each one so that they are all positive: 9, 1, 1, 1, 0, 0, 4, 16.
4. **Add the squares**: The sum of squared deviations is 32.
5. **Divide by n or n − 1**: Divide by n = 8 for the population variance (4), or by n − 1 for the sample variance (≈ 4.571429).
6. **Take the square root**: The square root of the variance is the standard deviation: 2 for the population and ≈ 2.13809 for the sample.

## Reference tables and worked examples

### Standard deviation of some example lists

Each row is the calculator’s own answer for the numbers in the first column.

| Numbers | Mean | Sample SD | Population SD | Q1 | Q3 |
| --- | --- | --- | --- | --- | --- |
| 2, 4, 4, 4, 5, 5, 7, 9 | 5 | ≈ 2.13809 | 2 | 4 | 5.5 |
| 4, 8, 15, 16, 23, 42 | 18 | ≈ 13.490738 | ≈ 12.315302 | 9.75 | 21.25 |
| 1, 2, 3, 4, 5 | 3 | ≈ 1.581139 | ≈ 1.414214 | 2 | 4 |
| 10, 20, 30, 40, 1000 | 220 | ≈ 436.17657 | ≈ 390.128184 | 20 | 40 |
| 5, 5, 5, 5 | 5 | 0 | 0 | 5 | 5 |
| 0.1, 0.2, 0.3 | 0.2 | 0.1 | ≈ 0.08165 | 0.15 | 0.25 |
| 70 85 90 95 100 | 88 | ≈ 11.510864 | ≈ 10.29563 | 85 | 95 |

### Population or sample: which standard deviation?

Both formulas applied to 2, 4, 4, 4, 5, 5, 7, 9.

| Version | Symbol | Divide the sum of squares by | Use it when | Result |
| --- | --- | --- | --- | --- |
| Population | σ | n | The numbers are the whole group (every student in one class, every part in one batch) | 2 |
| Sample | s | n − 1 | The numbers are a sample used to estimate a larger group (a survey, a few measurements) | ≈ 2.13809 |

### What the results mean

Shown for 2, 4, 4, 4, 5, 5, 7, 9.

| Measure | What it tells you | Result |
| --- | --- | --- |
| Variance | The average squared distance from the mean; the standard deviation squared | 4 (population), ≈ 4.571429 (sample) |
| Standard error of the mean | How precisely the sample mean estimates the true mean: sample SD ÷ √n | ≈ 0.755929 |
| Coefficient of variation | The sample SD as a percentage of the mean, to compare spread across scales | ≈ 42.761799% |
| Interquartile range | The spread of the middle half of the data: Q3 − Q1 | 1.5 |
| Z-score | How many standard deviations a value is from the mean | ≈ −1.403122 for the smallest value, ≈ 1.870829 for the largest |

## How it works

Numbers are read by the same parser as the average calculator: each is an exact decimal, so nothing is rounded on the way in. All values are brought to the same number of decimal places and handled as whole numbers, which makes the sum, mean, median, range and both variances exact fractions: with S = Σx and Q = Σx², the population variance is (nQ − S²) ÷ n² and the sample variance is (nQ − S²) ÷ (n(n − 1)). This single exact pass is free of the cancellation error that makes the textbook shortcut unreliable in floating point (the same job a two-pass or Welford algorithm does there). Standard deviations are square roots of those fractions, found to 12 decimals with integer arithmetic. The standard error of the mean is s ÷ √n, and the coefficient of variation is s ÷ |mean| × 100%. Z-scores are (x − mean) ÷ SD, with the sample or population standard deviation as chosen. Quartiles use the inclusive method (the same as Excel’s QUARTILE.INC): Q1 and Q3 sit at positions (n − 1) × ¼ and (n − 1) × ¾ of the sorted list, counting from 0, and a fractional position is interpolated between its two neighbours. Other methods, such as QUARTILE.EXC, give slightly different quartiles for short lists. The plot groups values into equal-width ranges of a round width (1, 2 or 5 times a power of ten), about five to twelve of them; each range includes its lower edge and excludes its upper edge, and with 60 values or fewer it is drawn with one dot per value. Display rule: a result that ends within 12 decimals is shown in full, anything longer is rounded half away from zero to 6 decimals and marked ≈. Everything runs in your browser and nothing you type is sent anywhere.

## FAQ

### What is the difference between sample and population standard deviation?

The population standard deviation divides the sum of squared deviations by n and is right when your numbers are every value in the group. The sample standard deviation divides by n − 1 and is right when your numbers are a sample used to estimate a larger group. For 2, 4, 4, 4, 5, 5, 7, 9 they are 2 (population) and ≈ 2.13809 (sample). If you are not sure, the sample version is the usual choice, and it is what Excel’s STDEV.S and a calculator’s s button give.

### Why do you divide by n − 1 for a sample?

A sample’s values sit closer to the sample’s own mean than to the true mean of the whole group, so dividing by n would on average understate the variance. Dividing by n − 1 (Bessel’s correction) removes that bias for the variance. The effect fades as n grows: with 8 numbers it matters, with 8,000 it hardly does.

### How do I calculate standard deviation step by step?

Find the mean, subtract it from every value, square those deviations, add them up, divide by n (population) or n − 1 (sample), and take the square root. For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5, the squared deviations add up to 32, and 32 ÷ 8 = 4, whose square root is 2. The calculator writes this working out for lists of up to 20 numbers.

### What is the difference between variance and standard deviation?

The variance is the average squared deviation, and the standard deviation is its square root. The standard deviation is in the same units as the data (dollars, centimetres), while the variance is in squared units. For 2, 4, 4, 4, 5, 5, 7, 9 the population variance is 4 and the population standard deviation is 2.

### Is a high or low standard deviation good?

Neither on its own: it only says how spread out the numbers are, and what counts as large depends on the scale. The coefficient of variation (sample SD ÷ mean) helps compare spread across different scales: ≈ 42.761799% for 2, 4, 4, 4, 5, 5, 7, 9. It is only meaningful when the mean is not near zero, and the calculator reports it as undefined when the mean is exactly 0 (as for -2, -1, 0, 1, 2).

### What is a z-score?

A z-score says how many standard deviations a value is above (positive) or below (negative) the mean: z = (value − mean) ÷ SD. In 2, 4, 4, 4, 5, 5, 7, 9 the value 9 has a z-score of ≈ 1.870829 using the sample standard deviation, and the mean itself has a z-score of 0. You can switch the z-scores between the sample and the population standard deviation. When all the values are equal the standard deviation is 0 and z-scores are undefined.

### How does an outlier affect the standard deviation?

Strongly, because deviations are squared. 10, 20, 30, 40 on their own have a sample standard deviation of ≈ 12.909944; adding 1000 raises it to ≈ 436.17657. The interquartile range is much less affected (20 for 10, 20, 30, 40, 1000), which is why it is often reported beside the median for skewed data.

### How are the quartiles calculated?

Quartiles use the inclusive method (the same as Excel’s QUARTILE.INC): Q1 and Q3 sit at positions (n − 1) × ¼ and (n − 1) × ¾ of the sorted list, counting from 0, and a fractional position is interpolated between its two neighbours. Other methods, such as QUARTILE.EXC, give slightly different quartiles for short lists. For 2, 4, 4, 4, 5, 5, 7, 9, Q1 is 4, Q3 is 5.5 and the interquartile range is 1.5.

### What is the standard error of the mean?

It is the sample standard deviation divided by the square root of n, and estimates how much a sample mean would vary from sample to sample. For 2, 4, 4, 4, 5, 5, 7, 9 it is ≈ 0.755929. It shrinks as the sample grows, while the standard deviation does not. It needs at least 2 numbers.

### What if I enter only one number?

The population standard deviation of a single number is 0. The sample standard deviation, variance, standard error and coefficient of variation divide by n − 1 = 0, so the calculator says they need at least 2 numbers instead of showing a made-up value. The same goes for the list of equal numbers 5, 5, 5, 5, whose standard deviation is 0.

### Is the result exact, even for decimals?

Yes, as far as it can be. Every number is read as an exact decimal and the sums are whole-number sums, so there is no floating-point drift or cancellation: the variance of 0.1, 0.2, 0.3 is exactly ≈ 0.006667 (population) and 0.01 (sample), and the sample standard deviation is 0.1. Only square roots can be endless decimals; those are computed to 12 places and shown rounded to 6 with a ≈ in front. Results that end within 12 decimals are shown in full.

### How many numbers can I paste, and how are they read?

Up to 200,000 numbers of up to 30 digits each are used, and the page says so if more were pasted. Numbers can be separated by commas, spaces, tabs, semicolons or new lines, so a spreadsheet column works. A comma between groups of exactly three digits with no space (1,234) is one number; write 1, 234 with a space for two. Text that is not a number is ignored and listed. The z-score table shows the first 100 values.

## Sources

- [NIST/SEMATECH e-Handbook of Statistical Methods](https://www.itl.nist.gov/div898/handbook/)
- [NIST/SEMATECH e-Handbook, 1.3.5.6 Measures of Scale (standard deviation, variance, interquartile range)](https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm)
- [Standard deviation, Wikipedia](https://en.wikipedia.org/wiki/Standard_deviation)
- [Bessel’s correction, Wikipedia](https://en.wikipedia.org/wiki/Bessel%27s_correction)
- [Quartile, Wikipedia](https://en.wikipedia.org/wiki/Quartile)
- [Standard score (z-score), Wikipedia](https://en.wikipedia.org/wiki/Standard_score)

---

Cite as: Standard Deviation Calculator, ponderloop, https://ponderloop.com/tools/standard-deviation-calculator/, updated 2026-10-18
