Standard Deviation and Variance Formulas
Review population and sample standard deviation formulas, notation, variance, deviations, z-scores, calculation order, and rounding rules.
How do the Standard Deviation Calculator formulas work?
This formula page defines the variables used by the Standard Deviation Calculator, shows how those values are combined, and explains the order of operations behind the result. Use the worked steps to verify an estimate, compare scenarios, and understand which assumptions or rounding rules can affect the displayed answer.
Formula Overview
Both formulas begin with distances from the arithmetic mean. Those deviations are squared, added, divided by the appropriate denominator, and square-rooted. The denominator is the important difference: N for a complete population and n - 1 for a sample used to estimate population variation.
Variable Definitions
| Symbol | Meaning |
|---|---|
| xᵢ | The observation at position i |
| μ | Population mean |
| x̄ | Sample mean |
| N | Number of observations in the population |
| n | Number of observations in the sample |
| σ | Population standard deviation |
| s | Sample standard deviation |
Population Standard Deviation Formula
Use this formula when the observations are the complete population being described. Every squared deviation contributes to the average, and the variance denominator is N.
Sample Standard Deviation Formula
Use this formula when the observations are a sample from a larger population. Replacing n with n - 1 applies Bessel's correction to the sample variance estimate. At least two observations are required.
Variance Formulas
Variance is standard deviation squared. If observations are measured in meters, variance is expressed in square meters, while standard deviation returns to meters.
z-Score Formula
A z-score states how many population standard deviations an observation is above or below the mean. A positive z-score is above the mean and a negative score is below it. z-scores are undefined when standard deviation is zero.
Calculation Order
- Count the observations and find their sum.
- Divide the sum by the count to calculate the mean.
- Subtract the mean from each observation.
- Square each deviation and add the squares.
- Divide by N or n - 1 to calculate variance.
- Take the nonnegative square root to calculate standard deviation.
Worked Population Calculation
For 2, 4, 4, 4, 5, 5, 7, 9, the sum is 40 and N is 8, so μ = 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4, and 16. Their sum is 32.
This verified scenario is also the calculator's default example. See the examples page for the sample result and additional cases.
Precision and Rounding
The calculation engine retains Decimal.js precision through the mean, deviations, variance, and square root. Only displayed values are rounded to the selected two or three decimal places. Do not round each deviation before adding the squared deviations.
Formula Assumptions and Exclusions
- Every observation has equal weight.
- All observations use one consistent measurement scale.
- The user chooses the correct population or sample interpretation.
- The calculator does not handle frequency weights, grouped intervals, missing-data imputation, or multivariate covariance.
Corrections and Review
Report an issue or error in the calculator using the Contact Us page.