How to Calculate Variance in Statistics

Learn population vs sample variance, the step-by-step formula, squared deviations, and how variance relates to standard deviation — free tool.

By Generatr Team

Variance measures how spread out a set of numbers is around its mean. You average the squared differences from the mean: tight clusters produce small variance; wild swings produce large variance. Standard deviation is simply the square root of variance, back on the original data’s scale.

This guide covers population vs sample formulas, a full worked example, why we square deviations, and how variance connects to SD and z-scores. When you want the arithmetic done from a list, open the free variance calculator and paste your values.

You always need the mean first — refresh that with the free average calculator or our mean, median, and mode guide if needed.

Free tool

Use the Variance Calculator now

Open the interactive variance calculator in your browser — free, instant, no signup.

Open Variance Calculator

What Is Variance in Statistics?

Variance is the average of squared deviations from the mean. If every value equals the mean, variance is 0. If values sit far above and below the mean, variance grows quickly because distances are squared.

Why square?

Raw deviations above the mean are positive and below are negative; their plain average is always 0. Squaring makes every deviation positive and penalizes large outliers more than small ones. That is useful for measuring spread, but it also means variance is in squared units (dollars², cm², points²) — harder to read than standard deviation.

Intuition with two classes

Scores A: 78, 80, 82. Mean = 80. Deviations are small → low variance.

Scores B: 60, 80, 100. Mean = 80. Same center, much larger squared deviations → high variance. Average alone cannot tell these classes apart; variance (or SD) can.

For a full spread toolkit including SD steps, see our standard deviation guide and the free standard deviation calculator.

What Is the Difference Between Population and Sample Variance?

The formulas look almost identical. The denominator is the difference that matters.

  • Population variance (σ²) — you have the entire population of interest. Divide the sum of squared deviations by n.
  • Sample variance (s²) — you have a sample and want to estimate the population’s spread. Divide by n − 1 (Bessel’s correction).

Population: σ² = Σ(xᵢ − μ)² / n

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

When to use which

Use population (÷ n) when the data set is the whole group you care about (every student in a closed class of 20, every machine in a five-machine plant). Use sample (÷ n − 1) when your numbers are a sample used to infer a larger population — the usual case in surveys, experiments, and most lab work.

Dividing by n − 1 makes sample variance a bit larger, which corrects a downward bias that appears if you use the sample mean and still divide by n. For large n the gap shrinks; for n = 5 it is obvious.

Symbols: μ and σ² usually mark population mean and variance; x̄ and s² mark sample mean and sample variance. Software defaults vary — some functions are sample by default (for example many spreadsheet VAR variants). Read the docs before you paste exam data into a random cell formula.

How Do You Calculate Variance Step by Step?

Work a sample variance example with data: 4, 7, 7, 8, 10 (n = 5).

  1. Mean: (4 + 7 + 7 + 8 + 10) ÷ 5 = 36 ÷ 5 = 7.2
  2. Deviations: 4−7.2 = −3.2; 7−7.2 = −0.2; −0.2; 0.8; 2.8
  3. Squared: 10.24; 0.04; 0.04; 0.64; 7.84
  4. Sum of squares: 10.24 + 0.04 + 0.04 + 0.64 + 7.84 = 18.8
  5. Sample variance: 18.8 ÷ (5 − 1) = 18.8 ÷ 4 = 4.7
  6. Population variance (if these five are the whole population): 18.8 ÷ 5 = 3.76

Computational formula (optional)

An algebraically equivalent form uses Σx² and (Σx)² to reduce rounding of many deviations — useful by hand on longer lists. Tools and spreadsheets still follow the same definition.

Paste the list into the free variance calculator to confirm both population and sample results and related stats in one pass.

With n = 2, sample variance is especially sensitive: a single pair of far-apart points produces a large s² because you only divide by 1. That is mathematically correct and a reminder that tiny samples make spread estimates noisy — report them with caution.

How Does Variance Relate to Standard Deviation?

Standard deviation = √variance (population SD = √σ²; sample SD = √s²).

