Variance Calculator
Population variance divides the sum of squares by N. Sample variance divides by n − 1. Choose your type, enter your data, and the calculator shows the mean, each squared deviation, and the variance with every step.
Variance tells you how far your numbers sit from their average. Enter your data above, pick population or sample, and you get the variance plus every step: the mean, each squared deviation, the sum of squares, and the standard deviation.
Population variance divides the sum of squares by N. Sample variance divides by n minus 1. That single choice is the one thing most people get wrong, and it changes your answer. This page walks through both formulas, three worked examples with real numbers, a quick-reference table, and the mistakes that throw people off.
What is variance?
Variance is the average of the squared distances between each value and the mean. A small variance means your values huddle close to the average. A large variance means they scatter. Because the distances are squared, variance is always zero or positive, and it is measured in squared units. That squared unit is why most people convert it back to standard deviation before reporting it.
Two datasets can share the same mean and look nothing alike. The scores 49, 50, 51 and the scores 10, 50, 90 both average 50. The first has a variance of about 0.67. The second has a variance of about 1067. Same center, wildly different spread. Variance is the number that catches that difference.
How do you calculate variance?
Five steps, same order every time:
- Add all the values and divide by how many there are. That is your mean.
- Subtract the mean from each value to get its deviation.
- Square each deviation.
- Add all the squared deviations. That total is the sum of squares.
- Divide the sum of squares by N for a population, or by n minus 1 for a sample.
The only fork in the road is that last step. Everything before it is identical for both types.
What is the variance formula?
There are two, and they differ by one character in the denominator.
Population variance formula
Use this when your data covers every member of the group you care about, with nothing left out.
σ² = Σ(x − μ)² ÷ N
- σ² is the population variance
- x is each data value
- μ is the population mean
- N is the total count of values
- Σ means sum it all up
Sample variance formula
Use this when your data is a slice of a bigger group, and you want to estimate the whole group’s spread from that slice.
s² = Σ(x − x̄)² ÷ (n − 1)
- s² is the sample variance
- x̄ is the sample mean
- n is the number of observations
Dividing by n minus 1 instead of n is called Bessel’s correction. A sample almost always understates the true spread of the population it came from, so shrinking the denominator nudges the estimate up to compensate. With small samples the difference is large. With big samples it barely matters.
Should I use population or sample variance?
Ask one question: does your data include every single member of the group, or just a portion?
- Every member (all 30 students in one class, all 12 months of the year, every product on the shelf): use population variance, divide by N.
- A portion (200 survey responses out of a city, 50 sampled parts off a production line, 6 test runs): use sample variance, divide by n minus 1.
When you are not sure, sample variance is the safer default in most real analysis, because you are almost always working with a sample rather than a full population.
Variance calculation example (population)
Dataset: 4, 6, 8, 10
Step 1, find the mean. (4 + 6 + 8 + 10) ÷ 4 = 28 ÷ 4 = 7
Step 2 and 3, deviations and squares.
| Value (x) | x − mean | (x − mean)² |
|---|---|---|
| 4 | −3 | 9 |
| 6 | −1 | 1 |
| 8 | 1 | 1 |
| 10 | 3 | 9 |
| Total | 0 | 20 |
Step 4, divide the sum of squares (20) by N.
Population variance = 20 ÷ 4 = 5
If this same set of four numbers were a sample, you would divide by n minus 1: 20 ÷ 3 = 6.67. Same data, different denominator, different answer. The standard deviation of the population version is the square root of 5, about 2.24.
Sample variance example with steps
Dataset: 46, 69, 32, 60, 52, 41 (six test scores treated as a sample)
Step 1. Mean = (46 + 69 + 32 + 60 + 52 + 41) ÷ 6 = 300 ÷ 6 = 50
Steps 2 and 3.
| Value (x) | x − 50 | (x − 50)² |
|---|---|---|
| 46 | −4 | 16 |
| 69 | 19 | 361 |
| 32 | −18 | 324 |
| 60 | 10 | 100 |
| 52 | 2 | 4 |
| 41 | −9 | 81 |
| Total | 0 | 886 |
Step 4. Sample variance = 886 ÷ (6 − 1) = 886 ÷ 5 = 177.2
The standard deviation is the square root of 177.2, about 13.31. If you treated these six scores as a full population instead, the variance would be 886 ÷ 6 = 147.67.
Worked example: a common homework set
Dataset: 10, 12, 23, 23, 16, 23, 21, 16
This eight-number set shows up in a lot of textbooks. Mean = 144 ÷ 8 = 18. The squared deviations add up to a sum of squares of 192.
- Population variance = 192 ÷ 8 = 24, standard deviation about 4.90
- Sample variance = 192 ÷ 7 = 27.43, standard deviation about 5.24
Paste the set into the calculator above and switch between population and sample to see both results side by side with the full table.
How do you find variance on a calculator?
Enter your numbers in the box at the top, separated by commas, spaces, or new lines. Choose population or sample. Press Calculate. You get the variance in the result box, plus the count, sum, mean, sum of squares, and standard deviation, followed by a step-by-step breakdown with the deviation table. No formula memorization needed, though the steps above show exactly what the tool is doing under the hood.
Quick reference: variance of common data sets
Both population and sample variance for small sets people search for often. Handy for checking your own work.
| Data set | Mean | Sum of squares | Population variance | Sample variance |
|---|---|---|---|---|
| 1, 2, 3, 4, 5 | 3 | 10 | 2 | 2.5 |
| 2, 4, 6, 8, 10 | 6 | 40 | 8 | 10 |
| 4, 6, 8, 10 | 7 | 20 | 5 | 6.67 |
| 3, 5, 7, 9, 11 | 7 | 40 | 8 | 10 |
| 10, 20, 30, 40, 50 | 30 | 1000 | 200 | 250 |
| 5, 10, 15, 20, 25 | 15 | 250 | 50 | 62.5 |
| 10, 12, 23, 23, 16, 23, 21, 16 | 18 | 192 | 24 | 27.43 |
Variance vs standard deviation: what is the difference?
Standard deviation is the square root of variance. That is the whole relationship. Variance is in squared units, which makes it awkward to talk about (squared dollars, squared inches). Take its square root and you are back in the original units, which reads naturally. So people usually calculate variance first, then report the standard deviation. Variance 25 means standard deviation 5. Variance 144 means standard deviation 12.
What does the variance number actually mean?
Variance has no fixed scale, so a single number out of context tells you little. A variance of 4 is small for exam scores out of 100 and huge for shoe sizes. What makes variance useful is comparison. Line up two datasets measured on the same scale, and the one with the higher variance is the more spread out, the more volatile, the less predictable. In finance, higher variance in returns signals higher risk. In manufacturing, lower variance means more consistent output. In a classroom, lower variance in scores means the students performed more alike.
Common mistakes when calculating variance
Using the wrong denominator
Dividing by N when you should divide by n minus 1, or the reverse, is the number one error. Decide population or sample before you touch the math, not after.
Forgetting to square the deviations
If you skip the squaring, the deviations cancel out to zero every time, because the positives and negatives balance. The squaring is what makes variance work.
Rounding the mean too early
If your mean comes out to something like 7.333, keep the full value through the calculation. Rounding it to 7.3 at the start throws off every squared deviation and compounds the error.
Confusing variance with standard deviation
They answer the same question in different units. Do not report one when you meant the other. Standard deviation is the square root; variance is the squared value.
Mixing up variance and range
Range is just the highest value minus the lowest. It ignores everything in between. Variance uses every point, which is why it is the more trustworthy measure of spread.
Where variance gets used
Finance uses variance in returns to gauge how risky an investment is, feeding directly into covariance and portfolio models. Quality control tracks variance on a production line to flag when a process drifts out of tolerance. Researchers rely on variance for hypothesis testing and to compare groups. Data scientists watch variance to understand how features behave before feeding them into a model. Anywhere consistency matters, someone is measuring variance.
Frequently asked questions
How do you calculate sample variance?
Find the mean, subtract it from each value, square each result, add those squares to get the sum of squares, then divide by the number of values minus one. The minus one is what separates sample variance from population variance.
How do you find variance quickly?
By hand, follow the five steps: mean, deviations, squares, sum, divide. To skip the arithmetic, paste your numbers into the calculator above and pick population or sample. It shows every step so you can check the work.
Can variance be negative?
No. Every deviation gets squared, and a squared number is never negative, so variance is always zero or greater. A variance of exactly zero means every value in the set is identical.
What is the symbol for variance?
Population variance uses the Greek sigma squared, σ². Sample variance uses a lowercase s squared, s². The squared symbol is a reminder that variance lives in squared units.
Is variance the same as standard deviation?
No, but they are directly linked. Standard deviation is the square root of variance. Variance is in squared units; standard deviation is in the original units, which is why it is easier to interpret.
What is a good variance?
There is no universal good or bad value. It depends entirely on your data and what you are comparing. Lower variance means more consistency; higher variance means more spread. A value only becomes meaningful next to another value measured the same way.
Try these next
- Standard Error Calculator for the precision of a sample mean
- Coefficient of Variation Calculator to compare spread across different scales
- Mean Absolute Deviation Calculator for a spread measure that ignores outliers less harshly
- 5 Number Summary Calculator for min, quartiles, median, and max