Skip to main content
ponderloop

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

Separate numbers with commas, spaces, tabs or new lines, or paste a column from a spreadsheet. 1,234 reads as one thousand two hundred thirty-four; write 1, 234 for two numbers.

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

  1. Find the mean: 40 ÷ 8 = 5.
  2. Subtract the mean from each value (its deviation) and square the result. Squaring makes every term positive.
  3. Add the squared deviations: 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32.
  4. Population variance, dividing by n = 8: 32 ÷ 8 = 4.
  5. Sample variance, dividing by n − 1 = 7: 32 ÷ 7 ≈ 4.571429.
  6. Take the square root of the variance: population SD = √4 = 2; sample SD = √(32 ÷ 7) ≈ 2.13809.
  7. Values marked ≈ are rounded for display only; the calculation itself is exact.
Each value, its deviation from the mean and the square of that deviation
ValueDeviation from meanSquared deviation
2−39
4−11
4−11
4−11
500
500
724
9416
Sum of squared deviations32

Frequency and dot plot

Dot plot of the valuesDot plot of the values: 8 values from 2 to 9 in 4 groups; the fullest group is 4 to under 6 with 5 values. The mean is 5.mean 5246810
Dot plot: one dot per value, grouped in equal-width ranges; the dashed line marks the mean.
The same counts as a table
RangeValuesShare
2 to under 4112.5%
4 to under 6562.5%
6 to under 8112.5%
8 to under 10112.5%

Z-scores

z = (value − mean) ÷ SD, using the sample standard deviation (n − 1).

Z-score of each value, in the order entered
#ValueZ-score
12≈ −1.403122
24≈ −0.467707
34≈ −0.467707
44≈ −0.467707
550
650
77≈ 0.935414
89≈ 1.870829

Standard deviation of some example lists

Each row is the calculator’s own answer for the numbers in the first column.
NumbersMeanSample SDPopulation SDQ1Q3
2, 4, 4, 4, 5, 5, 7, 95≈ 2.13809245.5
4, 8, 15, 16, 23, 4218≈ 13.490738≈ 12.3153029.7521.25
1, 2, 3, 4, 53≈ 1.581139≈ 1.41421424
10, 20, 30, 40, 1000220≈ 436.17657≈ 390.1281842040
5, 5, 5, 550055
0.1, 0.2, 0.30.20.1≈ 0.081650.150.25
70 85 90 95 10088≈ 11.510864≈ 10.295638595

Population or sample: which standard deviation?

Both formulas applied to 2, 4, 4, 4, 5, 5, 7, 9.
VersionSymbolDivide the sum of squares byUse it whenResult
PopulationσnThe numbers are the whole group (every student in one class, every part in one batch)2
Samplesn − 1The 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.
MeasureWhat it tells youResult
VarianceThe average squared distance from the mean; the standard deviation squared4 (population), ≈ 4.571429 (sample)
Standard error of the meanHow precisely the sample mean estimates the true mean: sample SD ÷ √n≈ 0.755929
Coefficient of variationThe sample SD as a percentage of the mean, to compare spread across scales≈ 42.761799%
Interquartile rangeThe spread of the middle half of the data: Q3 − Q11.5
Z-scoreHow 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

  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.

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

All toolsHome & DIY calculators