Back to blog

Standard Deviation CalculatorVarianceSample Standard DeviationStatistics

Standard Deviation Calculator: Which Formula?

Use a standard deviation calculator for population and sample data. Follow a worked example, compare n with n−1, and understand variance and CV limits.

Standard Deviation Calculator: Which Formula? cover

The main decision in a standard deviation calculation is whether the numbers represent the entire population or a sample drawn from it. Paste the values into the online standard deviation and variance calculator to get population and sample results side by side, then choose the one that matches the question your data is meant to answer. We checked the page's default data against the formulas implemented in its source; every result below can be reproduced.

Standard deviation cover with chalkboard bell curve

What the Standard Deviation Calculator Returns

Start with the page's default data:

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

These eight values sum to 40 and have a mean of 5. The sum of squared deviations from that mean is 32, so the tool returns:

Metric Result Calculation
Count 8 Number of valid values
Sum 40 All values added together
Mean 5 40 ÷ 8
Population variance 4 32 ÷ 8
Population standard deviation 2 √4
Sample variance 4.57142857143 32 ÷ 7
Sample standard deviation 2.1380899353 √(32 ÷ 7)
Coefficient of variation 40% Population SD 2 ÷ absolute mean 5 × 100%

The two standard deviations differ by design. They use different denominators because they answer different questions.

Population vs. Sample Standard Deviation

Use population standard deviation when the values are the complete set you intend to describe. Use sample standard deviation when the values are a subset drawn from a larger population and you want to estimate that population's spread.

Data you have Result to use Denominator
Every student's score in one class Population SD n
Scores from students sampled across a school Sample SD n − 1
Actual daily sales for every day in a month Population SD n
Products inspected to estimate variation in a batch Sample SD n − 1

“Population” does not mean a large data set, and “sample” does not mean a small one. The distinction comes from scope. Five departments can be a population if they are every department in a company. Ten thousand records can still be a sample if they were selected from a larger set.

Why Does Sample Variance Divide by n−1?

The sample mean is estimated from the same observations, which constrains their deviations. Dividing by n − 1, commonly called Bessel's correction, reduces the systematic downward bias when sample variance is used to estimate population variance.

The U.S. National Institute of Standards and Technology lists N − 1 in its sample standard deviation formula. NIST also notes that standard deviation restores spread to the original measurement unit, while variance is expressed in squared units. [1]

How to Calculate Variance and Standard Deviation

Let the values be x₁, x₂, …, xₙ and their mean be . The calculation has three stages:

  1. Calculate the mean
  2. Subtract the mean from each value, square each deviation, and add the squares
  3. Divide by the population or sample denominator to get variance, then take its square root

For a population:

text
Population variance σ² = Σ(xᵢ − μ)² ÷ n
Population standard deviation σ = √σ²

For a sample:

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

Variance is convenient in statistical calculations. Standard deviation is often easier to interpret because it has the same unit as the original data. If lengths are recorded in centimeters, variance is in square centimeters while standard deviation is in centimeters.

If you only need mean, median, mode, and range, use the average, median, and mode calculator. The number sum calculator is useful when you want to verify the total and count before calculating spread.

Use the Online Calculator in Three Steps

  1. Open the standard deviation and variance calculator
  2. Enter or paste values separated by line breaks, commas, Chinese commas, or spaces
  3. Read the population or sample result that matches the scope of the data

Results update as the input changes. “Reset example” restores the default values, while “Clear” removes both the input and calculated results. The parser accepts integers, decimals, and negative values. If any token is not a finite number, the page reports invalid input instead of silently discarding it.

All calculations happen in the current browser. The tool does not need to upload the number list to a server, although sensitive data should still be handled only on a trusted device with trusted browser extensions.

When Is the Coefficient of Variation Useful?

Standard deviation keeps the original unit, which works well when comparing data with the same unit and similar means. The coefficient of variation divides a standard deviation by the absolute mean and expresses relative spread as a percentage.

This tool uses the following definition:

text
Displayed coefficient of variation = population SD ÷ |mean| × 100

In the default example, the population standard deviation is 2 and the mean is 5, giving a coefficient of variation of 40%.

CV is not meaningful for every kind of measurement. The NIST coefficient of variation reference says it should typically be used with ratio-scale data that has a meaningful zero. [2] Celsius temperature does not have a “no temperature” zero, so comparing Celsius variability with CV can be misleading.

CV also becomes unstable when the mean is close to zero because the denominator is very small. When the mean is exactly zero, this calculator displays an em dash. If you simply need to calculate one value as a percentage of another, use the percentage calculator instead.

Common Input and Result Questions

Why Is Sample Standard Deviation Missing for One Value?

Sample variance divides by n − 1. With one observation, that denominator is zero, so sample variance and sample standard deviation are undefined and the page displays an em dash. Population variance and population standard deviation remain defined and both equal zero.

What If Every Value Is the Same?

The standard deviation is zero. Every value equals the mean, so every deviation and squared deviation is zero. A sample result still requires at least two values.

Does a Larger Standard Deviation Mean the Data Is Worse?

No. Standard deviation describes spread around the mean; it does not label the outcome good or bad. Less variation may be desirable for manufacturing tolerances, while varied preferences are not inherently a defect. Interpret the value with its unit, goal, and data source.

Can the Calculator Accept Negative Numbers and Decimals?

Yes. Finite integers, decimals, and negative values are included. If an input or computed metric exceeds the representable range or is not finite, the tool reports that the result is too large or invalid.

Why Does Excel or Another Statistics Tool Give a Different Answer?

First check whether its function calculates a population or a sample statistic. Software may default to n or n − 1, and it may handle blanks, text, missing values, and rounding differently. Recalculating the eight-value example above usually exposes the convention mismatch.

Which Result Should You Report?

Write down what the values cover and what question you want to answer before selecting a result. Do not choose whichever standard deviation looks smaller. For a complete data set you only intend to describe, use the population result. For sampled observations used to estimate a larger population, report the sample result and describe the sample source, size, and selection method.

A calculator removes arithmetic errors. It cannot decide whether the data is representative. That judgment still belongs to the person doing the analysis.

References

  1. NIST/SEMATECH, Measures of Scale: sample standard deviation formula and measurement units
  2. NIST Dataplot, Coefficient of Variation: definition and appropriate measurement scale
On this page