Standard Deviation Calculator: Population or Sample?
Last updated: · 3 min read
Standard deviation shows how far the values of a data set spread around their mean. Two data sets can share the same average and still be very different; the standard deviation makes that difference visible. This guide explains how the calculator processes numbers with Welford's method, why it reports population and sample variance separately, and how to read the result for the example 2, 4, 4, 4, 5, 5, 7, 9.
Formula
Mean: μ = Σx ÷ n Population variance: σ² = Σ(x − μ)² ÷ n Sample variance: s² = Σ(x − x̄)² ÷ (n − 1) Standard deviation = √variance Coefficient of variation = (s ÷ x̄) × 100
Σ(x − μ)² is the sum of squared deviations: each value's distance from the mean is squared and the squares are added. If the data covers the whole group, divide by n (population). For a sample taken from a larger population, dividing by n−1 (Bessel's correction) gives a less biased estimate of the population variance. The coefficient of variation divides the spread by the mean and is undefined when the mean is 0.
What the inputs mean
- Numbers (separated by commas, spaces or new lines)
- Use a point as the decimal separator (2.5); a comma separates numbers. Up to 100,000 numbers. Example: 2, 4, 4, 4, 5, 5, 7, 9.
Worked example: The data set 2, 4, 4, 4, 5, 5, 7, 9
- The total is 40 and n = 8, so the mean is 40 ÷ 8 = 5.
- The deviations are −3, −1, −1, −1, 0, 0, 2, 4; their squares add up to 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32.
- Population variance is 32 ÷ 8 = 4; standard deviation is √4 = 2.
- Sample variance is 32 ÷ 7 = 4.571429; standard deviation is √4.571429 = 2.13809.
- Coefficient of variation is 2.13809 ÷ 5 × 100 = 42.7618%.
Result: If the data is a population, the standard deviation is 2; if it is a sample, it is 2.13809. With a mean of 5, most values (6 of the 8) fall between 3 and 7.
📊 Standard Deviation Calculator
Free, no sign-up; your data stays in your browser.
Open the calculator →How to read the result
Standard deviation is expressed in the same unit as the data and should be read alongside the mean. Choosing between population and sample depends on what the data covers: the grades of an entire class are a population, while a survey of 200 randomly chosen people is a sample. With small samples the two results can differ noticeably. This is general information.
Common mistakes
- Using the population formula (dividing by n) on sample data; the variance comes out too small.
- Confusing variance with standard deviation; variance is in squared units, and the standard deviation is its square root.
- Writing a decimal comma: 2,5 is read by the tool as two separate numbers, 2 and 5.
- Looking for a standard deviation from a single number; at least two numbers are needed, and the sample result is undefined.
- Interpreting the data without checking outliers; one large value can change the mean and the spread considerably.
Frequently asked questions
Should I choose population or sample?
Use population when the data covers the whole group, and sample when it is part of a larger group. If you are unsure, the sample standard deviation is the more cautious choice.
What is the coefficient of variation for?
It compares data sets with different units or different means. A low percentage means more consistent data.
Why does the tool use Welford's method?
With large numbers and small differences, a running sum can lose accuracy. Welford's method computes the mean and the sum of squares in one pass in a numerically stable way.
Is my data sent to a server?
No. The calculation is done in your browser.
The result is not exact or binding and is for information only; it is not an official document and cannot be used in official procedures. Confirm it with the competent authority or a professional before acting; no liability is accepted for losses arising from its use.