AI CalculatorAI Calculator

    Standard Deviation Calculator

    Calculate standard deviation and variance

    How It Works

    Overview

    Standard deviation measures how spread out the values in a dataset are around their mean. A small standard deviation means values cluster tightly near the mean; a large one means values are scattered far from it. Two datasets with identical means can behave completely differently — and standard deviation is the number that captures that difference.

    There are two formulas, and they're not interchangeable. The population standard deviation (σ) divides by N and applies when your data is the entire population of interest. The sample standard deviation (s) divides by N − 1 and applies when your data is a sample used to estimate a larger population — the usual case in real-world analysis. This calculator shows both so you can pick the right one.

    The Formula

    σ = √(Σ(xᵢ − μ)² / N) | s = √(Σ(xᵢ − x̄)² / (n − 1))

    Where:

    • xᵢ = each data point
    • μ (or ) = the mean of the dataset
    • N = total values when the data is the whole population
    • n = total values in a sample

    The N − 1 in the sample formula is Bessel's correction. The sample mean sits inside the sample, making squared deviations from it slightly smaller than they would be from the unknown true mean. Dividing by n − 1 instead of n compensates and yields an unbiased estimate of population variance.

    Worked Example

    Take eight measurements: 10, 12, 23, 23, 16, 23, 21, 16.

    • Mean = 144 / 8 = 18
    • Squared deviations: 64, 36, 25, 25, 4, 25, 9, 4 — sum = 192
    • Population variance = 192 / 8 = 24; σ ≈ 4.90
    • Sample variance = 192 / 7 ≈ 27.43; s ≈ 5.24

    The two values agree on the rough size of the spread (~5 units). Notice how much the sample formula nudges the answer with only n = 8: 5.24 vs 4.90 is a 7% difference. With n = 100 the gap would shrink to under 1%.

    In context: if those numbers were quiz scores out of 25, mean 18 with SD ~5 means most students scored between 13 and 23 — a fairly wide spread for a quiz.

    When to Use This

    • Reporting experimental results — quote mean ± standard deviation alongside sample size.
    • Process control — flag when SD shifts upward, indicating a process is becoming less consistent.
    • Risk and finance — investment volatility is measured as the SD of returns; higher SD means higher risk.
    • Standardizing data (z-scores) — a z-score = (value − mean) / SD lets you compare values across datasets.
    • Setting tolerance limits — many quality systems flag anything beyond ±3 SD ("six sigma" inspires that idea).

    Common Mistakes to Avoid

    • Using the population formula on a sample. Slightly underestimates spread; meaningful for small n. Default to sample SD unless you truly have the whole population.
    • Reporting variance instead of SD. Variance is in squared units and harder to interpret. Always communicate spread as standard deviation.
    • Comparing SDs of differently scaled data. An SD of 5 means very different things on a 0–10 scale vs a 0–1000 scale. Use the coefficient of variation (SD / mean) for cross-scale comparisons.
    • Assuming the 68-95-99.7 rule for non-normal data. The empirical rule is for roughly normal distributions; heavy-tailed data has more extreme outliers than the rule suggests.
    • Mixing units. All values must be in the same units before computing SD — converting half the dataset from inches to feet silently breaks the result.

    Frequently Asked Questions

    Ad Space