x ˉ = n ∑ x , σ 2 = n ∑ ( x − x ˉ ) 2 = n ∑ x 2 − x ˉ 2 , σ = σ 2
On this page
Before you start
This page is easier if you are comfortable with:
What Mean, variance and standard deviation means
The variance measures how far values are from the mean, on average, squared. A large variance means the data is spread out; a small one means the values are close to the mean.
The standard deviation is the square root of the variance. It is in the same units as the data, which makes it easier to interpret.
There are two equivalent ways to calculate the variance: the mean of the squared deviations, or the mean of the squares minus the square of the mean. The sample version is sample variance , the average is the mean, the simple spread is the range , and coding of data shows how a shift and scale change them.
This page is part of Averages and spread in Statistics . Topics that work alongside it: Sample (unbiased) variance , Mean , Range , Coding of data , Estimated mean of grouped data and Median position .
What is it used for? The variance and standard deviation measure how far the data are spread around the mean. The standard deviation is the square root of the variance.
Describing the spread of data, such as test results or heights. Comparing the consistency of two groups. Standardising values for the normal distribution .
How to use mean, variance and standard deviation
Find the mean x ˉ . Find ∑ x 2 , the sum of the squares of the values. Calculate n ∑ x 2 − x ˉ 2 for the variance. Take the square root for the standard deviation.
Graph Data 2, 4, 4, 4, 5, 5, 7, 9 with mean 5 largest: 9 0 1 2 3 4 5 6 7 8 9 0 2 4 6 8 10 Data 2, 4, 4, 4, 5, 5, 7, 9 with mean 5 item value mean = 5 Graph with x from 0 to 9 and y from 0 to 10. Shows bars (8); the curve mean = 5; point largest: 9 at (8, 9). The standard deviation measures the typical distance of the bars from the mean line.
Worked examples
The examples marked with a button were worked out by the solver on this page. You can try each one yourself.
Example 1: find the variance Find the variance of 1, 2, 3, 4, 5.
Try this in the solver: variance of 1,2,3,4,5
Statistics Answer checked
Answer
σ 2 = 2.0000 \sigma^2 = 2.0000 σ 2 = 2.0000 s 2 = 2.5000 (sample variance)
Find the mean
x ˉ = 3
Subtract the mean from each value and square the result
( 1 − 3 ) 2 = 4 , ( 2 − 3 ) 2 = 1 , ( 3 − 3 ) 2 = 0 , ( 4 − 3 ) 2 = 1 , ( 5 − 3 ) 2 = 4
Add the squared differences
∑ ( x − x ˉ ) 2 = 10
Population variance: divide by n (use this when the data is the whole group)
σ 2 = 5 10 = 2
Sample variance: divide by n − 1 (use this when the data is a sample)
s 2 = 4 10 = 2.5
Take the square roots for the standard deviations
σ = 1.4142136 , s = 1.5811388
Check: variance = mean of squares − square of the mean
11 − 9 = 2
Example 2: find the standard deviation Find the standard deviation of 2, 4, 4, 4, 5, 5, 7, 9.
Try this in the solver: standard deviation of 2,4,4,4,5,5,7,9
Statistics Answer checked
Answer
σ = 2.0000 \sigma = 2.0000 σ = 2.0000 s = 2.1381 (sample standard deviation)
Find the mean
x ˉ = 5
Subtract the mean from each value and square the result
( 2 − 5 ) 2 = 9 , ( 4 − 5 ) 2 = 1 , ( 4 − 5 ) 2 = 1 , ( 4 − 5 ) 2 = 1 , ( 5 − 5 ) 2 = 0 , ( 5 − 5 ) 2 = 0 , ( 7 − 5 ) 2 = 4 , ( 9 − 5 ) 2 = 16
Add the squared differences
∑ ( x − x ˉ ) 2 = 32
Population variance: divide by n (use this when the data is the whole group)
σ 2 = 8 32 = 4
Sample variance: divide by n − 1 (use this when the data is a sample)
s 2 = 7 32 = 4.5714286
Take the square roots for the standard deviations
σ = 2 , s = 2.1380899
Check: variance = mean of squares − square of the mean
29 − 25 = 4
Example 3: a small set Find the variance of 2, 4, 6.
Try this in the solver: variance of 2,4,6
Statistics Answer checked
Answer
σ 2 = 2.6667 \sigma^2 = 2.6667 σ 2 = 2.6667 s 2 = 4.0000 (sample variance)
Find the mean
x ˉ = 4
Subtract the mean from each value and square the result
( 2 − 4 ) 2 = 4 , ( 4 − 4 ) 2 = 0 , ( 6 − 4 ) 2 = 4
Add the squared differences
∑ ( x − x ˉ ) 2 = 8
Population variance: divide by n (use this when the data is the whole group)
σ 2 = 3 8 = 2.6666667
Sample variance: divide by n − 1 (use this when the data is a sample)
s 2 = 2 8 = 4
Take the square roots for the standard deviations
σ = 1.6329932 , s = 2
Check: variance = mean of squares − square of the mean
18.666667 − 16 = 2.6666667
Special cases
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
1, 2, 3, 4, 5 mean 3, variance 2, sd 1.414
Σ(x − mean)² ÷ n.
2, 4, 4, 4, 5, 5, 7, 9 mean 5, variance 4, sd 2
A classic set.
The shortcut variance = mean of squares − (mean)²
Σx²/n − mean².
Sample variance divide by n − 1
For 1, 2, 3, 4, 5 it is 2.5.
Word problems
Variance σ² = Σ(x − x̄)² ÷ n and standard deviation σ = √variance. Use n − 1 for a sample.
1 to 5 Find the variance and standard deviation of 1, 2, 3, 4, 5.
Mean 3 Squared deviations 4, 1, 0, 1, 4 = 10 Variance 10 ÷ 5 = 2 sd √2 = 1.4142 Check: ✓ σ² = 2, σ = 1.4142.
The classic set Find the standard deviation of 2, 4, 4, 4, 5, 5, 7, 9.
Mean 5 Squared deviations 9+1+1+1+0+0+4+16 = 32 Variance 4 sd 2 Check: ✓ 2.
Shortcut Higher Use Σx²/n − mean² for 1, 2, 3, 4, 5.
Σx²/n 55 ÷ 5 = 11 mean² 9 Variance 2 Check: ✓ 2.
Sample variance Higher Find the sample variance of 1, 2, 3, 4, 5.
Σ 10 ÷ (n − 1) 10 ÷ 4 = 2.5 Check: ✓ 2.5.
Common mistakes
Forgetting to square Σ(x − mean) = 0 ✗
Σ(x − mean)² ✓
Deviations cancel.
Quoting variance as sd sd = 2 for the first set ✗
√2 ✓
Take the root.
Dividing by n for a sample sample variance 2 ✗
2.5 ✓
Use n − 1 for a sample.
Using the wrong mean mean 2.5 ✗
3 ✓
Add carefully.
Exam tips
Mean first.
Square the deviations.
Divide by n (or n − 1).
sd = √variance.
Shortcut for big sets.
Practice questions
Try each one on paper, then open the answer. Use the solver above to see the full working.
1. Variance of 2, 4, 6 Foundation 8/3
2. Mean of 3, 5, 7, 9 Foundation 6
3. Variance of 1, 3, 5 Foundation 8/3
4. sd of 2, 4, 4, 4, 5, 5, 7, 9 Higher 2
5. Σx² = 60, n = 5, mean 3: find the variance Higher 3
6. Sample variance when Σ(x − mean)² = 18 and n = 7 Higher 3
Practice generator Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Foundation Higher Mixed New question
Solve: …
The practice generator needs JavaScript.
Key terms
Mean The average. Variance Mean squared deviation. Standard deviation Root of the variance. Deviation x − mean. Population Everything of interest. Sample A part of it.
Frequently asked questions
What is the standard deviation? The square root of the variance.
How do I find the variance? Mean of the squared deviations.
When do I divide by n − 1? For a sample estimate.
What is the sd of 1 to 5? 1.4142.
Which page covers the mean? mean.
Which page covers z-scores? standardising a normal distribution.