From the example above, sample variance 4.7 → sample SD ≈ √4.7 ≈ 2.17. That 2.17 is in the same units as the original data, so “typical distance from the mean is about 2.2” is easier to say than “variance is 4.7 squared units.”

Which number to report

  • Variance — common in ANOVA, some finance models, and theoretical formulas that stay in squared units
  • Standard deviation — common in reports, quality control charts, and everyday “how spread out is this?” answers

Never mix them: do not average SDs incorrectly or take √ of the wrong variance type. Match population vs sample consistently through mean → variance → SD.

Once you have mean and SD, standardized scores are next — see the free z-score calculator and our z-score guide.

When Does Variance Actually Matter?

Same mean, different variance, different decisions.

  • Quality control — two machines average 100 units; high variance means more out-of-spec parts
  • Risk — two investments average similar returns; higher variance (or SD) often means rockier path
  • Grading and tests — class means can match while one class is polarized and another is consistent
  • Experiments — variance feeds standard errors and confidence intervals that decide if a difference is noise

Coefficient of variation (bonus)

When you compare spread across different means or units, people sometimes use CV = (SD ÷ mean) × 100%. A SD of 5 on a mean of 20 is huge; a SD of 5 on a mean of 500 is small. Many variance tools also show CV for that reason.

Chance models that sit beside descriptive spread are covered in our probability guide and free probability calculator.

How Do You Use an Online Variance Calculator?

Paste or type the data set, choose population or sample mode, and read variance, SD, and related summaries.

  1. Open the free variance calculator.
  2. Enter each value (comma, space, or line separated as the tool allows).
  3. Select population (÷ n) or sample (÷ n − 1) to match your question.
  4. Confirm the mean matches what you expect.
  5. Read variance first, then standard deviation.
  6. Note min, max, or CV if shown for extra context.
  7. Rerun after removing an outlier to see sensitivity — large squared penalties show up fast.

Data hygiene

Exclude blank cells and non-numeric junk. Decide in advance whether a value is a true data point or a data-entry error. Outliers are sometimes the story, not something to delete automatically.

What Are Common Variance Calculation Mistakes?

Most mistakes are denominator choice or unit confusion.

  • Using n when you meant n − 1 (or the reverse) for the research question
  • Averaging absolute deviations and calling it variance (that is a different measure)
  • Forgetting to square before averaging
  • Comparing variance in different units without converting or using CV
  • Reporting variance when readers need SD (or mixing the two in one sentence)
  • Computing SD on population formula then labeling it sample SD

This guide is educational, not a substitute for course requirements or formal statistical consulting. Match your textbook or analysis plan’s population vs sample definition.

Step-by-Step Instructions

  1. 1Open the free variance calculator on Generatr.
  2. 2Gather the numeric data set you want to analyze.
  3. 3Decide whether the set is a full population or a sample.
  4. 4Enter all values into the calculator.
  5. 5Select population variance (÷ n) or sample variance (÷ n − 1).
  6. 6Verify the displayed mean before trusting spread metrics.
  7. 7Read variance and the related standard deviation.
  8. 8Optionally compare results after removing or correcting outliers.

Frequently Asked Questions

How do you calculate variance?+

Find the mean, subtract the mean from each value, square those deviations, sum them, and divide by n for population variance or by n − 1 for sample variance.

Why divide by n − 1 for sample variance?+

Using the sample mean consumes a degree of freedom and tends to underestimate population variance if you divide by n. Dividing by n − 1 (Bessel’s correction) reduces that bias for an unbiased sample variance estimator under common assumptions.

What is the difference between variance and standard deviation?+

Variance is the average squared deviation from the mean. Standard deviation is the square root of variance and uses the same units as the data, so it is often easier to interpret.

Can variance be negative?+

No. Squared deviations are never negative, so variance is always zero or positive. Zero means every value equals the mean.

When should I use population variance?+

When your data set is the entire population you care about, not a sample used to estimate a larger group. If you are inferring about a broader population, prefer sample variance.

Is Generatr’s variance calculator free?+

Yes. It runs in your browser with population and sample modes, standard deviation, and related distribution stats — no signup required.

Ready to try it yourself?

Use the free Variance Calculator — no download, no account.

Launch Variance Calculator