Variance Calculator
Enter your dataset
Separate values with commas, spaces, semicolons, tabs, or new lines. Negative numbers, decimals, and scientific notation such as 1e-3 are supported. Do not use commas as thousands separators.
Private by design: your values are processed only in this browser. This calculator does not upload or save the dataset.
Results
Advertisement
Population and Sample Variance Formulas
Use this when the entered values are every member of the population you want to describe.
Use this when the values are a sample used to estimate variability in a larger population.
The calculator uses a stable online algorithm to compute the mean and sum of squared deviations. This reduces loss of precision for datasets with large values that differ by small amounts. Display rounding is applied only after calculation.
Should You Use Population or Sample Variance?
| Situation | Use | Denominator |
|---|---|---|
| You measured every item or person in the group of interest | Population variance (σ²) | N |
| You measured a subset and want to estimate a larger population | Sample variance (s²) | n − 1 |
| You only want to describe the exact entered list, without generalizing | Population variance (σ²) | N |
The choice depends on how the data were collected and what you want to infer—not simply on how many observations you have.
How to Calculate Variance Step by Step
- Find the arithmetic mean: add all observations and divide by their count.
- Subtract the mean from each observation to find each deviation.
- Square every deviation so negative and positive distances do not cancel.
- Add the squared deviations to get the sum of squared deviations (SS).
- Divide SS by N for population variance, or by n − 1 for sample variance.
- Take the square root of variance if you also need standard deviation.
Worked example
For 2, 4, 6, the mean is 4. The deviations are −2, 0, and 2; their squares are 4, 0, and 4; and SS is 8. Population variance is 8 ÷ 3 = 2.6667. Sample variance is 8 ÷ 2 = 4.
Understanding the result
A variance of zero means all values are identical. Larger variance means greater spread around the mean, but the number is expressed in squared units. Standard deviation is often easier to interpret because it uses the dataset’s original unit. Variance is sensitive to outliers because deviations are squared.
Frequently Asked Questions
What is the difference between population and sample variance?
Population variance divides SS by N because the dataset is the complete population of interest. Sample variance divides by n − 1 when the dataset is used to estimate the variance of a larger population.
Why does sample variance divide by n − 1?
Estimating the mean from the same sample uses one degree of freedom. Dividing by n − 1—Bessel’s correction—corrects the downward bias in the population variance estimate.
Can variance be negative?
No. Every deviation is squared, so variance is always zero or positive. The calculator normalizes a tiny negative floating-point artifact to zero.
What are the units of variance?
Variance uses squared units. If values are in kg, variance is in kg². Standard deviation is in kg.
How many values are required?
Population variance is defined for one or more finite values. Sample variance requires at least two because n − 1 would be zero for a one-value sample.
Which number separators can I use?
Use commas, spaces, semicolons, tabs, or new lines. Decimals, negative values, and scientific notation are accepted. A thousands comma is treated as a separator, so enter 1000 rather than 1,000.
Is my dataset uploaded or saved?
No. All calculations run locally in your browser, and the calculator does not upload or store the values.
