Standard Deviation Calculator

Find sample or population variance, standard deviation, quartiles and a data histogram.

Try a worked example

Loads example values in place of your current inputs. Choose one, then calculate. Examples are hypothetical; your inputs stay in this browser.

  • For 2,4,4,4,5,5,7,9 the mean is 5 and squared-deviation sum is 32. Population variance is 4 (SD 2); sample variance is 32/7 (SD about 2.13809).
  • 10,000,000,000,000,000; the same value again; and 10,000,000,000,000,002 have population variance 8/9 and SD about 0.942809. Centered calculation preserves the spread despite a rounded displayed mean.
  • Five measurements of 7 have mean 7 and zero spread under either convention. Zero spread in this dataset does not prove that the wider population has no variation.
  • For sample values 2,4,6, mean 4 and SD 2 give CV 0.5 and relative SD 50%. Interpret only for a meaningful-zero measurement scale.
Enter 2–2,000 values. Use no thousands separators: 1,000 is read as two observations.
Use a meaningful-zero ratio scale. A zero mean makes relative measures undefined.

About this tool

Paste a dataset to calculate population or sample standard deviation, variance, mean and quartiles. Each deviation and squared deviation is visible in a table, with a histogram and CSV export for checking the arithmetic.

Calculate spread and retain a checkable worksheet

  1. Paste 2 to 2,000 numeric observations separated by spaces, commas, semicolons or new lines. Do not include thousands separators within a number: 1,000 is read as two observations.
  2. Choose Population to describe the complete set of interest, or Sample when estimating a wider population from observations. Calculate to see both conventions side by side.
  3. Inspect the observation-level deviations, squared-deviation sum and selected divisor. Read the histogram as a descriptive view, not a normality test or an outlier-removal rule.
  4. Download CSV to retain the selected convention, summary, both variance/SD comparisons and every observation-level row. Values are processed in this browser; no data-cleaning or missing-value substitution is performed.

How the calculation works

Mean=Σx/n. Squared-deviation sum=Σ(x−mean)². Population variance divides by n; sample variance divides by n−1. Standard deviation is the square root of variance.

Can you calculate standard deviation from the mean alone?

The mean alone cannot determine standard deviation, even when you know the count. Both lists below have three observations and a mean of 5. Their standard deviations differ because the observations lie at different distances from 5.

For 4, 5, 6 the deviations from 5 are −1, 0 and 1. Their squares sum to 2, so the sample standard deviation is √(2 ÷ 2) = 1. For 2, 5, 8 the deviations are −3, 0 and 3. Their squares sum to 18, so the sample standard deviation is √(18 ÷ 2) = 3.

If you already know the count n and the sum of squared deviations SS = Σ(x − x̄)² about the same data’s arithmetic mean, use √(SS ÷ (n − 1)) for a sample of at least two observations or √(SS ÷ n) for a whole population. Squaring the raw observations gives a different total, Σx².

Formula reference: NIST/SEMATECH: Measures of Scale.

Load either dataset in the calculator, then choose Calculate to see the working.

Plan sample size from standard deviation

How many independent observations do you need to estimate one population mean? Enter the known population standard deviation (σ) and the largest margin of error you can accept, in the same units. A margin of 2 means the interval extends 2 units on each side of the sample mean.

Enter 50 to 99.99 percent.

For a two-sided z interval, the margin is zσ/√n. The required count is (zσ / target margin)² rounded up, with a minimum of one observation. With σ = 10, a margin of ±2 and 95% confidence, you need 97 observations. At 96 the margin is about 2.00038. At 97 it drops to about 1.99004.

This calculation assumes independent random observations and a known population standard deviation. The interval is exact for a normal population and approximate when the sample mean is approximately normal. A standard deviation from earlier observations is a planning assumption. If the population is more variable, you may need a larger sample.

Penn State’s worked examples for choosing a sample size and the interval formula with known population standard deviation.

Worked example

For 2,4,4,4,5,5,7,9, the mean is 5, population variance is 4 and population standard deviation is 2. Sample variance is 32/7, with standard deviation approximately 2.13809.

Why population and sample answers differ

For 2,4,4,4,5,5,7,9, the eight deviations from mean 5 have squared sum 32. Dividing by 8 gives population variance 4 and SD 2. Dividing the same 32 by 7 gives sample variance about 4.57143 and SD about 2.13809. The denominator changes; the entered data and squared-deviation sum do not.

Choose the convention from the question you are answering, rather than whichever result is smaller. The n minus one correction targets variance estimation under sampling assumptions. It does not make a biased sample representative and does not make sample standard deviation an exactly unbiased estimator of population standard deviation.

Large measurements can hide a small spread

The values 10000000000000000, 10000000000000000 and 10000000000000002 have population variance 8/9, about 0.888888889. Their exact mean lies two-thirds above the first value, which cannot be represented as a distinct ordinary browser number at that scale. Subtracting a rounded large mean can therefore change the calculated spread.

The calculation first centers the values near their midpoint, sums the offsets with compensation and calculates deviations within that shifted coordinate system. It scales deviations before squaring to protect the SD calculation for tiny magnitudes. The displayed mean and individual numbers still use binary floating-point arithmetic; digits already lost when an input is parsed cannot be recovered. If variance underflows to zero while SD remains nonzero, an explicit numeric-range notice is shown. Histogram coordinates are shifted and labeled when large offsets would collapse the bin boundaries.

Interpret the units and the limits

For measurements in centimetres, SD is in centimetres and variance is in square centimetres. SD measures spread among observations; it is not the standard error of the mean. A zero SD describes equal entered values and does not prove a wider population has no variation.

Large deviations receive extra weight because they are squared. Compare the histogram, median and quartiles when a few extreme observations dominate. Quartiles here use linear interpolation at (n minus one) times p; other software can use another convention. The tool does not test normality, infer causation, detect fraud, remove observations or provide a complete statistical analysis.

Use your mean and standard deviation to calculate a Z-score for one value.

Express standard deviation as a percentage

Select Show relative SD (%) and CV to add relative measures using the chosen sample or population SD. CV = SD / mean is a signed ratio. Relative SD (%) = 100 × SD / |mean| is nonnegative. For sample values 2,4,6, mean 4 and SD 2 give CV 0.5 and relative SD 50%.

Interpret these quantities only on a ratio scale with a meaningful zero, such as measured mass. Celsius and Fahrenheit temperatures do not qualify. Near-zero means make the ratios unstable. A zero mean is undefined; a nonzero constant dataset gives zero. These measures do not construct a confidence interval or establish a quality threshold.

Assumptions and limitations

Accepts 2–2,000 finite values. Quartiles use linear interpolation at (n−1)p. Histogram uses equal-width bins, with the last upper edge included. No weights, missing-value imputation or outlier removal.

Choose population only when describing the full population of interest. Sample correction does not by itself fix biased sampling or make a nonrepresentative dataset representative.

Sources and editorial responsibility

Maintained by Renvoro Pty Ltd. Sources inform the methods and assumptions shown here; outputs have the limitations described on this page.

Common questions

Should I use sample or population standard deviation?

Use population when the values are the complete set you want to describe. Use sample standard deviation when estimating spread from a sample. The denominators are n and n − 1 respectively.

Why is standard deviation zero for identical values?

Every value equals the mean, so every deviation from the mean is zero. Squaring, averaging and taking the square root still gives zero.

What is the difference between variance and standard deviation?

Variance is in squared units. Standard deviation is its square root, in the original units of the measurements.

Guide updated 2026-11-11. Calculation method and source dates remain separate.

Method reviewed 2026-10-22. Calculation standards · Report an issue