CalcTrace

Standard Deviation Calculator

Paste or type a list of numbers to get the standard deviation and variance, for a sample and for a whole population, along with the count, mean, median, minimum, maximum and standard error of the mean. A table shows how each value contributes.

Last updated .

Your data

Separate the numbers with commas, spaces or new lines. A comma always starts a new number, so type 1250, not 1,250.

These numbers are

Choose “sample” if your numbers are part of a larger group you want to draw conclusions about. Choose “population” if they are the entire group. Both answers are shown either way.

Result

Sample standard deviation (s)

–

–Count (n)
–Mean
–Median
–Standard error of the mean
–Minimum
–Maximum
–Range
–Sum
MeasureSample (n − 1)Population (n)
Standard deviation––
Variance––

Show the working
    Value xx − mean(x − mean)²

    What standard deviation measures

    Standard deviation is the typical distance between a value and the mean of its data set. A small figure means the values sit close to the mean, and a large one means they are spread out. It is in the same units as the data, which is what makes it easier to interpret than the variance.

    Mean: x̄ = Σx ÷ n

    Population variance: σ² = Σ(x − μ)² ÷ N    Population standard deviation: σ = √σ²

    Sample variance: s² = Σ(x − x̄)² ÷ (n − 1)    Sample standard deviation: s = √s²

    Standard error of the mean: SE = s ÷ √n

    In these formulas x is each value in turn, Σ means “add up for every value”, n (or N for a population) is how many values there are, x̄ is the mean of a sample and μ is the mean of a population. The quantity Σ(x − x̄)² is called the sum of squares. Deviations are squared so that values below the mean do not cancel values above it.

    Worked example: 2, 4, 4, 4, 5, 5, 7, 9

    1. Mean. There are 8 values and they add up to 40, so the mean is 40 ÷ 8 = 5.
    2. Deviations. Subtract the mean from each value: −3, −1, −1, −1, 0, 0, 2, 4. These always add up to 0, which is a handy check.
    3. Squares. 9, 1, 1, 1, 0, 0, 4, 16. The sum of squares is 32.
    4. Population figures. Variance = 32 ÷ 8 = 4, and the standard deviation is √4 = 2.
    5. Sample figures. Variance = 32 ÷ 7 = 4.571, and the standard deviation is √4.571 = 2.138.
    6. Standard error. 2.138 ÷ √8 = 0.756.

    The median is found separately. With the values in order, the middle two are 4 and 5, so the median is 4.5.

    When to divide by n and when by n − 1

    Divide by n when your data covers every member of the group you want to describe, such as the marks of every student in one class when that class is all you care about. Divide by n − 1 when your data is a sample taken to learn about something larger, such as a survey, a batch pulled from a production line or the participants in a trial.

    The reason is that a sample’s deviations are measured from the sample’s own mean, and that mean always sits at the centre of the sample. The true population mean is usually somewhere slightly different, so the sample’s sum of squares comes out a little too small. Dividing by n − 1 instead of n makes up the shortfall on average. It is known as Bessel’s correction. Another way to see it: because the deviations must add up to zero, only n − 1 of them are free to vary.

    The choice matters most for small data sets. With the 8 values above, the sample figure is 6.9% larger than the population figure. With 100 values the gap is only 0.5%. If you are unsure, use the sample version, which is the more cautious of the two. In a spreadsheet these are STDEV.S and STDEV.P.

    Reading the result

    The 68–95–99.7 rule needs bell-shaped data

    For data that follows a normal distribution, about 68% of values lie within one standard deviation of the mean, about 95% within two and about 99.7% within three. Real data only approximates this. In the worked example, one sample standard deviation either side of the mean runs from 2.86 to 7.14 and contains 6 of the 8 values, which is 75%. For strongly skewed data, such as incomes or house prices, the rule does not hold at all.

    One outlier can dominate

    Because deviations are squared, a single extreme value has a large effect. Change the 9 in the example to 90 and the mean jumps from 5 to 15.125, while the sample standard deviation leaps from 2.138 to 30.29. The median stays at 4.5. When the mean and median are far apart, check for outliers or typing errors before trusting the standard deviation.

    Standard deviation is not standard error

    Standard deviation describes how much individual values vary, and it does not shrink as you collect more data. Standard error describes how precisely the sample mean estimates the true mean, and it does shrink: four times as much data halves it. Reporting one when you mean the other is a common mistake in written results.

    A single value

    With one number, the population standard deviation is 0 and the sample standard deviation cannot be calculated, because the formula divides by n − 1 = 0. The calculator shows a dash in that case.