Standard Deviation Formula: Population vs Sample

The standard deviation is a fundamental measure of how spread out numbers are in a dataset. It tells you, on average, how far each data point lies from the mean. The formula looks intimidating at first, but once you break it down, it's quite logical. This article dives deep into the standard deviation formula for both sample and population data, explains each part, and shows why the formula works the way it does.

Sample vs. Population Formula

There are two versions of the standard deviation formula: one for a sample and one for a population. The difference is a small change in the denominator — using n-1 for a sample and n for a population. This adjustment corrects for bias when you're estimating the population standard deviation from a sample. On the Statistics Calculator, you can choose between Sample (n-1) and Population (n) under Data Type.

Population Standard Deviation (σ)

σ = √( Σ(x_i - μ)^2 / N )
σ (sigma)
Population standard deviation
x_i
Each individual value in the population
μ (mu)
Population mean
N
Number of values in the population
Σ
Sum of all values

Sample Standard Deviation (s)

s = √( Σ(x_i - x̄)^2 / (n - 1) )
s
Sample standard deviation
x_i
Each individual value in the sample
x̄ (x-bar)
Sample mean
n
Number of values in the sample
n - 1
Degrees of freedom adjustment (Bessel's correction)

Breaking Down the Formula

The core of both formulas is the same: average squared distance from the mean. Let's unpack each piece.

1. Calculate the mean: First, find the average of your data. For a population, that's μ = Σx_i / N. For a sample, it's x̄ = Σx_i / n.

2. Find the deviations: For each data point, subtract the mean: (x_i - x̄) or (x_i - μ). This tells you how far that point is from the center. Some deviations are positive (above mean), some negative (below mean).

3. Square the deviations: Squaring makes all values positive and gives more weight to larger deviations. This is crucial because deviations above and below the mean would otherwise cancel out, giving zero total deviation.

4. Sum the squared deviations: Add up all the squared differences: Σ(x_i - x̄)^2. This total represents the overall spread.

5. Divide by (n or n-1): For a population, divide by N to get the variance (σ^2). For a sample, divide by n-1 (not n) to get the sample variance (s^2). Dividing by n-1 corrects for the fact that a sample tends to underestimate the true population variance — this is called Bessel's correction.

6. Take the square root: Finally, take the square root of the variance to get the standard deviation. This brings the units back to the original scale (e.g., dollars, inches), making interpretation easier.

The result is the standard deviation, a single number that summarizes how spread out the data is.

Why the Formula Works: Intuition & Units

The standard deviation is like a ruler that measures the typical distance of data points from the mean. Squaring the differences does two things: it removes negative signs (so distances always add up) and it emphasizes outliers (because squaring makes large numbers much larger). Then the square root brings the value back to the same units as the data.

Think of it this way: the variance is the average squared distance from the mean, and the standard deviation is the square root of that. So if your data is in meters, the variance is in square meters, but the standard deviation is back in meters — easy to grasp.

The choice of n-1 for a sample is a mathematical adjustment to give an unbiased estimate of the population standard deviation. If you used n, your sample standard deviation would be too small on average. This is especially important with small samples. For a full explanation, see the Standard Deviation: Population vs Sample (2026 Guide).

Historical Origin

The concept of standard deviation was introduced by Francis Galton in the late 1800s and refined by Karl Pearson, who used the Greek letter σ for population standard deviation. The use of n-1 in the sample formula is credited to Friedrich Bessel (hence Bessel's correction) in the 19th century, though it was later popularized by William Gosset (Student) in his work on small-sample statistics.

Practical Implications & Edge Cases

Zero Standard Deviation

If every value in your dataset is identical, the standard deviation is 0. For example, if all test scores are 85, there is no spread. This makes sense: if there's no variation, the typical distance from the mean is zero.

Effect of Outliers

Because standard deviation squares deviations, a single extreme outlier can inflate the value dramatically. This is why you should always check for outliers and consider using the interquartile range (IQR) as a robust alternative. The Statistics Calculator provides both standard deviation and IQR so you can compare.

Large Datasets

For very large datasets, the difference between dividing by n and n-1 becomes negligible. But for small samples (say, n < 30), using n-1 is essential for unbiased estimation.

Different Data Types

The formula assumes the data is numerical and at the interval or ratio level. You cannot compute a meaningful standard deviation for categorical data (e.g., colors or brands).

For a step-by-step walkthrough of calculating standard deviation by hand, see How to Calculate Standard Deviation Step by Step (2026 Guide). And for help interpreting your result, check out How to Interpret Standard Deviation: Values & Ranges (2026).

Try the free Statistics Calculator ⬆

Get your Standard deviation as a measure of dispersion result instantly — no signup, no clutter.

Open the Statistics Calculator

Contact Us