Standard Deviation Calculation Step by Step
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
Standard deviation measures how far data values typically spread from their mean. To calculate it, find the mean, measure each value’s deviation from that mean, square and add the deviations, divide by the appropriate count, then take the square root; the result is the standard deviation in the same units as the data.
Formula
There are two standard formulas, depending on whether your values are a sample or the complete population.
- Sample standard deviation: s = √[Σ(xᵢ − x̄)² ÷ (n − 1)]
- Population standard deviation: σ = √[Σ(xᵢ − μ)² ÷ N]
Here, xᵢ is an individual data value, x̄ is the sample mean, and μ is the population mean. The symbol Σ means to add the indicated quantity for every value. n is the number of observations in a sample; N is the number of values in the full population. The squared deviations are divided by n − 1 for a sample or by N for a population. The square root returns the result to the original measurement units.
For the calculator’s list, the first output uses the sample formula and the second uses the population formula. The entries have arbitrary “units,” since no physical measurement unit is specified. The mean and count are included as useful checks.
Worked Example
The default data are 2, 4, 6, 8, and 10. They can be treated either as a complete population or as a sample drawn from a larger group.
- Find the mean: (2 + 4 + 6 + 8 + 10) ÷ 5 = 6.
- Subtract the mean from each value: −4, −2, 0, 2, and 4.
- Square each deviation: 16, 4, 0, 4, and 16. Their sum is 40.
- For the sample standard deviation, divide by 5 − 1 = 4: 40 ÷ 4 = 10. Take the square root: √10 ≈ 3.16.
- For the population standard deviation, divide by 5: 40 ÷ 5 = 8. Take the square root: √8 ≈ 2.83.
The calculator therefore returns a sample standard deviation of 3.16 units, a population standard deviation of 2.83 units, a mean of 6 units, and a count of 5.
How to Calculate Standard Deviation by Hand
The worked example demonstrates the calculation. For any list of numerical values, follow these steps:
- Choose the right data and formula. Decide whether your list includes every member of the group you are describing or only a sample.
- Calculate the mean. Add all values and divide by their count.
- Find each deviation. Subtract the mean from each value. Deviations can be negative, positive, or zero.
- Square each deviation. Squaring prevents positive and negative differences from cancelling out and gives greater weight to values farther from the mean.
- Add the squared deviations. This total is the sum of squared deviations.
- Calculate the variance. Divide that total by the population count, or by one less than the sample count.
- Take the square root. The result is the standard deviation.
Keep full precision during the steps and round only the final answer. Rounding the mean or intermediate squared deviations too soon can slightly alter the result.
Sample or Population: Which Formula?
Use the population formula when your data cover the complete group of interest—for example, every item in a particular batch, if that batch itself is the group you want to describe. Use the sample formula when your observations are a subset intended to represent a larger group.
The sample formula divides by n − 1, rather than n. This adjustment, often called Bessel’s correction, compensates for the tendency of a sample’s spread around its own mean to understate the population’s spread. It is used when estimating population variance from a sample. It does not mean that every sample calculation should use n − 1: if the list is the entire population being described, divide by N.
A sample standard deviation needs at least two observations. With a single observation, the sample denominator would be zero, so sample standard deviation is undefined. A population consisting of one value has a standard deviation of zero.
How to Interpret the Result
Standard deviation describes spread around the mean, not the direction of the values or their distance from a target. A small standard deviation means the observations tend to lie relatively close to their mean; a larger one indicates more spread. It is measured in the same units as the data: if values are in centimeters, standard deviation is in centimeters; if values are in minutes, it is in minutes.
Standard deviation is not the same as the average absolute distance from the mean. Because deviations are squared before averaging, unusually distant values can have a strong influence. It also does not say that every observation lies within one standard deviation of the mean. For data with a roughly bell-shaped distribution, a common rule of thumb is that about 68% of values lie within one standard deviation of the mean, about 95% within two, and about 99.7% within three. Those percentages rely on the distribution being approximately normal; they are not guaranteed for every dataset.
Common Mistakes and Limitations
- Using the wrong denominator: Choose N for a complete population and n − 1 for a sample used to estimate population spread.
- Forgetting to square deviations: Adding unsquared deviations from the mean always gives zero, apart from rounding effects.
- Stopping at variance: Variance is the average squared deviation, so its units are squared. Standard deviation is the square root of variance and returns to the original units.
- Mixing measurement units: Convert values to a consistent unit before calculating. Combining, for example, meters and centimeters as though they were identical numbers produces a misleading result.
- Rounding too early: Keep extra digits through the calculation, then round the final standard deviation to a sensible precision.
Standard deviation can be hard to interpret for strongly skewed data or data containing influential outliers. It also summarizes spread around the mean, so it may be less informative when the mean is not a useful description of the center. Consider the data values and their distribution alongside the result rather than treating one number as a complete description.
Frequently Asked Questions
What is the easiest way to calculate standard deviation?
Use a calculator or spreadsheet that distinguishes sample from population standard deviation. By hand, calculate the mean, square each deviation from it, divide by the correct denominator, and take the square root.
Why do you divide by n − 1 for sample standard deviation?
When a sample mean is used to estimate the population mean, its deviations tend to make the sample appear less spread out. Dividing by n − 1 instead of n corrects the estimate of population variance.
Can standard deviation be negative?
No. Squared deviations cannot be negative, and the square root of their nonnegative average is also nonnegative. A standard deviation of zero means all values are identical.
Is standard deviation the same as variance?
No. Variance is the average squared deviation from the mean; standard deviation is its square root. Standard deviation uses the data’s original units, while variance uses squared units.
What does a standard deviation of zero mean?
It means there is no variation in the values: every observation equals the mean. This is true for both sample and population data when all listed values are identical.
Related
Formula used
list data | Data values | 2, 4, 6, 8, 10 out sd | Sample standard deviation | units | sd(data) | 2 out psd | Population standard deviation | units | psd(data) | 2 out mean | Mean | units | mean(data) | 2 out count | Number of values | - | count(data) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.