How Do You Calculate Variance? A Simple Explanation With Real Examples
How to calculate variance step by step: find the mean, the deviations, the squared deviations and the sum of squares, with a fully worked example.
Data Input
Enter data values to see results
Variance tells you how spread out a set of numbers is: how far, on average, the values sit from their mean once each distance is squared. This calculator takes a list of numbers and works that out for you. It finds the mean, subtracts it from every value, squares the differences, adds them up and divides, then shows each of those steps so you can follow or check the working.
It is written for students checking homework, teachers preparing examples, and anyone who needs a quick, reliable figure for a report or a spreadsheet. You get both versions of the answer: sample variance (s²), which divides by n − 1 and is the one to use when your numbers are a sample from a larger group, and population variance (σ²), which divides by n and is for when you have every value in the group. The standard deviation, mean, range and sum of squares come with it.
To use it, type or paste your numbers into the box above, separated by commas, spaces or new lines. You can paste a column straight from Excel or Google Sheets. Choose Sample or Population, and the results and chart update as you type. Everything is calculated in your browser, so your data is not uploaded anywhere.
Understand the mathematics behind variance calculations.
Interactive: Hover over or tap any symbol in the formula to see what it represents.
Uses n − 1 (Bessel's correction) for an unbiased variance estimate from sampled data. This adjustment accounts for degrees of freedom when the true population mean is unknown.
Divides by n directly. No correction needed because the population mean (μ) is the true mean of the whole population.
How Data Flows Through the Formula
Population variance and sample variance differ in one place: the divisor. Population variance divides the sum of squared differences by n (total count). Sample variance divides by n − 1 — Bessel's correction — to produce an unbiased variance estimate from sampled data. This correction matters most with small samples. For large datasets, the difference shrinks.
Variance measures how far each number in a data set sits from the mean. These are the variance calculation steps.
To calculate variance, find the average of the squared differences from the mean. The process is the same for population variance and sample variance — the only difference is whether you divide by n or n − 1 at the end. This statistical variance calculation works for any data set, from survey analysis to machine learning feature selection.
Try it: Enter numbers and watch each step
Type 3–8 numbers separated by commas. The steps below will calculate variance with your data in real time.
Find the Mean (Average)
Add all values in the data set and divide by the count. For [4, 8, 6, 5, 3], the mean is (4+8+6+5+3) ÷ 5 = 5.2. This mean is the center point for every variance calculation.
Subtract Mean to Get Deviations
Subtract the mean from each number to find its deviation. Negative deviations mean the value is below the mean; positive values are above. The sum of deviations always equals 0.
Square Each Deviation
Square each deviation to make it positive. This ensures that deviations below and above the mean don't cancel each other out. Squaring also gives more weight to outliers.
Sum the Squared Deviations
Add all the squared deviations together. This sum is called the Sum of Squares (SS). For our data, it is 1.44 + 7.84 + 0.64 + 0.04 + 4.84 = 14.8.
Divide to Get Variance
Divide the Sum of Squares by N (for population) or n − 1 (for sample). For sample variance, we divide 14.8 by 4 to get 3.7. For population variance, we divide by 5 to get 2.96.
Let's calculate the variance of an 8-value data set: 4, 8, 6, 5, 3, 7, 2, 9.
Consider the data set: 4, 8, 6, 5, 3, 7, 2, 9. We'll calculate both sample variance (s²) and population variance (σ²) for these 8 values. Watch the bar chart below — it shows each data point, the mean line, and the squared deviations as you scroll through each step.
The mean is the center of the data set — every deviation is measured from this point. In the bar chart above, the dashed line marks x̄ = 5.5.
| xᵢ | Deviation (x − x̄) | Squared Deviation (x − x̄)² |
|---|---|---|
| 4 | −1.5 | 2.25 |
| 8 | 2.5 | 6.25 |
| 6 | 0.5 | 0.25 |
| 5 | −0.5 | 0.25 |
| 3 | −2.5 | 6.25 |
| 7 | 1.5 | 2.25 |
| 2 | −3.5 | 12.25 |
| 9 | 3.5 | 12.25 |
Each row shows one data point, its deviation from the mean, and the squared deviation. Notice how values far from x̄ (like 2 and 9) produce much larger squared differences.
This sum of squares (42) represents the total squared distance of all data points from the mean. It's the numerator in both variance formulas.
Follow these checklist steps to calculate variance manually without a calculator.
List all numbers clearly. Count how many values you have (n).
Add all the numbers and divide by n. Note this value.
Subtract the mean from each raw value. Some will be negative.
Multiply each difference by itself. All values must be positive.
Sum the squared differences. This is your Sum of Squares.
This final step gives you the variance.
When the data set includes every member of the group, use population variance — divide by n, not n − 1.
Population variance applies when your data set includes every observation from the whole population — not a sample. Examples: all employees in a company, every test score in a class, all products in a batch during quality control. The formula uses μ (the true population mean) and divides by n (the full count). No Bessel's correction. No degrees of freedom adjustment.
Interactive: How Sample Size Affects Variance
Drag the slider to see how the difference between σ² and s² changes with population size. At small n, the gap is large. As n grows, sample variance converges toward population variance.
Convergence: s² approaches σ² as n grows
Four more data sets worked through to both the population and the sample variance.
1Quiz Scores
Data: 7, 8, 10, 6, 9
Working: Mean = 8. Deviations: −1, 0, 2, −2, 1. Squared: 1, 0, 4, 4, 1. Sum of squares = 10.
Population variance = 10 / 5 = 2 | Sample variance = 10 / 4 = 2.5
2Delivery Times (days)
Data: 3, 5, 2, 4, 6, 3
Working: Mean = 23 / 6 ≈ 3.833. Deviations: −0.833, 1.167, −1.833, 0.167, 2.167, −0.833. Sum of squared deviations ≈ 10.833.
Population variance ≈ 10.833 / 6 ≈ 1.806 | Sample variance ≈ 10.833 / 5 ≈ 2.167
3Daily Calorie Intake
Data: 2100, 1950, 2200, 2050, 1900
Working: Mean = 2040. Squared deviations: 3600, 8100, 25600, 100, 19600. Sum of squares = 57000.
Population variance = 11,400 | Sample variance = 14,250
4Battery Life (hours)
Data: 8.2, 7.9, 8.5, 8, 8.3, 8.1
Working: Mean ≈ 8.167. Sum of squared deviations ≈ 0.2333.
Population variance ≈ 0.0389 | Sample variance ≈ 0.0467
If a result looks surprising, one of these is usually the reason:
9 calculators in total: the variance calculator above plus 8 tools for related measures, each with worked examples, formulas and FAQs.
Standard Deviation Calculator
Calculate population (σ) and sample (s) standard deviation with every step shown: mean, deviations, sum of squares and v…
Mean Calculator
Find the arithmetic mean (average) of any list of numbers, with the sum and count shown. Also returns variance and stand…
Sample Variance Calculator
Calculate sample variance s² with Bessel's correction (n − 1). Shows the sample mean, each deviation, the sum of squares…
Population Variance Calculator
Calculate population variance σ² for a complete data set. Shows the population mean μ, each deviation, the sum of square…
Coefficient of Variation Calculator
Calculate the coefficient of variation (standard deviation ÷ mean × 100%) to compare spread between data sets with diffe…
Percentage Variance Calculator
Express the spread of a data set as a percentage of its mean (coefficient of variation), or find the percent difference …
Pooled Variance Calculator
Combine the variances of two or more independent samples into one pooled estimate, weighted by degrees of freedom, as us…
Poker Variance Calculator
Work out the standard deviation of your poker results from session data, and see how much your results can swing over a …
Everything you need to know about variance.
The population variance of 6, 7, 5, 9, 12, 15 is 12.33 (σ² = 74/6) and the sample variance is 14.8 (s² = 74/5).
For the numbers 1, 2, 3, 4, 5, the population variance is 2 (10/5) and the sample variance is 2.5 (10/4).
In Excel, use =VAR.S(range) to calculate sample variance or =VAR.P(range) to calculate population variance.
Subtract the sample mean from each number, square the differences, sum them up, and divide by n − 1 (s² = Σ(xᵢ − x̄)² / (n − 1)).
Calculate the coefficient of variation by dividing the standard deviation by the mean and multiplying by 100% (CV = (s / x̄) × 100%).
Variance is a statistical metric that measures how far data points are spread out from their average (mean).
Sample variance divides by n − 1 to correct for sampling bias, while population variance divides by n.
The sample variance formula is s² = Σ(xᵢ − x̄)² / (n − 1) and the population variance formula is σ² = Σ(xᵢ − μ)² / n.
Standard deviation is simply the square root of variance (s = √s² and σ = √σ²).
No, variance can never be negative because it is calculated by summing squared differences.
Dividing by n − 1 (Bessel's correction) removes bias when estimating population variance from a sample.
You need at least 1 data point for population variance and at least 2 data points for sample variance.
The coefficient of variation (CV = (s / x̄) × 100%) measures relative variability as a percentage of the mean.
Mean = 30 / 5 = 6. Deviations: −4, −2, 0, 2, 4. Squared: 16, 4, 0, 4, 16. Sum of squares = 40. Population variance σ² = 40 / 5 = 8 and sample variance s² = 40 / 4 = 10. The standard deviations are σ = √8 ≈ 2.828 and s = √10 ≈ 3.162.
Mean = 75 / 5 = 15. Deviations: −10, −5, 0, 5, 10. Squared: 100, 25, 0, 25, 100. Sum of squares = 250. Population variance σ² = 250 / 5 = 50 and sample variance s² = 250 / 4 = 62.5. The standard deviations are σ ≈ 7.071 and s ≈ 7.906.
Yes. Variance is the standard deviation squared. If the standard deviation is 4, the variance is 4² = 16. In the other direction, the standard deviation is the square root of the variance.
Multiply each value by its frequency and divide the total by the sum of the frequencies to get the mean. Then, for each value, multiply its squared deviation from the mean by its frequency, add these up, and divide by N (population) or N − 1 (sample), where N is the total frequency. You can also type the repeated values into the calculator directly.
Every value is the same. For {5, 5, 5, 5} the mean is 5 and every deviation is 0, so the variance is 0. Any difference between values gives a positive variance.
The values are spread far from the mean. Whether that is "high" depends on the scale of the data, so compare it with the mean (using the coefficient of variation) or with other data sets measured the same way.
Yes. For 3 and 7 the mean is 5, each deviation is ±2 and the sum of squares is 8. The population variance is 8 / 2 = 4 and the sample variance is 8 / 1 = 8. Sample variance needs at least two values; with one value it would divide by zero.
Explore our top tutorials, mathematical breakdowns, and practical variance examples.
How to calculate variance step by step: find the mean, the deviations, the squared deviations and the sum of squares, with a fully worked example.
Variance and standard deviation describe the same spread on different scales. How they connect, what their units mean, which to report, and a worked example.
When to use sample variance and when to use population variance, why dividing by n − 1 corrects a bias, and a worked example with both formulas.