Skip to main content

Standard Deviation and Variance Calculator

Measure the spread of a list of numbers: population and sample standard deviation and variance, mean, sum of squared deviations and coefficient of variation.

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

One value per line, or values separated by spaces, semicolons or commas followed by a space. Both the decimal point and the decimal comma are accepted.

Entire population (divisor n)

Standard deviation σ
-
Variance σ²
-

Use when the data contains every value under study: a whole class, every part in a batch.

Sample (divisor n − 1)

Standard deviation s
-
Variance s²
-

Use when the data is an extract from a larger population whose spread you want to estimate.

Count (n)
-
Mean x̄
-
Sum of squared deviations
-
Coefficient of variation
-

Deviations from the mean table

xx − x̄(x − x̄)²

Calculation details

    Was this tool useful?

    How does this tool work?

    This tool calculates the standard deviation and the variance of a list of numbers, in the two versions used in practice: entire population (σ, dividing by n) and sample (s, dividing by n − 1). It also shows the mean, the table of deviations from the mean, the sum of their squares and the coefficient of variation, so you can follow the calculation as in an exercise or check a spreadsheet result.

    The standard deviation measures how spread out the values are around their mean: the larger it is, the further the values are from the mean; if it is zero, all the values are equal. It is expressed in the same unit as the data, which makes it easy to interpret.

    The calculation always follows the same steps: compute the mean x̄, compute each value’s deviation from the mean (x − x̄), square these deviations to remove the signs, add up the squares, divide that sum to get the variance, then take the square root of the variance to get the standard deviation.

    The only difference between the two versions is the divisor. For an entire population, divide by n: this is the formula taught in school and the one behind the STDEV.P spreadsheet function. For a sample, divide by n − 1 (Bessel’s correction), because deviations measured around the sample mean underestimate the true spread on average; this is the STDEV.S function (or STDEV).

    The variance is the square of the standard deviation. It is therefore expressed in squared units (cm², $²), which makes it less intuitive, but it has convenient mathematical properties: the variances of independent quantities add up.

    The coefficient of variation (standard deviation ÷ mean, as a percentage) lets you compare the spread of data sets whose means or units differ. The tool computes it from the population standard deviation.

    How to use this tool

    1. Paste the data

      One value per line, or separated by spaces, semicolons or commas followed by a space.

    2. Pick the right column

      Population (σ) if the data contains every value under study, sample (s) if it is only an extract.

    3. Read the standard deviation and variance

      Both versions are calculated at the same time, along with the mean and the coefficient of variation.

    4. Check with the table

      Each row shows the value, its deviation from the mean and the square of that deviation.

    Variance and standard deviation formulas

    For a data set of n values x₁, …, xₙ with mean x̄:

    Population variance

    σ² = Σ (xᵢ − x̄)² ÷ n

    Sample variance

    s² = Σ (xᵢ − x̄)² ÷ (n − 1)

    Standard deviation

    σ = √σ² and s = √s²

    Computational formula

    σ² = (Σ xᵢ²) ÷ n − x̄²

    Coefficient of variation

    CV = σ ÷ x̄ × 100%

    n
    size of the data set
    x̄
    arithmetic mean
    xᵢ − x̄
    deviation of the value xᵢ from the mean
    n − 1
    corrected divisor (Bessel’s correction) for a sample

    Use cases

    Statistics exercises

    Check the calculation of the variance and the standard deviation of a data set, step by step.

    Comparing consistency of results

    Two students, two teams or two suppliers with the same mean can have very different consistency.

    Quality control and measurements

    Assess the variability of a production run or the precision of an instrument from a sample of measurements.

    Finance

    The standard deviation of returns is the most common measure of an investment’s volatility.

    Examples

    Classic example

    Mean 5, sum of squared deviations 32. Population: 32 ÷ 8 = 4, so σ = 2. Sample: 32 ÷ 7 ≈ 4.571, so s ≈ 2.138.

    Input

    2, 4, 4, 4, 5, 5, 7, 9

    Result

    σ = 2; s ≈ 2.138

    Two classes, same mean

    Both data sets have a mean of 10, but the second is much more spread out.

    Input

    10, 10, 10, 10 and 4, 8, 12, 16

    Result

    σ = 0 and σ ≈ 4.472

    Measurement check

    A standard deviation of a few tenths of a millimeter around 50 mm indicates consistent production.

    Input

    49.8, 50.1, 50.0, 49.9, 50.2

    Result

    s ≈ 0.158

    Tips and best practices

    • When in doubt, use the sample standard deviation (s): it is the usual choice whenever the data comes from a survey, a partial record or a test.
    • For a bell-shaped distribution, about 68% of the values lie within one standard deviation of the mean and about 95% within two standard deviations.
    • A standard deviation should never be read alone: compare it with the mean, or use the coefficient of variation.
    • A single outlier can inflate the standard deviation considerably: check the deviations table before drawing conclusions.
    • In a spreadsheet, STDEV.P corresponds to σ and STDEV.S to s.

    Sources and references

    Frequently asked questions

    How do you calculate a standard deviation?

    Calculate the mean, then each value’s deviation from the mean. Square each deviation, add up the squares and divide by n (population) or by n − 1 (sample) to get the variance. The standard deviation is the square root of the variance.

    Should you divide by n or by n − 1?

    Divide by n if your data contains the entire population under study (all the grades in the class, for example). Divide by n − 1 if it is only a sample and you want to estimate the spread of the whole population: this divisor corrects the underestimation caused by using the sample mean.

    What is the difference between variance and standard deviation?

    The standard deviation is the square root of the variance. Both measure spread, but the standard deviation is in the same unit as the data (dollars, centimeters), whereas the variance is in squared units.

    What does a high standard deviation mean?

    The values are widely spread around the mean. “High” depends on the context: a standard deviation of 2 is small for salaries in dollars, but huge for machined parts measured in millimeters. The coefficient of variation helps judge this relative size.

    Can a standard deviation be negative?

    No. It is the square root of an average of squares, so it is always positive or zero. It is 0 only when all the values are identical.

    Why does my result differ from my calculator’s?

    Calculators often display both versions: σx (or σn) for the population and sx (or σn−1) for the sample. Check which version you are comparing; the tool gives both.

    What is the coefficient of variation?

    It is the standard deviation divided by the mean, expressed as a percentage. A coefficient of 5% means the standard deviation is 5% of the mean. It lets you compare the spread of data sets of different sizes or units; it is meaningless if the mean is close to 0.

    Related tools

    Tools similar or complementary to this one.

    Similar tools

    Profile every CSV column with detected type, missing values, cardinality, and descriptive numeric statistics.

    Mathematics & calculationUse this tool