Audited 26 May 2026·Last updated 27 Jul 2026·7 citations·Tier 1·0 uses

Standard Deviation Calculator

Free standard deviation calculator: paste any dataset and get population σ, sample s, mean, variance, and count instantly, with full theory and worked steps.

Standard Deviation Calculator

Paste your numbers as a JSON array (e.g. [2, 4, 4, 4, 5, 5, 7, 9]) or as a plain comma-separated list (e.g. 2, 4, 4, 4, 5, 5, 7, 9). Whitespace and line breaks are tolerated. At least two values are required to compute a sample standard deviation.
Population standard deviation (σ)
2
The population standard deviation, σ. Computed by dividing the sum of squared deviations from the mean by n (not n−1). Use this when your dataset contains every member of the population you care about — every employee of a company, every product on a single production line, every game played by a team in a season.
Sample standard deviation (s)
2.1381
Mean (x̄)
5
Population variance (σ²)
4
Sample variance (s²)
4.5714
Count (n)
8

Background.

The Quanta standard deviation calculator takes any list of numbers — pasted as a JSON array, copied out of a spreadsheet column, or typed in as a comma-separated line — and returns the two standard-deviation flavours (population σ and sample s), the corresponding variances, the mean, and the sample size in a single pass. Standard deviation is the most important measure of dispersion in all of statistics: it tells you, in the same units as the original data, how far a typical observation sits from the mean. Where the range looks only at the two extreme values and the interquartile range looks only at the middle 50%, the standard deviation uses every observation, weights each one by the square of its distance from the mean, and produces a single number that is mathematically tractable enough to drive every confidence interval, every hypothesis test, every z-score, and every quoted volatility on a stock chart you will ever see.

