Skip to content
2xKit

Variance Calculator

Calculate population and sample variance for a dataset.

Formula v1.0.0GlobalMethodologyReport an issuevariance-calculator-v1
How this is calculated
Population variance = Σ(x − mean)² ÷ n; Sample variance = Σ(x − mean)² ÷ (n − 1)

Assumptions used in this calculation

  • Both variants shown: Both population (÷n) and sample (÷n−1, Bessel's correction) variance are calculated so you can pick the one appropriate to your data.

About this calculator

Variance quantifies how spread out a data set is, but computing it means finding the mean, subtracting it from every value, squaring each difference, summing those squares, and dividing by n or n−1, a multi-step process where a single dropped negative sign or wrong divisor throws off the whole result. This calculator takes a dataset and computes population variance as Σ(x − mean)² ÷ n, used when the dataset is the entire population you care about, and sample variance as Σ(x − mean)² ÷ (n − 1), applying Bessel's correction, used when the dataset is a sample meant to estimate a larger population's spread, alongside the mean and count for reference. Variance itself is expressed in squared units of the original data, which is why standard deviation (its square root) is often preferred when you need a number in the same units as your data. That handles the full multi-step calculation and keeps both interpretations available so you don't have to decide which formula variant to derive from scratch.

Worked example

[2,4,4,4,5,5,7,9]

Result: Population variance = 4

How to use this

  1. 1Paste or type your full dataset, separated by commas or new lines.
  2. 2Read both the population variance and the sample variance, calculated automatically from the same dataset.
  3. 3Use whichever figure matches whether your data represents an entire population or a sample drawn from a larger population.

Troubleshooting

  • Population variance and sample variance give different numbers.

    That's expected, sample variance divides by (n − 1) instead of n, a correction (Bessel's correction) that compensates for the extra uncertainty in estimating variance from a sample rather than a full population, the two will differ, especially for small datasets.

  • Which one should I use for a class of test scores?

    If the scores represent every student in that specific class, use population variance. If the class is meant to represent a larger group (like all students who might take the test), use sample variance instead.

Was this helpful?

Frequently asked questions