Σ
SDCalc
BeginnerFundamentals·9 min

What Is Standard Deviation? Definition, Formula & Examples

Learn what standard deviation is, how to calculate it for samples and populations, and why it is crucial for data analysis. Master the formulas today.

By Standard Deviation Calculator Team · Data Science Team·Published

What Is Standard Deviation?

Standard deviation is a statistical measure that quantifies the amount of variation or dispersion in a set of data values. A low standard deviation indicates that the data points tend to be close to the mean (expected value) of the set, while a high standard deviation indicates that the data points are spread out over a wider range of values. Represented by the Greek letter σ (sigma) for populations and s for samples, it is one of the most fundamental concepts in descriptive statistics.

Core Definition

Standard deviation measures the typical distance of each data point from the mean. It tells you, on average, how much your data varies from the center.

Population vs. Sample Standard Deviation

Before calculating standard deviation, you must determine whether your data represents an entire population or a sample of a population. A population includes all members of a specified group, whereas a sample is a representative subset of that group. Calculating the standard deviation for a sample requires a mathematical adjustment—using n - 1 (degrees of freedom, or df) instead of N—to ensure the result is an unbiased estimator of the population variance.

Population Standard Deviation

Used when you have data for the entire group. Denoted by σ. The denominator in the variance formula is N (the total population size).

Sample Standard Deviation

Used when you have a subset of the group. Denoted by s. The denominator in the variance formula is n - 1 (sample size minus one) to correct for bias.

The Standard Deviation Formula Explained

The formulas for standard deviation rely on calculating the variance first, and then taking the square root. This square root step is crucial because it brings the measure of spread back into the original units of the data. The key components are xᵢ (each individual value), μ or (the population or sample mean), and N or n (the total number of values).

Population SD

σ = √[ Σ(xᵢ - μ)² / N ]

Sample SD

s = √[ Σ(xᵢ - x̄)² / (n - 1) ]

Step-by-Step Calculation Example

Let's calculate the sample standard deviation for a small dataset of test scores: [4, 8, 6, 5, 3, 2, 8, 9, 2, 5]. Following the formula step-by-step reveals how the variance accumulates before we take the final square root.

1

Calculate the Mean (x̄)

Sum all values and divide by the count: (4+8+6+5+3+2+8+9+2+5) / 10 = 52 / 10 = 5.2
2

Subtract the Mean and Square the Result

For each value, find the squared difference: (4-5.2)² = 1.44, (8-5.2)² = 7.84, (6-5.2)² = 0.64, etc.
3

Sum the Squared Differences

Add all the squared results together: 1.44 + 7.84 + 0.64 + 0.04 + 4.84 + 10.24 + 7.84 + 14.44 + 10.24 + 0.04 = 57.6
4

Divide by n - 1 (Degrees of Freedom)

Divide the sum by the sample size minus one: 57.6 / (10 - 1) = 57.6 / 9 = 6.4. This is the sample variance (σ²).
5

Take the Square Root

Find the square root of the variance: √6.4 ≈ 2.53. The sample standard deviation is 2.53.

Calculating Standard Deviation in Python

Calculating standard deviation manually is prone to error, especially with large datasets. In practice, statisticians and data scientists use programming languages like Python to compute it instantly using built-in libraries.

python
import statistics

data = [4, 8, 6, 5, 3, 2, 8, 9, 2, 5]

# Calculate sample standard deviation (default)
sample_sd = statistics.stdev(data)
print(f"Sample SD: {sample_sd:.2f}")

# Calculate population standard deviation
pop_sd = statistics.pstdev(data)
print(f"Population SD: {pop_sd:.2f}")

The Empirical Rule and Standard Deviation

When data follows a normal distribution (bell curve), the standard deviation becomes incredibly predictive. The Empirical Rule, also known as the 68-95-99.7 rule, states that nearly all data will fall within three standard deviations of the mean. This allows analysts to quickly identify outliers and understand the probability of a specific observation occurring.

Interval from MeanPercentage of DataApplication
±1σ68.27%Identifying typical, everyday values
±2σ95.45%Setting confidence intervals
±3σ99.73%Detecting extreme outliers

Standard Deviation vs. Variance

Variance and standard deviation are closely related measures of spread. Variance (σ² or s²) is the average of the squared differences from the Mean, while standard deviation is the square root of the variance. Because variance is expressed in squared units (e.g., square dollars, square inches), it can be difficult to interpret in the context of the original data. Standard deviation resolves this by converting the measure back into the original units.

Reporting Your Data

Always report the standard deviation alongside the mean when describing your data. Because the SD is in the same units as the mean (e.g., dollars, inches, kilograms), it provides an intuitive measure of spread that your audience can immediately understand.

Common Pitfalls to Avoid

While standard deviation is a powerful tool, it is frequently misused. Misapplying the formulas or misunderstanding what the value represents can lead to flawed data analysis and incorrect conclusions.

  • Using the population formula for a sample: Forgetting to use n - 1 for samples artificially lowers the calculated spread, underestimating the true population variance.
  • Applying SD to non-normal distributions: The Empirical Rule only applies to normal distributions. For highly skewed data, SD might not accurately reflect the spread.
  • Confusing SD with Standard Error: The standard error measures the precision of a sample mean estimate, while standard deviation measures the spread of the underlying data itself.

Watch Out for Outliers

Standard deviation is highly sensitive to extreme outliers. Because the formula squares the differences from the mean, a single massive outlier can disproportionately inflate the standard deviation, making the data appear more variable than it actually is.

Further Reading

Sources

References and further authoritative reading used in preparing this article.

  1. Wikipedia: Standard Deviation
  2. NIST/SEMATECH e-Handbook of Statistical Methods
  3. Khan Academy: Statistics and Probability