March 28, 20266 min read

How to Calculate Standard Deviation — Step-by-Step with Examples

Learn how to calculate standard deviation step by step — population vs sample, variance, worked examples with real numbers, and practical interpretation.

standard deviation statistics math variance calchub data analysis
Ad 336x280

Standard deviation tells you how spread out a set of numbers is from the average. A small standard deviation means the values cluster tightly around the mean; a large one means they're scattered widely. It's the most commonly used measure of variability in statistics — and understanding how to calculate it by hand makes the concept click.

Use the CalcHub statistics calculator for instant results, or follow the manual steps below.

The Formula

Population Standard Deviation (σ):
σ = √(Σ(xi - μ)² / N)
Sample Standard Deviation (s):
s = √(Σ(xi - x̄)² / (n - 1))

Where:


  • xi = each individual value

  • μ or x̄ = the mean (average)

  • N = population size / n = sample size

  • Σ = sum of all values


The only difference: population divides by N; sample divides by (n-1). The (n-1) is called Bessel's correction and prevents underestimating variability when working with a sample.

Step-by-Step Calculation

Dataset: Test scores of 8 students

78, 82, 85, 90, 88, 72, 95, 86

Step 1: Calculate the Mean

Mean (x̄) = (78 + 82 + 85 + 90 + 88 + 72 + 95 + 86) / 8
= 676 / 8
= 84.5

Step 2: Find Each Deviation from the Mean

Value (xi)Deviation (xi - x̄)Squared (xi - x̄)²
78-6.542.25
82-2.56.25
850.50.25
905.530.25
883.512.25
72-12.5156.25
9510.5110.25
861.52.25

Step 3: Sum the Squared Deviations

Σ(xi - x̄)² = 42.25 + 6.25 + 0.25 + 30.25 + 12.25 + 156.25 + 110.25 + 2.25
= 360.00

Step 4: Calculate Variance

Sample variance (if these 8 students are a sample):
s² = 360.00 / (8 - 1) = 360.00 / 7 = 51.43
Population variance (if these are ALL the students):
σ² = 360.00 / 8 = 45.00

Step 5: Take the Square Root

Sample standard deviation:
s = √51.43 = 7.17
Population standard deviation:
σ = √45.00 = 6.71

Interpreting the Result

The sample standard deviation is 7.17, and the mean is 84.5. This tells us:

  • Most scores fall within one standard deviation of the mean: 84.5 ± 7.17 → between 77.3 and 91.7
  • Looking at our data: 6 out of 8 values (75%) fall in this range — close to the theoretical 68% for normal distributions

The 68-95-99.7 Rule

For normally distributed data:

RangeContains
Mean ± 1 SD~68% of data
Mean ± 2 SD~95% of data
Mean ± 3 SD~99.7% of data
This rule is essential for understanding probability, quality control, and statistical significance.

When to Use Population vs Sample SD

ScenarioUse
You have data for every member of the groupPopulation (σ)
You have a subset and want to estimate the group's variabilitySample (s)
Survey of 500 people out of a citySample
All test scores in a classPopulation
Monthly returns of a specific stock over 5 yearsPopulation (for that period)
In practice, sample standard deviation is used far more often because we rarely have complete population data.

Real-World Applications

Finance: Standard deviation of stock returns measures volatility. A stock with 25% annual SD is much riskier than one with 8% SD, even if both have the same average return. Quality control: Manufacturing tolerances use standard deviation. If a part should be 50mm ± 0.5mm, the process SD should be well below 0.5mm to keep defects rare. Education: Standardized test scores are reported in terms of standard deviations from the mean (Z-scores). A score 2 SDs above the mean is in the top ~2.5%. Science: Measurement uncertainty is expressed as standard deviation. An experiment reporting "45.2 ± 0.3 cm" means the SD of measurements was 0.3 cm.

Practical Tips

1. Standard deviation has the same units as the data. If your data is in rupees, the SD is in rupees. Variance is in rupees-squared, which is why SD is more interpretable. 2. SD is sensitive to outliers. A single extreme value can dramatically increase the standard deviation. For data with outliers, consider using interquartile range (IQR) instead. 3. Low SD doesn't mean the average is meaningful. A class with all students scoring 50/100 has very low SD but poor performance. Always look at the mean alongside the SD.

What's the difference between standard deviation and variance?

Variance is the average of squared deviations from the mean. Standard deviation is the square root of variance. SD is preferred for interpretation because it's in the same units as the original data. Variance is used in mathematical derivations because squared values have convenient mathematical properties.

Can standard deviation be zero?

Yes — when all values in the dataset are identical. If every student scored exactly 84, the deviations would all be zero, making SD = 0. This means there is no variability at all.

Why do we square the deviations instead of using absolute values?

Squaring serves multiple purposes: it eliminates negative signs (like absolute values), gives more weight to larger deviations (which is often desirable), and produces a function that's differentiable everywhere (important for mathematical optimization). The resulting measure — using absolute deviations instead — is called Mean Absolute Deviation (MAD) and is valid but less commonly used.

Ad 728x90