Skip to content

How to Calculate Standard Deviation: Step-by-Step

CalculatorGlobe Team February 23, 2026 13 min read Math

Standard deviation is one of the most important measures in statistics. It tells you how spread out the values in a data set are relative to the mean. Whether you are analyzing test scores, stock returns, manufacturing tolerances, or scientific measurements, understanding standard deviation gives you a clear picture of data variability that the mean alone cannot provide.

This guide walks you through both population and sample standard deviation formulas with step-by-step calculations, shows you how to interpret results using the 68-95-99.7 rule, and provides practical real-world examples that make the concept concrete.

What Is Standard Deviation?

Standard deviation measures the average distance between each data point and the mean of the data set. A small standard deviation means the values cluster tightly around the mean, while a large standard deviation means the values are spread over a wider range.

Consider two classes that both averaged 80 on an exam. In Class A, scores ranged from 75 to 85 with a standard deviation of 3.2. In Class B, scores ranged from 50 to 100 with a standard deviation of 15.8. The same mean tells a very different story when paired with these different standard deviations. Class A performed uniformly, while Class B had dramatic variation between high and low performers.

Formally, standard deviation is the square root of variance. Variance calculates the average of the squared differences from the mean. Taking the square root converts the result back into the original units of measurement, making standard deviation far more intuitive to interpret than variance.

Population vs Sample Standard Deviation

There are two versions of the standard deviation formula, and choosing the right one depends on whether your data represents an entire population or a sample drawn from a larger population.

Population Standard Deviation (σ)

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

  • σ (sigma) = population standard deviation
  • xᵢ = each individual value
  • μ (mu) = population mean
  • N = total number of values in the population

Sample Standard Deviation (s)

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

  • s = sample standard deviation
  • xᵢ = each individual value
  • (x-bar) = sample mean
  • n = number of values in the sample

The key difference is the denominator: population standard deviation divides by N, while sample standard deviation divides by N minus 1. This adjustment, known as Bessel's correction, compensates for the fact that a sample tends to underestimate the variability of the population it was drawn from. When you calculate the mean from a sample, you have already used one piece of information from the data, leaving only N minus 1 independent data points (degrees of freedom) for estimating variability.

Use population standard deviation when you have data for every member of the group: all employees in a company, all students in a classroom, all products in a batch. Use sample standard deviation when your data is a subset: a survey of 500 out of 10,000 customers, 30 randomly selected widgets from a production run of 10,000, or blood pressure readings from 200 patients representing a larger population.

Step-by-Step Calculation

Both formulas follow the same five-step process. The only difference is step 4, where you divide by N for population or N minus 1 for sample data.

  1. Calculate the mean — Add all values and divide by the number of values.
  2. Find each deviation from the mean — Subtract the mean from each data point.
  3. Square each deviation — This eliminates negative signs and gives more weight to larger deviations.
  4. Calculate the average of the squared deviations — Divide the sum of squared deviations by N (population) or N minus 1 (sample). This result is the variance.
  5. Take the square root of the variance — This converts the result back to the original units, giving you the standard deviation.

Population Standard Deviation Example

Suppose a teacher has a class of 6 students who scored the following on a quiz (out of 20): 12, 15, 18, 14, 16, 13. Since this represents the entire class, we use population standard deviation.

Step 1: Calculate the mean (μ)

μ = (12 + 15 + 18 + 14 + 16 + 13) / 6 = 88 / 6 = 14.67

Step 2 & 3: Find deviations and square them

Score (xᵢ) Deviation (xᵢ - μ) Squared (xᵢ - μ)²
12-2.677.13
150.330.11
183.3311.09
14-0.670.45
161.331.77
13-1.672.79

Step 4: Calculate variance (σ²)

σ² = (7.13 + 0.11 + 11.09 + 0.45 + 1.77 + 2.79) / 6 = 23.34 / 6 = 3.89

Step 5: Take the square root

