Variance Calculator

Data Input

Separate values with commas, spaces, tabs, or new lines
0 values entered

Enter data values to see results

A variance calculator is a tool (online or built into software) that automatically computes the variance of a data set for you — so you don't have to manually calculate the mean, find deviations, square them, and average them yourself.

What you typically input:

  • A list of numbers (e.g., 2, 4, 4, 4, 5, 5, 7, 9)

What it outputs:

  • The mean
  • The variance (often both population and sample variance, since they differ slightly)
  • Usually the standard deviation too, since it's directly derived from variance

Variance Formula

Understand the mathematics behind variance calculations.

Interactive: Hover over or tap any symbol in the formula to see what it represents.

= ( ) /
Click any symbol in the formula above to see its role in the variance equation.
Sample Sample Variance Formula
= Σ ( xᵢ ) ² / ( n 1 )

Uses n − 1 (Bessel's correction) for an unbiased variance estimate from sampled data. This adjustment accounts for degrees of freedom when the true population mean is unknown.

Population Population Variance Formula
σ² = Σ ( xᵢ μ ) ² / n

Divides by n directly. No correction needed because the population mean (μ) is the true mean of the whole population.

How Data Flows Through the Formula

🔢 Data Raw numbers
⚖️ Mean Balance point
↔️ Deviations xᵢ − mean
Squared (xᵢ − mean)²
Variance σ² or s²
The only difference: population variance divides by n, sample variance divides by n − 1. Everything else in the variance equation is identical. The n − 1 correction matters most with small sample sizes — for very large samples, the difference between population variance and sample variance becomes negligible. Software like Excel, R, Python, SPSS, and Google Sheets all use these same formulas.
Population vs. Sample

Population Variance and Sample Variance Calculator

Population variance and sample variance differ in one place: the divisor. Population variance divides the sum of squared differences by n (total count). Sample variance divides by n − 1 — Bessel's correction — to produce an unbiased variance estimate from sampled data. This correction matters most with small samples. For large datasets, the difference shrinks.

Whole Population (N) Sample (n)
20 of 20 data points used
Population
σ² = Σ(xᵢ − μ)² / n
Divides by n because you have every data point in the whole population. The mean (μ) is exact — no correction needed.
σ² Population Variance
  • Uses every data point in the whole population
  • Divides sum of squares by n
  • Mean symbol: μ (mu) — the true population mean
  • Used in census data, full datasets, quality control
Sample Variance
  • Uses a subset of sampled data from the population
  • Divides sum of squares by n − 1 (degrees of freedom)
  • Mean symbol: (x-bar) — estimated mean
  • Used in surveys, experimental design, clinical trials
Method

How to Calculate Variance

Variance measures how far each number in a data set sits from the mean. These are the variance calculation steps.

To calculate variance, find the average of the squared differences from the mean. The process is the same for population variance and sample variance — the only difference is whether you divide by n or n − 1 at the end. This statistical variance calculation works for any data set, from survey analysis to machine learning feature selection.

Try it: Enter numbers and watch each step

Type 3–8 numbers separated by commas. The steps below will calculate variance with your data in real time.

1

Find the Mean (Average)

Add all values in the data set and divide by the count. For [4, 8, 6, 5, 3], the mean is (4+8+6+5+3) ÷ 5 = 5.2. This mean is the center point for every variance calculation.

x̄ = Σxᵢ / n
0 3 4 5 6 8 x̄ = 5.2
2

Subtract Mean to Get Deviations

Subtract the mean from each number to find its deviation. Negative deviations mean the value is below the mean; positive values are above. The sum of deviations always equals 0.

dᵢ = xᵢ − x̄
3

Square Each Deviation

Square each deviation to make it positive. This ensures that deviations below and above the mean don't cancel each other out. Squaring also gives more weight to outliers.

(xᵢ − x̄)²
4

Sum the Squared Deviations

Add all the squared deviations together. This sum is called the Sum of Squares (SS). For our data, it is 1.44 + 7.84 + 0.64 + 0.04 + 4.84 = 14.8.

Σ(xᵢ − x̄)²
5

Divide to Get Variance

Divide the Sum of Squares by N (for population) or n − 1 (for sample). For sample variance, we divide 14.8 by 4 to get 3.7. For population variance, we divide by 5 to get 2.96.

σ² = 14.8 / 5 = 2.96 s² = 14.8 / 4 = 3.70
Worked Example

Step-by-Step Variance Example

Let's calculate the variance of a sample dataset: 4, 8, 6, 5, 3.

Consider the data set: 4, 8, 6, 5, 3, 7, 2, 9. We'll calculate both sample variance (s²) and population variance (σ²) for these 8 values. Watch the bar chart below — it shows each data point, the mean line, and the squared deviations as you scroll through each step.

0 3 6 9 4 8 6 5 3 7 2 9 x̄ = 5.5
Data Set
4 8 6 5 3 7 2 9
Step 1 Step 1: Find the Mean
x̄ = (4 + 8 + 6 + 5 + 3 + 7 + 2 + 9) / 8
Mean (x̄) = (4 + 8 + 6 + 5 + 3 + 7 + 2 + 9) / 8 = 44 / 8 = 5.5

The mean is the center of the data set — every deviation is measured from this point. In the bar chart above, the dashed line marks x̄ = 5.5.

Step 2 Step 2: Subtract the Mean and Square
xᵢ Deviation (x − x̄) Squared Deviation (x − x̄)²
4−1.52.25
82.56.25
60.50.25
5−0.50.25
3−2.56.25
71.52.25
2−3.512.25
93.512.25

Each row shows one data point, its deviation from the mean, and the squared deviation. Notice how values far from x̄ (like 2 and 9) produce much larger squared differences.

Step 3 Step 3: Sum the Squared Deviations
Σ(xᵢ − x̄)² = 2.25 + 6.25 + 0.25 + 0.25 + 6.25 + 2.25 + 12.25 + 12.25
Sum of Squares = 2.25 + 6.25 + 0.25 + 0.25 + 6.25 + 2.25 + 12.25 + 12.25 = 42

This sum of squares (42) represents the total squared distance of all data points from the mean. It's the numerator in both variance formulas.

Step 4 Step 4: Divide by n − 1
Population Variance (σ²) = 42 / 8 = 5.25
Population σ²
Sample Variance (s²) = 42 / 7 = 6
Sample s² (Sample)
Standard deviation is the square root of variance. For this data set: population σ = √5.25 ≈ 2.291, sample s = √6 ≈ 2.449. Standard deviation uses the same units as the original data, which makes it easier to interpret than variance. You can calculate variance and standard deviation together in Excel using VAR.S (sample) and VAR.P (population) functions, or in Google Sheets, R, Python, and SPSS.
Guide

How to Calculate Variance By Hand

Follow these checklist steps to calculate variance manually without a calculator.

Follow these checklist steps to calculate variance manually without a calculator.

Scratch Pad
Data: {3, 7, 5, 9, 1}
n = 5
Sum = 3+7+5+9+1 = 25
Mean = 25 ÷ 5 = 5
Deviations: −2, 2, 0, 4, −4
Squared: 4, 4, 0, 16, 16
Sum of squares = 40
σ² = 40/5 = 8   s² = 40/4 = 10
Step 1 Write down your dataset

List all numbers clearly. Count how many values you have (n).

Example: Data set = {3, 7, 5, 9, 1} → n = 5
Step 2 Calculate the arithmetic mean

Add all the numbers and divide by n. Note this value.

Sum = 3 + 7 + 5 + 9 + 1 = 25. Mean = 25 ÷ 5 = 5.
Step 3 Subtract the mean from each number

Subtract the mean from each raw value. Some will be negative.

3−5 = −2, 7−5 = 2, 5−5 = 0, 9−5 = 4, 1−5 = −4
Step 4 Square each of the differences

Multiply each difference by itself. All values must be positive.

(−2)² = 4, 2² = 4, 0² = 0, 4² = 16, (−4)² = 16
Step 5 Add all the squared values

Sum the squared differences. This is your Sum of Squares.

Sum of Squares = 4 + 4 + 0 + 16 + 16 = 40
Step 6 Divide by n − 1 (sample) or n (population)

This final step gives you the variance.

σ² = 40 ÷ 5 = 8 (Population)  |  s² = 40 ÷ 4 = 10 (Sample)
Tip: Standard deviation is just the square root of the variance you calculated in the final step.
Full Population

Whole Population Variance Calculation

When the data set includes every member of the group, use population variance — divide by n, not n − 1.

Population variance applies when your data set includes every observation from the whole population — not a sample. Examples: all employees in a company, every test score in a class, all products in a batch during quality control. The formula uses μ (the true population mean) and divides by n (the full count). No Bessel's correction. No degrees of freedom adjustment.

Interactive: How Sample Size Affects Variance

Drag the slider to see how the difference between σ² and s² changes with population size. At small n, the gap is large. As n grows, sample variance converges toward population variance.

Population size (n): 5
3 100
Population σ²
Sum of Squares / 5
Sample s²
Sum of Squares / 4
Difference
s² − σ²

Convergence: s² approaches σ² as n grows

% n 0% 50% 100% 3 25 50 75 100
At n = 5, sample variance is 25% larger than population variance
Calculator Tools

Explore Our Full Suite of Calculators

13 specialized statistical calculators — each with personalized step-by-step solutions, formulas, and FAQs. Pick the tool that fits your problem.

Variance Calculator σ SD Mean σ+s² SD+Var Solver Sample 🔍 Finder σ² Pop. CV Coeff. CV Var. % % Var Pct. sp² Pooled Poker
Click to open →
Core Calculators

Standard Deviation Calculator

Calculate standard deviation instantly with step-by-step solutions. Enter your data set and get population SD (σ), sampl…

Core Calculators

Mean Calculator

Calculate the mean (average) of any data set instantly. Get arithmetic mean, along with variance, standard deviation, me…

Relative Measures

Coefficient of Variation Calculator

Calculate the coefficient of variation (CV) instantly. Compare relative variability across data sets with different unit…

Variance Tools

Variance Solver

Solve variance problems instantly with detailed step-by-step solutions. Enter your data set and get sample variance, pop…

Variance Tools

Sample Variance Calculator

Calculate sample variance (s²) instantly with step-by-step solutions. Uses Bessel's correction (n−1) for unbiased estima…

Variance Tools

Variance Finder

Find the variance of any data set instantly. Enter numbers and get both sample and population variance, standard deviati…

Variance Tools

Population Variance Calculator

Calculate population variance (σ²) instantly with step-by-step solutions. Divides by N for exact variance when you have …

Specialized

Poker Variance Calculator

Calculate poker variance and understand your expected results over any number of hands. Analyze win rate variance, downs…

Relative Measures

Coefficient of Variance Calculator

Calculate the coefficient of variance (CV) instantly. Measure relative variability as a percentage of the mean. Get CV, …

Relative Measures

Percentage Variance Calculator

Calculate percentage variance between values or express variance as a percentage of the mean. Get coefficient of variati…

Relative Measures

Percent Variance Calculator

Calculate percent variance of your data set instantly. Express data variability as a percentage using the coefficient of…

Specialized

Pooled Variance Calculator

Calculate pooled variance from multiple groups or samples. Combine sample variances for two-sample t-tests, ANOVA, and m…

Core Calculators

Standard Deviation & Variance Calculator

Calculate both standard deviation and variance instantly. Get population and sample measures with step-by-step solutions…

FAQ

Frequently Asked Questions

Everything you need to know about variance.

What is the variance of 6 7 5 9 12 15?

The population variance of 6, 7, 5, 9, 12, 15 is 12.33 (σ² = 74/6) and the sample variance is 14.8 (s² = 74/5).

How to calculate variance of 1, 2, 3, 4, 5?

For the numbers 1, 2, 3, 4, 5, the population variance is 2 (10/5) and the sample variance is 2.5 (10/4).

How to calculate variance in Excel?

In Excel, use =VAR.S(range) to calculate sample variance or =VAR.P(range) to calculate population variance.

How to calculate sample variance?

Subtract the sample mean from each number, square the differences, sum them up, and divide by n − 1 (s² = Σ(xᵢ − x̄)² / (n − 1)).

How to calculate percentage of variance?

Calculate the coefficient of variation by dividing the standard deviation by the mean and multiplying by 100% (CV = (s / x̄) × 100%).

What is variance in statistics?

Variance is a statistical metric that measures how far data points are spread out from their average (mean).

What is the difference between sample variance and population variance?

Sample variance divides by n − 1 to correct for sampling bias, while population variance divides by n.

What is the variance formula?

The sample variance formula is s² = Σ(xᵢ − x̄)² / (n − 1) and the population variance formula is σ² = Σ(xᵢ − μ)² / n.

What is the relationship between variance and standard deviation?

Standard deviation is simply the square root of variance (s = √s² and σ = √σ²).

Can variance be negative?

No, variance can never be negative because it is calculated by summing squared differences.

Why do we use n-1 instead of n for sample variance?

Dividing by n − 1 (Bessel's correction) removes bias when estimating population variance from a sample.

How many data points do I need to calculate variance?

You need at least 1 data point for population variance and at least 2 data points for sample variance.

What is the coefficient of variation?

The coefficient of variation (CV = (s / x̄) × 100%) measures relative variability as a percentage of the mean.