Standard deviation formulas
Sample: s = √( Σ(x − x̄)² ÷ (n − 1) )
- Find the mean (add the values and divide by how many there are).
- Subtract the mean from each value and square the result.
- Add the squared differences.
- Divide by N (population) or n − 1 (sample) to get the variance.
- Take the square root.
Mean, median and mode
- Mean — the arithmetic average. Sensitive to outliers.
- Median — the middle value when sorted (average of the two middle values for an even count). Robust to outliers, which is why it’s used for incomes and house prices.
- Mode — the most frequent value. A data set can have several modes or none.
- Range — maximum minus minimum.
How to use the calculator
- Paste or type your numbers separated by commas, spaces or new lines.
- Choose sample if the data is a subset of a larger group, or population if it includes every member.
- Read the standard deviation, variance, mean, median, range and the step-by-step working.
Sample or population?
Use the population formula (divide by N) when you have data for everyone you care about — every student in one class, every month of a year. Use the sample formula (divide by n − 1) when your data is a sample used to estimate a bigger group — 50 surveyed customers out of thousands. Dividing by n − 1 (Bessel’s correction) slightly increases the result to correct for the tendency of samples to underestimate variability. When in doubt, the sample formula is the usual choice in research and in spreadsheet functions such as STDEV.S.
Interpreting standard deviation
Standard deviation measures how spread out values are around the mean, in the same units as the data. For data that follow a roughly normal (bell-shaped) distribution, the 68–95–99.7 rule applies: about 68% of values fall within one standard deviation of the mean, 95% within two and 99.7% within three.
Related measures
- Variance: the square of the standard deviation. Useful in calculations but in squared units.
- Coefficient of variation: standard deviation ÷ mean, as a percentage — compares spread between data sets with different scales.
- Z-score: (value − mean) ÷ standard deviation — how many standard deviations a value lies from the mean.
- Standard error of the mean: s ÷ √n — how precisely the sample mean estimates the population mean.
In spreadsheets
Excel and Google Sheets: =STDEV.S(range) for a sample, =STDEV.P(range) for a population; =VAR.S and =VAR.P for variance; =AVERAGE and =MEDIAN for the center. Outliers have a strong effect on standard deviation, so check for data-entry errors before drawing conclusions.