Standard Deviation & Variance Calculator

Calculate the standard deviation, variance, mean, median, standard error and z-scores of a data set, for a sample or a whole population.

Updated · Free · Runs in your browser

Numbers separated by commas, spaces or new lines.

The data is a
Standard deviation —
Variance —
Mean —
Median —
Count —
Sum —
Minimum to maximum —
Sum of squares —
Standard error of the mean —
Coefficient of variation —
    Was this calculator helpful?

    Deviations and z-scores

    The formula

    Mean: x̄ = Σx ÷ n
    Sum of squares: SS = Σ(x − x̄)²
    Sample variance: s² = SS ÷ (n − 1);  population variance: σ² = SS ÷ N
    Standard deviation = √variance
    Standard error of the mean = s ÷ √n;  z = (x − x̄) ÷ s;  CV = s ÷ x̄ × 100%

    Worked example

    1. Data: 12, 15, 11, 18, 14, 16, 13, 17, 15, 19 (n = 10).
    2. Mean = 150 ÷ 10 = 15.
    3. Sum of squared deviations = 9 + 0 + 16 + 9 + 1 + 1 + 4 + 4 + 0 + 16 = 60.
    4. Sample variance = 60 ÷ 9 = 6.667, so sample SD = √6.667 = 2.582.
    5. Population variance = 60 ÷ 10 = 6, so population SD = 2.449.

    What standard deviation tells you

    Standard deviation measures how spread out numbers are around their mean. A small standard deviation means most values are close to the average, while a large one means they're widely scattered. Two classes could both average 70% on a test, but if one class's scores have a standard deviation of 5 and the other's 15, the second class has far more variation. Standard deviation is in the same units as the data, which makes it easier to interpret than variance, which is in squared units.

    Sample or population?

    Use the population formula, dividing by N, only when your data includes every member of the group you care about, such as the heights of all players on one team. In most real situations the data is a sample from a larger group, and you use it to estimate the spread of the whole group. Then you divide by n − 1, known as Bessel's correction, because a sample's values are on average slightly closer to their own mean than to the true population mean. Dividing by n would underestimate the spread. Spreadsheet functions STDEV.S and STDEV.P give the sample and population versions.

    Calculating it by hand

    First find the mean. Then subtract the mean from each value to get its deviation, and square each deviation so negative and positive deviations don't cancel out. Add the squares to get the sum of squares, divide by n − 1 for a sample or N for a population to get the variance, and take the square root to get the standard deviation. The table in the calculator shows every step, which is useful for checking homework or exam answers.

    The 68–95–99.7 rule

    For data that follows a roughly normal, bell-shaped distribution, about 68% of values fall within one standard deviation of the mean, about 95% within two and about 99.7% within three. So if adult male height has a mean of 175 cm and a standard deviation of 7 cm, about 95% of men are between 161 cm and 189 cm. A value's z-score tells you how many standard deviations it is from the mean; values with z-scores beyond ±3 are unusual and worth checking as possible errors or outliers.

    Standard error and coefficient of variation

    The standard error of the mean, s ÷ √n, measures how precisely the sample mean estimates the population mean. It shrinks as the sample grows, which is why larger studies give more precise results; it's the basis of confidence intervals and of tests such as our A/B test significance calculator. The coefficient of variation expresses the standard deviation as a percentage of the mean, which lets you compare the spread of data measured on different scales, such as the variability of share prices with very different values.

    Outliers and robust measures

    Because deviations are squared, a single extreme value can inflate the standard deviation a lot. For skewed data, such as incomes or house prices, the median and interquartile range describe the typical value and spread more robustly.

    Uses in everyday life

    Standard deviation is used to measure investment risk (the volatility of returns), quality control in manufacturing, where processes aim for outputs within a set number of standard deviations of the target, weather and climate statistics, exam grading and sports performance analysis. To plan how much data you need to collect for a survey, see our sample size calculator, and to report the precision of a poll, use the margin of error calculator.

    Frequently asked questions

    What is the difference between sample and population standard deviation?
    Population standard deviation divides the sum of squared deviations by N, the number of values. Sample standard deviation divides by n − 1, which corrects for the fact that a sample tends to underestimate the spread of the population it came from.
    Can standard deviation be negative?
    No. It's the square root of an average of squared numbers, so it's always zero or positive. It's zero only when every value is the same.
    What is a good or high standard deviation?
    It depends on the data. Compare it with the mean: the coefficient of variation (SD ÷ mean) shows relative spread. A CV under about 10% usually indicates low variability and over 30% high variability, but norms vary by field.
    How is variance different from standard deviation?
    Variance is the average squared deviation, and standard deviation is its square root. Standard deviation is in the original units, so it's easier to interpret; variance is used in many statistical formulas because variances of independent variables add together.
    How many numbers can I enter?
    As many as you like. The table shows the first 200 values, but every value is included in the results.

    ↑↓ to navigate · Enter to open