The distinction between the population and sample versions is the one thing students most often get wrong. Use the population formula (divide by n) when your data is the entire population you care about — every employee on a single payroll, every keystroke logged on one keyboard, every game played by a team in one season. Use the sample formula (divide by n−1, Bessel's correction) when your data is a sample drawn from a larger population that you would like to make inferences about — 500 voters out of a country of millions, 30 light bulbs out of a production run of 100,000, ten test scores out of a class of forty. The n−1 divisor exists because the sample mean is itself estimated from the data and is therefore by construction closer to the sample than the unknown population mean would be; dividing by n−1 corrects for that systematic underestimate and makes s² an unbiased estimator of σ². The correction is large for tiny samples (n = 2 makes the divisor half of n) and negligible by the time n passes a few hundred, which is why for big-data work the two answers agree to many decimal places and you can stop worrying about which to use.

For small samples — exactly the regime where statisticians worry the most — the n−1 vs n choice changes the answer materially, which is why every serious statistics package, spreadsheet, and pocket calculator exposes both.

Once you have σ or s in hand, the 68–95–99.7 rule (also known as the empirical rule) does the rest of the heavy lifting for any roughly normally distributed dataset: about 68% of values lie within one standard deviation of the mean, about 95% within two, and about 99.7% within three. A test score 2σ above the class mean is in the top 2.5%; a stock daily return 3σ below the recent mean is the kind of event the financial press calls a "three-sigma event" and Wall Street risk desks track obsessively. Z-scores formalise this — z = (x − mean) / σ tells you in standard-deviation units how unusual a value is, and z-scores are directly comparable across datasets with completely different units, which is why they are the lingua franca of standardised testing, six-sigma manufacturing quality control, and effect-size reporting in medicine.

The calculator above and the explainer below cover every variant of the question: when to use σ versus s, why the divisor changes, how to read the empirical rule, how to convert between standard deviation and variance, why standard deviation is a far more informative summary of spread than the range, and how the same formula powers everything from psychometric test design to portfolio risk management to Six Sigma defect tracking. Worked examples cover classroom test scores, S&P 500 daily returns, manufacturing tolerances, and the canonical [2, 4, 4, 4, 5, 5, 7, 9] textbook dataset that gives a clean σ = 2.0 and is the easiest way to verify by hand that the calculator is doing the right thing.

What is standard deviation calculator?

Standard deviation is a measure of how spread out the values in a dataset are around their mean — reported in the same units as the original data. Formally, the standard deviation is the square root of the variance, where the variance is the average squared deviation of each value from the mean. There are two versions in everyday use, distinguished by what they divide the sum of squared deviations by. The population standard deviation, σ (Greek lowercase sigma), divides by n — the total number of observations — and is the right choice when the dataset includes every member of the population of interest. The sample standard deviation, s, divides by n−1 instead of n, an adjustment known as Bessel's correction, and is the right choice when the dataset is a sample drawn from a larger population about which you want to make inferences. The reason the sample formula uses n−1 rather than n is technical but worth understanding. The sample mean x̄ is itself computed from the data, so the deviations (xᵢ − x̄) are by construction smaller, on average, than the deviations (xᵢ − μ) from the true (unknown) population mean μ would be. Dividing the sum of squared deviations by n therefore systematically underestimates σ². Dividing by n−1 exactly compensates for that bias and makes s² an unbiased estimator of σ². The intuition is that fixing the sample mean uses up one "degree of freedom" — once x̄ is known, only n−1 of the deviations can vary freely; the last one is determined by the constraint Σ(xᵢ − x̄) = 0. The variance is itself a useful quantity — it is additive for independent variables (Var(X + Y) = Var(X) + Var(Y) when X and Y are independent), a property the standard deviation does not have — but variance is reported in squared units, which makes it hard for humans to interpret directly. Standard deviation is the human-friendly version: a standard deviation of $5 in a dataset of daily expenditures means a typical day deviates from the mean by about $5, full stop. For roughly normally distributed data the standard deviation has a clean probabilistic interpretation via the empirical rule: about 68% of observations fall within one standard deviation of the mean, 95% within two, and 99.7% within three. This is the basis of Z-scores, control charts, Six Sigma quality benchmarks, and most introductory hypothesis testing. For non-normal distributions the empirical rule is only approximate, but Chebyshev's inequality still guarantees at minimum that at least 1 − 1/k² of any distribution's mass lies within k standard deviations of the mean, no matter how weird the shape — at least 75% within 2σ, at least 89% within 3σ.

How to use this calculator.

  1. Paste your dataset into the input box. Either format works: a JSON array like [2, 4, 4, 4, 5, 5, 7, 9] or a plain comma-separated list like 2, 4, 4, 4, 5, 5, 7, 9. Whitespace and line breaks between values are ignored. You need at least two values for the sample standard deviation; a single value has zero deviation by definition.
  2. Decide which standard deviation you need before reading the result. If your data is the entire population of interest (every employee on a payroll, every game in a season, every unit from a production run that has ended), use the population standard deviation σ. If your data is a sample drawn from a larger population about which you want to make inferences, use the sample standard deviation s — this is the more common case in practice and the value that feeds into confidence intervals and hypothesis tests.
  3. Verify the parsed count (n) in the results panel matches the number of values you intended to enter. A mismatch usually means a stray character — a letter, an unmatched bracket, two commas in a row — confused the parser and at least one value was dropped or merged.
  4. Read the mean alongside the standard deviation. The two together describe the location and the spread of the data. A useful sanity check: about two-thirds of values should fall between (mean − s) and (mean + s) for roughly normal data, and almost all (≈95%) within (mean − 2s) and (mean + 2s).
  5. Use the variance (the square of the standard deviation) when you are combining independent random variables — variances add, standard deviations do not. For example, the variance of a sum of two independent random returns is the sum of the individual variances, but the standard deviation of the sum is the square root of that — about 41% larger than either individual standard deviation, not twice as large.
  6. For inferential statistics (confidence intervals, t-tests, z-scores) feed the sample standard deviation into the relevant formula: a 95% confidence interval for the mean is approximately x̄ ± 1.96·s/√n for large n, or x̄ ± t·s/√n with a t-multiplier from a t-table for small n. A z-score for a single value x is (x − x̄)/s.

The formula.

σ = √[ Σ(xᵢ − x̄)² ⁄ n ]

Both standard deviations share the same skeleton: compute the mean, compute the squared deviation of each value from the mean, sum those squared deviations, divide by a divisor that depends on which formula you want, then take the square root. The mean is x̄ = (1/n)·Σᵢ₌₁ⁿ xᵢ. The squared deviation of value xᵢ from the mean is (xᵢ − x̄)². The sum of squared deviations, often abbreviated SS, is Σᵢ₌₁ⁿ (xᵢ − x̄)². The population variance is σ² = SS / n, and the population standard deviation is σ = √(SS/n). The sample variance is s² = SS / (n−1), and the sample standard deviation is s = √(SS/(n−1)). The only difference is the divisor — n for the population formula, n−1 for the sample formula — but that single change has a real effect for small samples. For n = 2 the sample formula divides by 1 instead of 2, doubling the variance; for n = 10 it divides by 9 instead of 10, an 11% inflation; by n = 100 the gap is 1% and shrinking; by n = 1,000 it is 0.1%. The n−1 divisor is known as Bessel's correction, after Friedrich Bessel's 1838 paper on the topic, and it exists because the sample mean x̄ is itself an estimate computed from the data. Once x̄ is fixed, the deviations (xᵢ − x̄) must sum to zero by construction, so they have only n−1 degrees of freedom; dividing by n−1 corrects the systematic underestimate this causes. Internally the calculator parses your input as JSON first, falls back to splitting on commas if JSON parsing fails, coerces every token to a number, and rejects any input containing a non-numeric token (so a typo like "5.0o" raises an error instead of being silently dropped). The mean is computed in one linear pass; the sum of squared deviations is computed in a second linear pass. This two-pass algorithm is numerically more stable than the algebraically equivalent single-pass "computational" formula Σx² − n·x̄² when the values are large or close together, so the calculator uses two passes deliberately. Empty datasets and datasets of a single value are rejected for the sample standard deviation (division by zero), but a single value still has a well-defined population standard deviation of zero.

A worked example.

Example

The canonical textbook dataset chosen specifically because the answer comes out clean. The eight values sum to 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40, so the mean is 40 / 8 = 5.0. Now compute the squared deviation of each value from 5: (2−5)² = 9, (4−5)² = 1 three times, (5−5)² = 0 twice, (7−5)² = 4, (9−5)² = 16. The sum of squared deviations is 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32. The population variance is 32 / 8 = 4, so the population standard deviation σ = √4 = 2.0 exactly. The sample variance uses n−1 = 7 in the denominator: 32 / 7 ≈ 4.571, so the sample standard deviation s ≈ √4.571 ≈ 2.138. Notice the gap: for n = 8 the sample formula inflates the variance by a factor of 8/7 ≈ 1.143 and the standard deviation by √(8/7) ≈ 1.069 — about 7% larger. That gap is exactly what Bessel's correction does, and it shrinks toward zero as n grows. For real-world interpretation, imagine these eight values are the daily late-arrival minutes of one employee for a single week (treating the week as the entire population) — a population standard deviation of 2 minutes around a mean of 5 means most days are within 3 to 7 minutes late, with the 9-minute day being the worst outlier at exactly 2σ above the mean. Apply the empirical rule: if these arrival times were normally distributed (they're too few to tell here, but bear with the example), about 68% of days should fall between 3 and 7 minutes late, 95% between 1 and 9 minutes, and 99.7% between −1 and 11 minutes.

