Standard Deviation Calculator
Paste or type your numbers to get the standard deviation and variance, plus the mean, median, mode, quartiles and outliers, with every step of the working.
Separate them with commas, spaces or new lines. You can paste a column from a spreadsheet.
Type value, frequency on each line, e.g. 15, 2. For grouped data, use class ranges such as 10-20, 5.
Pick Sample if your numbers are part of a bigger group, such as 30 people out of a whole town. Pick Population if you have every value.
Shown on the results. Variance is in units².
Step-by-step working
Frequency table
How your standard deviation is worked out
Find the average, measure how far each number is from it, average the squared gaps, then take the square root.
- 1
Find the mean
170 ÷ 10
= 17 - 2
Square each gap
Σ (x − 17)²
= 518 - 3
Divide by n − 1
518 ÷ 9
= 57.5556 (variance) - 4
Take the square root
√57.5556
= 7.5865
Read more: the formula, a worked example, sample vs population and quartiles
The standard deviation tells you how spread out your numbers are. A small one means most numbers sit close to the average; a big one means they are scattered. It is in the same units as your data, so a standard deviation of 7.6 cm means a typical value is about 7.6 cm from the mean.
The formula
mean = sum of the numbers ÷ how many there are (n)
sample variance s² = sum of (each number − mean)² ÷ (n − 1)
population variance σ² = sum of (each number − mean)² ÷ n
standard deviation = square root of the variance
standard error = s ÷ square root of n
confidence interval = mean ± t × standard error
Worked example
Take the numbers 12, 15, 10, 18, 15, 14, 20, 13, 16 and 37. There are 10 of them and they add up to 170, so the mean is 170 ÷ 10 = 17.
Take 17 away from each number and square the answer: (12 − 17)² = 25, (15 − 17)² = 4, (10 − 17)² = 49, (18 − 17)² = 1, (15 − 17)² = 4, (14 − 17)² = 9, (20 − 17)² = 9, (13 − 17)² = 16, (16 − 17)² = 1 and (37 − 17)² = 400. These add up to 518 (the sum of squares).
As a sample, divide by n − 1 = 9: the variance is 518 ÷ 9 = 57.5556, and the standard deviation is √57.5556 = 7.5865. As a population, divide by 10: the variance is 51.8 and the standard deviation is √51.8 = 7.1972.
The standard error is 7.5865 ÷ √10 = 7.5865 ÷ 3.1623 = 2.3991. With 9 degrees of freedom, the t value for 95% is 2.2622, so the margin of error is 2.2622 × 2.3991 = 5.4271 and the 95% confidence interval for the mean is 17 ± 5.4271 = 11.5729 to 22.4271. The coefficient of variation is 7.5865 ÷ 17 = 44.63%.
Sorted, the numbers are 10, 12, 13, 14, 15, 15, 16, 18, 20, 37. The median is the average of the 5th and 6th values, (15 + 15) ÷ 2 = 15, and the mode is 15 (it appears twice). The lower half (10, 12, 13, 14, 15) has a median of Q1 = 13 and the upper half (15, 16, 18, 20, 37) has Q3 = 18, so the IQR is 18 − 13 = 5. The outlier fences are 13 − 1.5 × 5 = 5.5 and 18 + 1.5 × 5 = 25.5, so 37 is an outlier. Without it, the standard deviation would drop to 3.0322, which shows how much one odd value can stretch it.
Sample or population?
Use population when you have every value you care about, such as the marks of every student in one class. Use sample when your numbers are a part of a bigger group and you want to estimate that group's spread. Dividing by n − 1 instead of n (Bessel's correction) makes up for a sample usually sitting a little closer to its own mean than to the true mean. Spreadsheets do the same thing: STDEV.S is the sample and STDEV.P is the population.
Confidence intervals and t values
The interval uses Student's t-distribution with n − 1 degrees of freedom, which is right when the true standard deviation is unknown. The t value is worked out exactly for your n (not read from a rounded table). For big samples it gets close to the normal value (1.96 for 95%).
| Degrees of freedom | 90% | 95% | 99% |
|---|---|---|---|
| 4 | 2.1318 | 2.7764 | 4.6041 |
| 9 | 1.8331 | 2.2622 | 3.2498 |
| 29 | 1.6991 | 2.0452 | 2.7564 |
| 99 | 1.6604 | 1.9842 | 2.6264 |
| Very large (normal) | 1.6449 | 1.9600 | 2.5758 |
Quartiles: why tools give different answers
There is more than one accepted way to find quartiles. Median of each half (TI-84 calculators and most school textbooks) splits the sorted data in two, leaving out the middle value when n is odd, and takes the median of each half. Inclusive (Excel QUARTILE.INC and Google Sheets) places Q1 at position 1 + 0.25 × (n − 1). Exclusive (Excel QUARTILE.EXC and Minitab) places it at 0.25 × (n + 1). For the example above they give Q1 = 13, 13.25 and 12.75. Pick the one your teacher or software uses.
Outliers
A value is flagged as an outlier when it is below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR (Tukey's fences, the rule box plots use). Values beyond 3 × IQR are called extreme. An outlier is not always a mistake, but it is worth checking.
Grouped data (frequency tables)
With value, frequency rows, each value counts as many times as its frequency, so the answers are exactly the same as typing every value out. With class ranges such as 10-20, 5, each class is represented by its midpoint (15), so the mean and standard deviation are estimates. The median and quartiles use the interpolation formula L + ((position − cumulative frequency before) ÷ class frequency) × class width, and the mode uses L + (f1 − f0) ÷ (2f1 − f0 − f2) × class width for the class with the most values.
The 68–95–99.7 rule
If your data follows a bell curve (a normal distribution), about 68% of values fall within 1 standard deviation of the mean, 95% within 2 and 99.7% within 3. The calculator counts how many of your own values really do, which is a quick check of whether the data looks normal. A z-score tells you how many standard deviations a value is from the mean: z = (value − mean) ÷ standard deviation.
Other measures
- Mean absolute deviation: the average distance from the mean, without squaring.
- Skewness: above 0 means a long tail to the right (a few big values); below 0 means a tail to the left. Sample skewness uses the same formula as Excel SKEW.
- Excess kurtosis: above 0 means heavier tails than a bell curve. Sample kurtosis uses the same formula as Excel KURT.
- Geometric and harmonic means: only shown when every number is above 0.
Common questions
How do I calculate standard deviation?
Find the mean, take it away from each number and square the result, add those squares up, divide by n − 1 for a sample or n for a population, then take the square root. The calculator shows every step with your own numbers.
Should I use sample or population standard deviation?
Use population when you have every value you care about, such as the marks of every student in one class. Use sample when your numbers are part of a bigger group and you want to estimate its spread. In spreadsheets, STDEV.S is the sample and STDEV.P is the population.
Why divide by n − 1 for a sample?
Dividing by n − 1 instead of n is called Bessel's correction. A sample usually sits a little closer to its own mean than to the true mean, so dividing by a slightly smaller number makes up for it and gives a fairer estimate of the whole group's spread.
What does the 68–95–99.7 rule mean?
If data follows a bell curve, about 68% of values fall within 1 standard deviation of the mean, 95% within 2 and 99.7% within 3. The calculator counts how many of your values really do, as a quick check of whether your data looks normal.
How are outliers found?
A value is flagged when it is below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR, the rule box plots use. In the worked example the fences are 5.5 and 25.5, so 37 is an outlier. An outlier isn't always a mistake, but it is worth checking.
Why do calculators give different quartiles?
There is more than one accepted method. Median of each half is used by TI-84 calculators and most textbooks, inclusive by Excel QUARTILE.INC and Google Sheets, and exclusive by Excel QUARTILE.EXC and Minitab. Pick the one your teacher or software uses.
Related calculators
Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.