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.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
Standard deviation of 8 numbers
Sample SD ≈ 2.13809
Population SD 2, mean 5, sample variance ≈ 4.571429.
- Count
- 8
- Sum
- 40
- Mean
- 5
- Median
- 4.5
- Mode
- 4 (appears 3 times)
- Minimum
- 2
- Maximum
- 9
- Range
- 7
- First quartile (Q1)
- 4
- Third quartile (Q3)
- 5.5
- Interquartile range (IQR)
- 1.5
- Population variance (σ²)
- 4
- Sample variance (s²)
- ≈ 4.571429
- Population standard deviation (σ)
- 2
- Sample standard deviation (s)
- ≈ 2.13809
- Standard error of the mean
- ≈ 0.755929
- Coefficient of variation
- ≈ 42.761799%
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.
Standard deviation: the working
- Find the mean: 40 ÷ 8 = 5.
- Subtract the mean from each value (its deviation) and square the result. Squaring makes every term positive.
- Add the squared deviations: 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32.
- Population variance, dividing by n = 8: 32 ÷ 8 = 4.
- Sample variance, dividing by n − 1 = 7: 32 ÷ 7 ≈ 4.571429.
- Take the square root of the variance: population SD = √4 = 2; sample SD = √(32 ÷ 7) ≈ 2.13809.
- Values marked ≈ are rounded for display only; the calculation itself is exact.
| Value | Deviation from mean | Squared deviation |
|---|---|---|
| 2 | −3 | 9 |
| 4 | −1 | 1 |
| 4 | −1 | 1 |
| 4 | −1 | 1 |
| 5 | 0 | 0 |
| 5 | 0 | 0 |
| 7 | 2 | 4 |
| 9 | 4 | 16 |
| Sum of squared deviations | 32 | |
Frequency and dot plot
| Range | Values | Share |
|---|---|---|
| 2 to under 4 | 1 | 12.5% |
| 4 to under 6 | 5 | 62.5% |
| 6 to under 8 | 1 | 12.5% |
| 8 to under 10 | 1 | 12.5% |
Z-scores
z = (value − mean) ÷ SD, using the sample standard deviation (n − 1).
| # | Value | Z-score |
|---|---|---|
| 1 | 2 | ≈ −1.403122 |
| 2 | 4 | ≈ −0.467707 |
| 3 | 4 | ≈ −0.467707 |
| 4 | 4 | ≈ −0.467707 |
| 5 | 5 | 0 |
| 6 | 5 | 0 |
| 7 | 7 | ≈ 0.935414 |
| 8 | 9 | ≈ 1.870829 |
Standard deviation of some example lists
| 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?
| 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
| 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 to calculate a standard deviation by hand
- 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.
- 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.
- Square the deviations. Square each one so that they are all positive: 9, 1, 1, 1, 0, 0, 4, 16.
- Add the squares. The sum of squared deviations is 32.
- 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).
- Take the square root. The square root of the variance is the standard deviation: 2 for the population and ≈ 2.13809 for the sample.
Frequently asked questions
- 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.
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.
Sources
More free tools
- Average CalculatorPaste a list of numbers and get the mean, median, mode, range, sum, count and standard deviation, plus a weighted average, with the working shown.
- Final Grade CalculatorFind the score you need on the final exam to reach the grade you want, from your current grade and the final’s weight, or from weighted categories.
- GPA CalculatorWork out your GPA from credits and letter grades or percentages: unweighted, weighted (Honors, AP/IB), cumulative, and the GPA you need next.
- Random Number GeneratorPick a random number between any two numbers, draw several with or without repeats, flip a coin or roll dice. Fair, unbiased and drawn on your device.
- Percentage CalculatorWork out X% of Y, what percent X is of Y, percentage change, a % increase or decrease, and the original before a discount, with the formula shown.
- Fraction CalculatorAdd, subtract, multiply and divide fractions and mixed numbers like 2 3/8 + 1 5/16, simplify, and convert to decimals, with every step shown.