values Json[2, 4, 4, 4, 5, 5, 7, 9]

Frequently asked questions.

What is the difference between population and sample standard deviation?
They use the same formula except for the divisor. The population standard deviation σ divides the sum of squared deviations from the mean by n, the total number of observations. The sample standard deviation s divides by n−1 instead — an adjustment known as Bessel's correction. Use σ when your dataset includes every member of the population you care about (every employee on a payroll, every game in a season, every product from a finished production run). Use s when your dataset is a sample drawn from a larger population about which you want to make inferences (500 voters out of a country, 30 light bulbs out of a production run of 100,000). The n−1 divisor exists because the sample mean is itself estimated from the data, so dividing by n would systematically underestimate the true population variance. The correction is large for small samples (n = 2 makes the sample standard deviation roughly 1.41× the population value), shrinks to a percent or two by n = 100, and is negligible by n = 1,000.
What is Bessel's correction and why is the divisor n−1?
Bessel's correction is the use of n−1 (instead of n) as the divisor in the sample variance formula, named after Friedrich Bessel's 1838 paper. The technical reason: the sample mean x̄ is computed from the data, so the deviations (xᵢ − x̄) are by construction smaller, on average, than the deviations (xᵢ − μ) from the unknown true population mean μ would be. Dividing the sum of squared deviations by n therefore systematically underestimates σ². Dividing by n−1 exactly compensates and makes s² an unbiased estimator of σ². The intuition in plain English: once you have computed the mean from n values, only n−1 of the deviations are free to vary — the last one is determined by the constraint that all the deviations sum to zero. We say the sample mean "uses up one degree of freedom," and the divisor reflects the degrees of freedom that remain. The same logic generalises: if you have estimated k parameters from the data before computing the variance, the divisor is n−k. For a simple sample variance, k = 1 (the mean), so the divisor is n−1.
What is the 68-95-99.7 rule?
The 68–95–99.7 rule — also called the empirical rule or the three-sigma rule — says that for a roughly normally distributed dataset, about 68% of values fall within one standard deviation of the mean, about 95% fall within two standard deviations, and about 99.7% fall within three. More precisely the proportions are 68.27%, 95.45%, and 99.73%. It is the single most useful rule of thumb in introductory statistics. If a class of test scores has a mean of 70 and a standard deviation of 10, roughly two-thirds of the class scored between 60 and 80, almost all (95%) scored between 50 and 90, and almost everyone (99.7%) scored between 40 and 100. A student who scored 90 is at +2σ — in the top 2.5%. A score of 100 is at +3σ — in the top 0.15%. For non-normal distributions the empirical rule is only approximate, but Chebyshev's inequality still guarantees at least 1 − 1/k² of any distribution within k standard deviations of the mean (≥75% within 2σ, ≥89% within 3σ) regardless of shape.
What is the difference between variance and standard deviation?
Variance is the average squared deviation from the mean; standard deviation is the square root of the variance. They are essentially the same quantity in two different units. Variance has nicer mathematical properties — most importantly, variance is additive for independent random variables (Var(X + Y) = Var(X) + Var(Y) when X and Y are independent), which is why it appears in almost every theoretical formula in statistics. But variance is reported in squared units (dollars², kilograms², minutes²) which makes it hard to interpret directly. Standard deviation is the human-friendly version: it is in the same units as the original data, so a standard deviation of $5 in a daily expenditure dataset means a typical day deviates from the mean by about $5. The practical rule is: use variance inside formulas where additivity matters (portfolio risk, propagation of uncertainty, sum of independent errors); report standard deviation in dashboards, headlines, and conversations with non-statisticians.
How do I compute a z-score from the standard deviation?
A z-score measures how many standard deviations a value sits away from the mean. The formula is z = (x − mean) / standard deviation. A z-score of +2 means the value is two standard deviations above the mean; a z-score of −1.5 means it is one and a half standard deviations below. Z-scores are directly comparable across datasets with completely different units, which is why they are the standard way to express "how unusual is this observation?" in psychometrics, standardised testing, six-sigma quality control, and effect-size reporting in medicine. For roughly normal data, z-scores map to percentiles via the standard normal distribution: z = 0 is the 50th percentile (the mean), z = +1 is roughly the 84th percentile, z = +2 is roughly the 97.7th percentile, and z = +3 is roughly the 99.87th percentile. SAT and IQ tests are explicitly designed so that their scores are linear transformations of z-scores: an IQ of 130 is z = +2, an SAT section score of 700 is roughly z = +2.
Why is standard deviation a better measure of spread than the range?
The range is the maximum value minus the minimum value — the simplest possible measure of spread, but it depends on only two of the data points and ignores everything in between. A single mistyped value can multiply the range by ten while leaving the bulk of the data unchanged. Standard deviation uses every observation: each value contributes to the sum of squared deviations in proportion to how far it sits from the mean. That makes the standard deviation more stable, more informative, and the only measure of spread that feeds cleanly into inferential statistics — confidence intervals, t-tests, z-scores, ANOVA, regression standard errors all start from the standard deviation, not the range. The range still has its place as a quick sanity check ("is the spread roughly what I expect?") and it is the natural measure of spread for the very smallest datasets where computing a standard deviation is overkill, but for any analysis beyond a casual glance, standard deviation (and its cousin the interquartile range, which is robust to outliers) is the right tool.
How is standard deviation used in finance and investing?
In finance, standard deviation of returns is the standard quantitative definition of risk or volatility. If a stock has an annualised mean return of 10% and an annualised standard deviation of 20%, the empirical rule says that in a typical year the return will fall between −10% and +30% (within one σ) about two-thirds of the time, and between −30% and +50% (within two σ) about 95% of the time. A high standard deviation means the asset's returns are unpredictable; a low standard deviation means they cluster tightly around the mean. The Sharpe ratio — the most widely quoted risk-adjusted performance metric in investing — is defined as (return − risk-free rate) / standard deviation, so the entire denominator is the standard deviation of returns. Portfolio theory builds directly on the variance of a sum of correlated returns. Bond yield volatility, currency volatility, options pricing (the σ in the Black–Scholes formula is literally the standard deviation of log returns) — every quantitative tool in finance has standard deviation baked in somewhere. The financial press calls a one-day move of three or more standard deviations a "three-sigma event," and tracks them closely because they are statistically supposed to happen on roughly 0.3% of trading days — about once every 18 months — and any clustering suggests the normal-distribution assumption has broken down.
How is standard deviation used in manufacturing and quality control?
In manufacturing, standard deviation drives the entire field of statistical process control. A production line measures some critical dimension — the diameter of a bolt, the weight of a packet of crisps, the thickness of a coating — and computes the mean and standard deviation of recent measurements. Control charts plot each new measurement against the mean plus or minus three standard deviations; any point outside that band triggers an investigation because the empirical rule says it should happen only 0.3% of the time by chance alone. Six Sigma, the quality programme made famous by Motorola and General Electric in the 1980s and 1990s, sets a far more demanding goal: the distance from the process mean to the nearest specification limit should be at least six standard deviations, which (with a 1.5σ allowance for long-term drift) translates to roughly 3.4 defects per million opportunities. Manufacturing tolerances are typically expressed as ±k·σ for some integer k, and process capability indices like Cp and Cpk are explicit ratios involving the process standard deviation.
What does it mean if the standard deviation is zero?
A standard deviation of exactly zero means every value in the dataset is identical — there is no variability at all. Every observation equals the mean, every squared deviation is zero, the sum of squared deviations is zero, the variance is zero, and the standard deviation is zero. This is exceedingly rare for real measured data because real measurements always have some noise, but it does occur for constants, for categorical variables coded as a single label, or for tightly bucketed counts ("all 100 patients received exactly 200 mg of the drug"). A near-zero standard deviation in a context where you expected variability is a strong signal that something is wrong with the data — measurements were truncated or rounded too aggressively, the wrong column was pulled, or a system is reporting a default value rather than a real measurement. Worth investigating before relying on any downstream analysis.
Why do my Excel STDEV and STDEVP functions give different answers?
They are the two flavours of standard deviation discussed throughout this page. STDEV (or its newer name STDEV.S) computes the sample standard deviation, using n−1 as the divisor. STDEVP (or its newer name STDEV.P) computes the population standard deviation, using n. For the same dataset STDEV will always return a slightly larger number than STDEVP, with the gap shrinking as the sample size grows. The same pair exists in Google Sheets (STDEV vs STDEVP), in Python's NumPy (np.std defaults to population with ddof=0; pass ddof=1 to get the sample version), in R (the built-in sd() function uses n−1 sample by default), and in essentially every statistics package ever written. The convention varies — pocket calculators usually label them σₙ and σₙ₋₁, or sometimes σ and s — but the underlying choice is always the same: divide by n if you have the whole population, divide by n−1 if you have a sample and want to infer the population.