σ = √3.89 = 1.97

The population standard deviation is 1.97 points. On average, each student's score deviates about 2 points from the class mean of 14.67.

Sample Standard Deviation Example

Rachel is a quality control analyst at a factory that produces thousands of bolts daily. She randomly selects 8 bolts and measures their length in millimeters: 50.2, 49.8, 50.1, 50.3, 49.9, 50.0, 50.4, 49.7. Since these 8 bolts are a sample from the full production, she uses sample standard deviation.

Step 1: Calculate the sample mean (x̄)

x̄ = (50.2 + 49.8 + 50.1 + 50.3 + 49.9 + 50.0 + 50.4 + 49.7) / 8 = 400.4 / 8 = 50.05

Step 2 & 3: Deviations and squared deviations

Length (xᵢ) Deviation (xᵢ - x̄) Squared (xᵢ - x̄)²
50.20.150.0225
49.8-0.250.0625
50.10.050.0025
50.30.250.0625
49.9-0.150.0225
50.0-0.050.0025
50.40.350.1225
49.7-0.350.1225

Step 4: Calculate sample variance (s²)

Sum of squared deviations = 0.42

s² = 0.42 / (8 - 1) = 0.42 / 7 = 0.06

Step 5: Take the square root

s = √0.06 = 0.245 mm

The sample standard deviation is 0.245 mm. Bolt lengths deviate by about a quarter of a millimeter from the sample mean, indicating tight manufacturing precision.

Try Our Standard Deviation Calculator

Enter your data set and instantly calculate both population and sample standard deviation with full step-by-step work shown.

Use Calculator

Interpreting Standard Deviation

Calculating standard deviation is only useful if you know how to interpret the result. The number itself has no universal threshold for "high" or "low" — it depends entirely on the context of your data and what you are measuring.

A standard deviation of 5 means very different things depending on the scale. For a data set of exam scores out of 100, a standard deviation of 5 indicates tightly grouped scores. For a data set of ratings on a 1-to-10 scale, a standard deviation of 5 would indicate extreme variability across nearly the entire range.

The coefficient of variation (CV) helps compare variability across different scales. It is calculated as the standard deviation divided by the mean, multiplied by 100 to express as a percentage. A CV of 10% means the standard deviation is 10% of the mean, providing a scale-free comparison of relative variability.

The 68-95-99.7 Rule

For data that follows a normal (bell-shaped) distribution, the standard deviation has a precise interpretation known as the empirical rule or the 68-95-99.7 rule:

68% of data falls within 1 standard deviation of the mean (μ ± 1σ)

95% of data falls within 2 standard deviations of the mean (μ ± 2σ)

99.7% of data falls within 3 standard deviations of the mean (μ ± 3σ)

For example, if the mean height of adult men in a country is 70 inches with a standard deviation of 3 inches, approximately 68% of men are between 67 and 73 inches tall, about 95% are between 64 and 76 inches, and roughly 99.7% are between 61 and 79 inches. Any man taller than 79 inches or shorter than 61 inches would be an extremely rare outlier — falling beyond three standard deviations from the mean.

This rule only applies to normally distributed data. For skewed or multi-modal distributions, the percentages will differ. However, Chebyshev's theorem guarantees that regardless of the distribution shape, at least 75% of data falls within 2 standard deviations and at least 89% falls within 3 standard deviations.

Practical Examples with Real Data

The following examples show how standard deviation applies across different fields with fictional but realistic scenarios.

Example 1: Marcus Compares Investment Risk

Marcus is evaluating two mutual funds for his retirement portfolio. He collected the annual returns for the past 5 years:

Fund A (Stable Growth):

Returns: 7%, 5%, 8%, 6%, 9%

Mean: 7.0%, SD: 1.41%

Fund B (Aggressive Growth):

Returns: 15%, -3%, 20%, 2%, 11%

Mean: 9.0%, SD: 8.51%

Fund B has a higher average return (9% vs 7%) but its standard deviation is six times larger. Marcus, who is 15 years from retirement, might tolerate Fund B's volatility for the higher expected return. Someone already retired would likely prefer Fund A's consistency.

Example 2: Elena Evaluates Employee Performance

Elena manages two customer support teams and tracks their weekly ticket resolution counts over 6 weeks:

Team Alpha:

Tickets: 45, 48, 42, 50, 47, 44

Mean: 46.0, SD: 2.68

Team Beta:

Tickets: 60, 25, 55, 30, 58, 48

Mean: 46.0, SD: 13.73

Both teams average the same number of tickets, but Team Beta's high standard deviation reveals wildly inconsistent performance. Elena investigates and discovers that Team Beta's output drops sharply when two key members are on scheduled training days. She adjusts the training schedule to stagger absences.

Example 3: Dr. Tanaka Analyzes Patient Recovery Times

Dr. Tanaka studies recovery times (in days) for two surgical techniques performed on 5 patients each:

Technique 1 (Traditional):

Days: 14, 12, 15, 13, 16

Mean: 14.0, SD: 1.41

Technique 2 (New Method):

Days: 8, 18, 10, 6, 13

Mean: 11.0, SD: 4.24

Technique 2 has a lower mean recovery time (11 vs 14 days) but much higher variability. While some patients recover in just 6 days, others take 18. Dr. Tanaka investigates whether patient characteristics predict who benefits most from the new technique, since the unpredictable outcomes may be a concern for surgical planning.

Try Our Mean Median Mode Calculator

Find the mean, median, mode, and range for any data set to complement your standard deviation analysis.

Use Calculator

Standard Deviation Reference Table

The following table provides typical standard deviation ranges across common applications. These values offer a frame of reference for interpreting your own calculations.

Application Typical Mean Typical SD CV (%) Interpretation
IQ Scores 100 15 15% 68% score between 85 and 115
SAT Scores (per section) 530 110 20.8% Wide range of student performance
Adult Male Height (US) 70 in 3 in 4.3% Low variability; heights cluster tightly
S&P 500 Annual Return 10% 16% 160% Very high volatility; returns swing widely
Manufacturing (bolt length) 50 mm 0.05 mm 0.1% Extremely tight precision required
Daily Temperature (NYC) 55°F 17°F 30.9% Seasonal variation creates wide spread

Tips for Working with Standard Deviation

Understanding the formula is just the beginning. Applying standard deviation effectively requires knowing its assumptions, limitations, and relationship to other statistical measures.

  • Always check for outliers first. A single extreme value can dramatically inflate standard deviation. Before calculating, plot your data or check for values that seem unreasonably far from the rest. Consider whether outliers represent genuine variation or data entry errors.
  • Use standard deviation alongside the mean. Neither measure is complete without the other. Reporting "average salary: $60,000" without the standard deviation hides whether most employees earn between $55,000 and $65,000 or between $30,000 and $90,000.
  • Verify normality before applying the 68-95-99.7 rule. The empirical rule only holds for approximately normal distributions. Create a histogram of your data to check for symmetry, or use a formal normality test like the Shapiro-Wilk test for smaller data sets.
  • Compare using the coefficient of variation when scales differ. You cannot directly compare the standard deviation of heights (measured in inches) with the standard deviation of weights (measured in pounds). The CV normalizes both to percentages of their respective means.
  • Use standard error when estimating population parameters. Standard error (SE = s / √n) measures the precision of your sample mean as an estimator of the population mean. It decreases as sample size increases, unlike standard deviation itself.
  • Know when to use alternatives. For highly skewed data, the interquartile range (IQR) may be a better measure of spread because it is not affected by extreme values. The mean absolute deviation (MAD) is another robust alternative.

Common Mistakes to Avoid

  • Using population formula for sample data. This is the most common error. If your data is a subset of a larger group, always divide by n minus 1, not n. Dividing by n underestimates the true population standard deviation.
  • Forgetting to square root the variance. Variance is in squared units, which are not directly interpretable. If your data is in dollars, variance is in dollars-squared. Always take the square root to get back to meaningful units.
  • Comparing standard deviations across different scales. A standard deviation of 10 on a 1,000-point scale is proportionally tiny, while 10 on a 20-point scale is enormous. Use the coefficient of variation for cross-scale comparisons.
  • Ignoring the shape of the distribution. Standard deviation assumes nothing about distribution shape, but its interpretation changes dramatically. For skewed data, the mean and standard deviation may not effectively describe the center and spread.
  • Calculating standard deviation from summary statistics. You cannot correctly compute the standard deviation of combined groups by simply averaging their individual standard deviations. The combined standard deviation requires knowledge of group means, group sizes, and group variances.

Try Our Statistics Calculator

Perform comprehensive statistical analysis on your data including mean, median, standard deviation, and more.

Use Calculator

Frequently Asked Questions

Variance is the average of the squared differences from the mean, while standard deviation is the square root of variance. Standard deviation is expressed in the same units as the original data, making it easier to interpret. For example, if test scores have a variance of 225, the standard deviation is 15 points, which directly tells you the typical spread from the average score.

Use population standard deviation (dividing by N) when your data set includes every member of the group you are studying, such as test scores for an entire class. Use sample standard deviation (dividing by N minus 1) when your data is a subset drawn from a larger group, such as surveying 100 people from a city of 50,000. The N minus 1 correction, called Bessel correction, compensates for the tendency of samples to underestimate the true population variability.

No, standard deviation cannot be negative. Since it is calculated by squaring differences from the mean and then taking the square root, the result is always zero or positive. A standard deviation of zero means every value in the data set is identical. Any positive value indicates that data points vary from the mean, with larger values indicating greater spread.

A large standard deviation indicates that data points are spread widely around the mean. This means there is high variability in your data set. For instance, if the average house price in a neighborhood is $350,000 with a standard deviation of $150,000, homes range from very affordable to quite expensive. In contrast, a standard deviation of $25,000 would suggest prices cluster tightly around that average.

In investing, standard deviation measures the volatility of an asset or portfolio. A stock with an annual return standard deviation of 20% is more volatile and considered riskier than one with a standard deviation of 8%. Financial advisors use standard deviation alongside mean return to assess the risk-reward profile of investments, helping clients choose portfolios matching their risk tolerance. The Sharpe ratio divides excess return by standard deviation to measure risk-adjusted performance.

Not necessarily. The desirability of low versus high standard deviation depends on context. In manufacturing, low standard deviation in product dimensions means consistent quality, which is desirable. However, in an investment portfolio, some volatility (higher standard deviation) is expected in exchange for higher potential returns. Similarly, in classroom performance, extremely low standard deviation might indicate that a test failed to differentiate between students of different ability levels.

Increasing the sample size does not systematically increase or decrease the standard deviation of the sample itself. However, larger samples tend to produce a standard deviation closer to the true population value. More importantly, the standard error of the mean (standard deviation divided by the square root of N) decreases as sample size increases, meaning your estimate of the population mean becomes more precise with larger samples.

Sources & References

  1. NIST/SEMATECH e-Handbook of Statistical Methods — Measures of scale including standard deviation: itl.nist.gov
  2. Wikipedia — Standard Deviation — Comprehensive overview of standard deviation formulas and properties: en.wikipedia.org
  3. Scribbr — How to Calculate Standard Deviation — Step-by-step guide to calculating standard deviation with examples: scribbr.com
Share this article:

CalculatorGlobe Team

Content & Research Team

The CalculatorGlobe team creates in-depth guides backed by authoritative sources to help you understand the math behind everyday decisions.

Related Calculators

Related Articles

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.

Last updated: February 23, 2026