Mathematics
Sample and population variance calculator
Calculate sample or population variance, the mean, sum of squared deviations and standard deviation, with every calculation component.
The example values can be changed. Press Calculate to update the result; you can download it as TXT or CSV and collect scenarios in this tab. JSON, HTML and TXT downloads keep your inputs, the statistical result and the calculation steps shown. Automatic recalculation after editing is off unless you switch it on. Nothing is saved, imported or sent automatically.
Result
Formula / calculation:
Enter values separated by semicolons, up to 100 observations and 400 input characters; absolute values at most 1e12. Decimal points in UK, decimal commas in DE; no grouping separators or skipped invalid values. Sample variance uses n−1 and needs at least two observations; population variance uses n and allows one observation. Choose according to whether you are estimating a larger population or describing all members of your defined population. Variance is measured in squared units; standard deviation returns to the original data units. Results and component rows are floating-point approximations. Constant data has zero variance. Component CSV preserves raw values and protects negative formula-like cells; display precision does not change the calculation. Explicit downloads only, no automatic saving or sending. Nonzero intermediate squares or variance that underflow are refused. Own chart SVG: original component data, up to 100 observations. Regression shows circles and the fitted line only over observed x; variance shows10equal-width count bins, final bin includes maximum, constant data use a symmetric expanded range. Tick labels use5significantdigits, SVGgeometry6decimals; full values remain in the record. No causation, prediction, density or normality proof.
Decimal results are approximate. Inputs stay in this browser tab.
How it works
Centered sums, compensated summation and explicit variance divisor or least-squares fit; floating-point components are shown below. Enter values separated by semicolons, up to 100 observations and 400 input characters; absolute values at most 1e12. Decimal points in UK, decimal commas in DE; no grouping separators or skipped invalid values. Sample variance uses n−1 and needs at least two observations; population variance uses n and allows one observation. Choose according to whether you are estimating a larger population or describing all members of your defined population. Variance is measured in squared units; standard deviation returns to the original data units. Results and component rows are floating-point approximations. Constant data has zero variance. Component CSV preserves raw values and protects negative formula-like cells; display precision does not change the calculation. Explicit downloads only, no automatic saving or sending. Nonzero intermediate squares or variance that underflow are refused. The separate RSD form uses 100 times the original numerical standard deviation divided by the absolute original numerical mean. Choose sample or population explicitly. Zero mean has no RSD result. These are binary 64 numerical summaries; the fraction describes their decimal representations, not exact statistics of arbitrary real data. Interpretation requires meaningful zero and comparable units. No signed coefficient of variation, confidence interval, laboratory threshold or medical conclusion.
Worked example
With these example values the calculator gives the result below. You can change any value in the form above.
Inputs
- Variance definition
- Whole defined population (n)
- Values separated by semicolons (up to 400 characters)
- 2;4;4;4;5;5;7;9
Result
- Observation count
- 8
- Mean
- 5
- Sum of squared deviations
- 32
- Variance denominator
- 8
- Variance (squared data units)
- 4
- Standard deviation (data units)
- 2
- Minimum
- 2
- Maximum
- 9
Frequently asked questions
How do I calculate variance?
Enter values separated by semicolons and choose sample or population. The variance calculator uses Σ(x−mean)²/(n−1 or n) and shows the mean, sum of squared deviations and each component row.
What is the difference between sample and population variance?
Sample variance divides by n−1 and needs at least two observations. Population variance divides by n and allows one observation. Use sample when estimating a larger population and population when describing all members of your defined population.
How do I calculate standard deviation from variance?
Standard deviation is the square root of the variance. Variance is in squared units, while standard deviation returns to the original data units. For 2;4;4;4;5;5;7;9 the population variance is 4 and the standard deviation 2.
How many values can the variance calculator take?
Up to 100 observations within 400 input characters, each with an absolute value of at most 1e12. Use a decimal point in the UK version and no grouping separators.
How is relative standard deviation calculated?
A separate RSD form takes 100 times the standard deviation divided by the absolute mean. For 1;2;3 with sample deviation, the mean is 2, the deviation 1 and the RSD 50 percent. A zero mean has no RSD result.
What does the variance histogram show?
The chart shows ten equal-width bins with absolute counts. Bins are left closed and right open, with the final bin including the maximum. It makes no density or normality claim.
Is the variance result exact?
No. Results and component rows are floating-point approximations calculated with centred sums and compensated summation. Constant data has zero variance.