Standard Deviation Calculator
Paste a list of numbers to get the mean, variance and standard deviation, and watch the deviation table being worked out row by row.
Population standard deviation (σ)
2
The population standard deviation of these 8 numbers is 2. Mean = 5, variance = 4.
- Mean
- 5
- Variance (σ²)
- 4
- Count
- 8sum 40
Show me how
Why does this work?
All steps as text
Tip: press ← and → to move between steps, or click any step.
Each number
How far each number is from the mean, that distance squared, and its z-score: how many standard deviations it is from the mean.
| # | x | x − μ | (x − μ)² | z-score |
|---|
What standard deviation means
Standard deviation measures how spread out numbers are around their mean. A small standard deviation means the numbers sit close to the mean; a large one means they are spread out. It is in the same units as the numbers, so for heights in cm it is also in cm.
For data that follows a bell curve, about 68% of values lie within one standard deviation of the mean, about 95% within two, and about 99.7% within three.
The formulas
For a whole population of N values with mean μ:
For a sample of n values with mean x̄, divide by n − 1 instead:
The variance is the same calculation without the square root: σ² or s².
Worked example: 2, 4, 4, 4, 5, 5, 7, 9
- Mean: the sum is 40 and there are 8 numbers, so the mean is 40 ÷ 8 = 5.
- Differences from the mean: −3, −1, −1, −1, 0, 0, 2, 4.
- Squares: 9, 1, 1, 1, 0, 0, 4, 16, which add up to 32.
- Variance: as a population, 32 ÷ 8 = 4; as a sample, 32 ÷ 7 ≈ 4.5714.
- Standard deviation: √4 = 2 for the population; √4.5714 ≈ 2.1381 for a sample.
Population or sample?
Use population when you have every value you care about, such as the marks of everyone in one class. Use sample when your numbers are a selection from something bigger, such as 50 people surveyed to learn about a whole town.
A sample’s values sit a little closer to their own mean than to the true mean, so dividing by n would make the spread look too small. Dividing by n − 1 (Bessel’s correction) makes up for it. With many values, the two answers are close.
Exact arithmetic
The mean, the differences, the squares and the variance are worked out as exact fractions, so even numbers like 1000000001, 1000000002 and 1000000003 give the right answer, √(2/3) ≈ 0.816497, where ordinary floating-point arithmetic can lose digits. Only the final square root is rounded. How we check our math.
Questions
What is the difference between variance and standard deviation?
The variance is the average squared distance from the mean; the standard deviation is its square root. The standard deviation is easier to interpret because it is in the same units as the data.
What is a z-score?
How many standard deviations a value is above or below the mean: z = (x − mean) ÷ standard deviation. In the example, 9 has a z-score of (9 − 5) ÷ 2 = 2.
How do I calculate standard deviation in Excel or Google Sheets?
Use =STDEV.P(A1:A8) for a population and =STDEV.S(A1:A8) for a sample. VAR.P and VAR.S give the variances. This calculator gives the same answers.
Can the standard deviation be negative?
No. It is a square root of a sum of squares, so it is 0 or more. It is 0 only when every number is the same.
Why square the differences instead of just adding them?
The differences from the mean always add up to exactly 0, because the values above and below the mean balance out. Squaring makes every difference positive, so they no longer cancel.
Was this calculator helpful?