Variance and Standard Deviation Calculator

Enter a list of numbers to instantly calculate their variance and standard deviation, whether you are analyzing a full population or working with a sample from a larger dataset.

Enter numbers separated by commas, spaces, or semicolons.

Use Population when you have all members of the group. Use Sample when your data is a subset of a larger population.

Quick answer

Variance measures how spread out numbers are from their mean by averaging the squared differences from the mean. Standard deviation is the square root of variance, returning the spread in the original units of measurement. Use population formulas (divide by n) when you have data for every member of the group, and sample formulas (divide by n−1) when your data is a subset drawn from a larger population. For the dataset {2, 4, 4, 4, 5, 5, 7, 9}, the population variance is 4 and the population standard deviation is 2, showing values typically fall within 2 units of the mean of 5.

Formula & method

σ² = Σ(xᵢ − μ)² / N
  • σ² Population variance
  • xᵢ Each individual data value
  • μ Population mean (Σxᵢ / N)
  • N Total number of values in the population

Population variance — use when your dataset includes every member of the group.

s² = Σ(xᵢ − x̄)² / (n − 1)
  • Sample variance
  • xᵢ Each individual data value
  • Sample mean (Σxᵢ / n)
  • n Number of values in the sample

Sample variance — use when your data is a random sample from a larger population. The (n−1) denominator (Bessel's correction) removes bias.

σ = √σ²   or   s = √s²
  • σ Population standard deviation
  • s Sample standard deviation

Standard deviation is the square root of variance, expressed in the same units as the original data.

Examples

Example 1: Population Variance: Classic Textbook Dataset
Input
Dataset: 2, 4, 4, 4, 5, 5, 7, 9 | Type: Population
Result
Mean = 5, Population Variance = 4, Population Std Dev = 2
Why
The 8 values sum to 40, giving a mean of 40/8 = 5. The squared deviations are (2−5)²=9, (4−5)²=1, (4−5)²=1, (4−5)²=1, (5−5)²=0, (5−5)²=0, (7−5)²=4, (9−5)²=16. Their sum is 32. Population variance = 32/8 = 4. Standard deviation = √4 = 2.
Example 2: Sample Variance: Five Evenly Spaced Values
Input
Dataset: 10, 20, 30, 40, 50 | Type: Sample
Result
Mean = 30, Sample Variance = 250, Sample Std Dev ≈ 15.81
Why
The 5 values sum to 150, giving a mean of 30. The squared deviations are (10−30)²=400, (20−30)²=100, (30−30)²=0, (40−30)²=100, (50−30)²=400. Their sum is 1000. Sample variance = 1000/(5−1) = 250. Standard deviation = √250 ≈ 15.81.
Example 3: Sample Standard Deviation: Weekly Step Count
Input
Dataset: 15, 18, 22, 25, 27, 30, 33 | Type: Sample
Result
Mean ≈ 24.29, Sample Variance ≈ 41.24, Sample Std Dev ≈ 6.42
Why
Seven values sum to 170, giving a mean of 170/7 ≈ 24.2857. The sum of squared deviations is approximately 247.43. Sample variance = 247.43/(7−1) ≈ 41.24. Standard deviation = √41.24 ≈ 6.42, meaning step counts typically vary about 6.42 thousand steps from the weekly average.
Example 4: Population Variance: Evenly Spaced Test Scores
Input
Dataset: 70, 75, 80, 85, 90, 95, 100 | Type: Population
Result
Mean = 85, Population Variance = 100, Population Std Dev = 10
Why
Seven scores sum to 595, giving a mean of 85. The squared deviations are (70−85)²=225, (75−85)²=100, (80−85)²=25, (85−85)²=0, (90−85)²=25, (95−85)²=100, (100−85)²=225. Their sum is 700. Population variance = 700/7 = 100. Standard deviation = √100 = 10.

When to use this tool

  • Comparing the spread of two datasets that share the same units (e.g., test scores from two classrooms).
  • Reporting risk or volatility — financial returns, quality-control measurements, lab readings.
  • Computing z-scores, confidence intervals, or any statistic that depends on a spread parameter.
  • Checking whether a process meets a tolerance: a small std dev means values cluster tightly around the target.

Common mistakes

  • Dividing by n when the data is a sample — always divide by n−1 for sample variance (Bessel's correction).
  • Reporting variance instead of standard deviation in a result aimed at non-statisticians; std dev shares the original units and is easier to interpret.
  • Squaring the deviations after taking the mean instead of before — the formula is the mean of squared deviations, not the square of the mean deviation.
  • Leaving outliers untreated in skewed data: a single extreme value can inflate variance dramatically; consider median absolute deviation when the distribution is heavy-tailed.

Frequently asked questions

When should I use population variance vs. sample variance?

Use population variance (divide by N) when your dataset contains every single member of the group you are analyzing — for example, all seven days of last week's temperatures. Use sample variance (divide by n−1) when your data is a random subset drawn from a larger population — for example, survey responses from 200 people representing an entire city. The n−1 denominator (Bessel's correction) compensates for the tendency of samples to underestimate the true spread of the population.

Why is standard deviation more commonly reported than variance?

Variance is expressed in squared units (e.g., dollars² or kg²), which are difficult to interpret intuitively. Standard deviation is the square root of variance, so it is expressed in the same units as the original data. This makes it directly comparable to the mean and much easier to communicate — saying 'test scores have a standard deviation of 10 points' is far more meaningful than 'a variance of 100 points²'.

What does a variance of zero mean?

A variance of zero means all values in the dataset are identical — there is no spread or variation at all. For example, the dataset {5, 5, 5, 5} has a mean of 5, zero squared deviations, and therefore a variance of 0 and a standard deviation of 0. Any dataset with at least two different values will have a positive variance.

Can variance or standard deviation be negative?

No. Variance is computed by squaring the deviations from the mean, so every term in the sum is non-negative. The result is always zero or positive. Since standard deviation is the square root of a non-negative number, it is also always zero or positive. A negative variance or standard deviation would indicate a calculation error.

How does an outlier affect variance and standard deviation?

Outliers have a disproportionately large effect because deviations are squared before averaging. A single value far from the mean contributes a very large squared deviation, inflating both variance and standard deviation significantly. For example, adding the value 100 to the dataset {1, 2, 3, 4, 5} (mean = 3) raises the population standard deviation from about 1.41 to roughly 36.6. This sensitivity to outliers is why median absolute deviation is sometimes preferred for skewed data.

What is the relationship between variance and the normal distribution?

In a normal (bell-curve) distribution, standard deviation defines the width of the curve. Approximately 68% of values fall within one standard deviation of the mean, about 95% fall within two standard deviations, and about 99.7% fall within three standard deviations — the empirical 68-95-99.7 rule. Variance is the square of standard deviation and is used directly in the mathematical formula for the normal distribution's probability density function.

Sources & references

External references open in a new tab. We are independent and not affiliated with these organizations.

  • ✓ Free to use
  • ✓ No sign-up required
  • Runs entirely in your browser — nothing is uploaded.
  • ✓ Formula and method shown above

Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.

Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.

Related tools

Embed this tool on your site

Free to embed, no sign-up. Paste this code where you want the variance and standard deviation calculator to appear: