Skip to main content

Variance Calculator

Calculate variance and standard deviation from raw data, a frequency table, or by combining two groups — with a deviations diagram that shows exactly why squaring is needed, plus full step-by-step working.

Background

Variance measures how spread out a dataset is: the average squared distance of each value from the mean. Squaring matters because the plain deviations from the mean always sum to exactly zero — squaring removes the sign so the spread doesn't just cancel itself out.

Set up your data

Step 1 — How is your data given?

Step 2 — Enter your data

Separate values with commas, spaces, or line breaks.

Must have the same number of values in each list, in matching order.

Group A

Group B

Enter each group's sample variance (n−1 style) — combine mode assumes both inputs and outputs are sample-based throughout, since pooled variance is inherently a sample concept used for two-sample t-tests.

Learning options

Result

No result yet. Set up your data above and click Calculate.

How to use this calculator

  • Choose Raw Data to paste a full list of values — toggle population or sample variance depending on whether your data is the entire population or just a sample of it.
  • Choose Frequency Table when your data is already grouped as distinct values with counts, like a tally of survey responses.
  • Choose Combine Two Groups when you have summary statistics (n, mean, variance) for two groups and need either the variance of the full merged dataset, or the pooled variance used in a two-sample t-test — these are genuinely different numbers.
  • Click Calculate to see the deviations diagram, the frequency distribution shape, or the group comparison, plus full step-by-step working.

How variance works

1

Every deviation (x − mean) is squared before averaging — this is why variance is in squared units, and why we usually also report the standard deviation (its square root) in the original units.

2

Population variance divides by N; sample variance divides by n−1 (Bessel's correction) — dividing by a smaller number makes the sample estimate slightly larger, correcting for the tendency of a sample to underestimate the true population spread.

3

A frequency table's variance is mathematically identical to expanding it into a full raw list and computing variance directly — the frequency-weighted formula is just a shortcut that avoids listing every repeated value.

4

The variance of two merged groups is not just an average of their variances — it also includes a term for how far apart the two group means are, since that spread contributes to the combined dataset's total spread too.

5

Pooled variance (used in two-sample t-tests) assumes the two groups share a common population variance and ignores the mean difference entirely — it's a different question from "what's the variance of the merged data."

Formula & Equations Used

Population variance: σ² = Σ(x−μ)² / N

Sample variance: s² = Σ(x−x̄)² / (n−1)

Frequency table: s² = Σf(x−x̄)² / (Σf − 1)

Combined (merged) variance: [SS₁ + SS₂ + n₁(x̄₁−x̄_c)² + n₂(x̄₂−x̄_c)²] / (N−1), where SS is each group's sum of squares.

Pooled variance: s²_p = [(n₁−1)s₁² + (n₂−1)s₂²] / (n₁+n₂−2)

Example Problems & Step-by-Step Solutions

These cover cases the Quick Examples chips above don't already demonstrate.

Example 1 — An entire population

A class of 8 students scores 88, 92, 79, 85, 90, 76, 95, 84 on a quiz. Since this is every student (the whole population), find the population variance.

Step: Mean = 86.125. Sum of squared deviations = 290.875. Divide by N=8.

Result: population variance ≈ 36.36, SD ≈ 6.03.

Example 2 — A sample of measurements

Six repeated lab measurements: 12.1, 11.8, 12.4, 12.0, 11.9, 12.3. This is a sample, not the full population of possible measurements.

Step: Mean = 12.083. Sum of squared deviations = 0.2683. Divide by n−1=5.

Result: sample variance ≈ 0.0537, SD ≈ 0.232.

Example 3 — A frequency table

A survey of ages: 15 (4 people), 16 (7 people), 17 (6 people), 18 (3 people). Treat this as the full population surveyed.

Step: N=20, mean=16.4. Weighted sum of squared deviations = 18.8. Divide by N=20.

Result: population variance = 0.94, SD ≈ 0.97.

Example 4 — Combined vs. pooled, a closer pair of groups

Group A: n=8, mean=100, variance=9. Group B: n=12, mean=104, variance=16. Compare the combined and pooled variances.

Step: Combined mean = 102.4. Combined variance = 16.62. Pooled variance = 13.28 — closer together than in the Quick Examples case, since these two means (100 vs 104) are much nearer each other than 50 vs 60.

Result: combined SD ≈ 4.08, pooled SD ≈ 3.64 — the gap between them shrinks as the group means converge.

Frequently Asked Questions

Why divide by n−1 instead of n for a sample?

A sample's own mean is, by construction, the value closest to all the sample's data points — so squared deviations from a sample mean tend to slightly underestimate the true population spread. Dividing by the smaller n−1 corrects for that bias on average.

Why are the deviations from the mean always zero when added up?

The mean is defined as the balance point of the data — by definition, the positive and negative distances from it always cancel out exactly. That's precisely why variance needs the deviations squared instead of just averaged directly.

Is variance or standard deviation more useful?

Standard deviation is usually easier to interpret, since it's in the same units as the original data (variance is in squared units). Variance is more common inside further formulas and derivations, like ANOVA and pooled variance for t-tests.

Why isn't combining two groups' variances as simple as averaging them?

Merging datasets combines two sources of spread: the spread within each group, and the spread between the two group means. Simply averaging the variances ignores that second source entirely, which is why the merged-dataset variance can be noticeably larger than either group's individual variance.

Back to all calculatorsAll calculators