Enter your numbers separated by commas or spaces and choose sample or population. You'll get the variance instantly, along with the mean and standard deviation of your data.
How the variance calculator works
Variance is the average squared distance between your data points and their mean. The calculator computes the mean, subtracts it from every value, squares each difference so under- and over-shoots both count as spread, and then averages the squares — dividing by n for a population or by n − 1 for a sample. The bigger the variance, the more your data scatters away from its average.
The formula
Population: σ² = Σ(x − μ)² ÷ n
Sample: s² = Σ(x − x̄)² ÷ (n − 1)
Here x is each value, μ (or x̄) is the mean of the data, n is the number of values, and Σ means "sum over all values." The standard deviation is just the square root of whichever variance you compute.
Worked example
Take the data set 2, 4, 4, 4, 5, 5, 7, 9 (n = 8).
Mean = 40 ÷ 8 = 5. Squared deviations: 9, 1, 1, 1, 0, 0, 4, 16 — summing to 32.
Population: σ² = 32 ÷ 8 = 4 (standard deviation √4 = 2).
Sample: s² = 32 ÷ 7 ≈ 4.5714 (standard deviation ≈ 2.14).
Variance vs. standard deviation: why keep both?
Standard deviation usually wins for communication because it lives in the same units as your data — "test scores typically vary by about 2 points from the average" makes immediate sense, while "the variance is 4 points squared" does not. So why does variance exist at all? Because it has a property standard deviations lack: variances add. The variance of a sum of independent variables is the sum of their variances — that clean algebra powers everything from portfolio risk models to ANOVA to the formula behind confidence intervals. The working habit of most statisticians: do the math in variances, then take one square root at the end and report the standard deviation.
Frequently asked questions
What is the difference between variance and standard deviation?
Standard deviation is simply the square root of variance. Variance measures spread in squared units (dollars², cm²), while standard deviation converts that back to the original units, which makes it easier to interpret. They contain exactly the same information — one is just the squared version of the other.
How do I calculate variance by hand?
Find the mean, subtract it from each value, square each difference, and add the squares up. Then divide by n if your data is the whole population, or by n−1 if it's a sample. That final number is the variance.
When should I use sample variance instead of population variance?
Use sample variance (dividing by n−1) whenever your data is a subset standing in for a bigger group — a poll, a batch of measurements, a random sample. Use population variance (dividing by n) only when your data is literally every member of the group you're describing.
Why is variance in squared units?
Because each deviation from the mean gets squared before averaging — squaring stops positive and negative deviations from canceling each other out. The side effect is that if your data is in meters, the variance is in square meters. Taking the square root (the standard deviation) undoes this and returns to plain meters.
Can variance be negative?
No. Variance is an average of squared numbers, and squares are never negative, so variance is always zero or positive. A variance of zero means every value in the data set is exactly the same.