References& sources.

  1. [1]NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.2 — Confidence Limits for the Mean. Authoritative U.S. National Institute of Standards and Technology reference for sample mean, sample standard deviation, and the n−1 divisor used in inferential statistics.
  2. [2]Casella, George and Berger, Roger L. Statistical Inference, 2nd edition. Duxbury / Cengage, 2002 — the standard graduate-level reference. Theorem 5.2.4 proves that s² with the n−1 divisor is the unbiased estimator of σ².
  3. [3]Bessel, Friedrich Wilhelm. "Untersuchungen über die Wahrscheinlichkeit der Beobachtungsfehler." Astronomische Nachrichten 15, 1838, pp. 369–404 — the original 1838 derivation of the n−1 correction, now universally known as Bessel's correction.
  4. [4]OpenStax. Introductory Statistics. Rice University, 2022 — peer-reviewed open-access textbook. Chapter 2.7 covers variance and standard deviation; Chapter 6 covers the empirical (68–95–99.7) rule and z-scores.
  5. [5]Khan Academy. "Sample standard deviation." Statistics and probability — high-quality free explainer aligned to the same definitions used by NIST and OpenStax, useful as a student-facing companion.
  6. [6]NIST/SEMATECH e-Handbook of Statistical Methods, §6.3 — Univariate and Multivariate Control Charts. Reference for the use of process mean ± 3σ control limits in statistical process control and Six Sigma quality programmes.
  7. [7]Wasserman, Larry. All of Statistics: A Concise Course in Statistical Inference. Springer, 2004 — peer-reviewed graduate text. Chapter 6.3 covers variance and standard deviation, Chebyshev's inequality, and the unbiasedness of the sample variance under Bessel's correction.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon