Standard Deviation Calculator

Paste a dataset — get the mean, variance, standard deviation, a frequency table and confidence intervals with error-bar visuals.

Data represents

What does standard deviation measure?

Standard deviation is a single number that summarises how spread out a dataset is around its mean. A small standard deviation means the values huddle tightly around the average; a large one means they're scattered. It has the same units as your data — a standard deviation of 3 cm on a set of heights is 3 cm, not "3 units squared".

Two datasets can share the same mean and look completely different: A = [48, 49, 50, 51, 52] has mean 50 with σ ≈ 1.41, while B = [10, 30, 50, 70, 90] has the same mean 50 but σ ≈ 28.28. The mean tells you where the center is; the standard deviation tells you how far a typical value sits from that center.

Standard deviation explained, step by step

Each step below has a plain-English definition, its formula (with every symbol spelled out), a small diagram, and a worked example — all in one card, so you can follow the whole pipeline from raw data → mean → variance → standard deviation → confidence interval without jumping between sections.

1. Deviations from the mean

First compute the mean, then measure how far each value sits from it: dᵢ = xᵢ − μ. Points below the mean give negative deviations, points above give positive ones. Signed deviations always sum to zero — which is exactly why we can't average them raw.

dᵢ = xᵢ − μ,   μ
= (1/N) · Σ xᵢ
μpopulation mean (x̄ for a sample)·Nnumber of values·xᵢeach value in the dataset
μ = 18.0
Example
Given
10, 12, 16, 16, 21, 23, 23, 23 → μ = 18
Substitute
deviations: −8, −6, −2, −2, 3, 5, 5, 5
Answer
Σd = 0

2. Square each deviation

To get rid of the sign problem, square every deviation. Now every term is positive, and points further from the mean contribute much more than nearby ones — that's what makes SD sensitive to outliers.

Σ(xᵢ − μ)²
(xᵢ − μ)²squared deviation for value xᵢ
d = 1d² = 1d = 2d² = 4d = 3d² = 9squaring turns each deviation into an area
Example
Given
deviations: −8, −6, −2, −2, 3, 5, 5, 5
Substitute
64 + 36 + 4 + 4 + 9 + 25 + 25 + 25
Answer
Σ(xᵢ − μ)² = 192

3. Divide → variance (population vs sample)

Variance is the average squared deviation. Divide by N for a whole population; divide by N − 1 for a sample (Bessel's correction), because the sample mean sits a hair too close to its own data.

σ² = Σ(xᵢ − μ)² / N  ·  s²
= Σ(xᵢ − x̄)² / (N − 1)
σ²population variance·sample variance (unbiased)
Population÷ NσSample÷ (N − 1)s (Bessel)smaller denominator ⇒ slightly larger estimate
Example
Given
Σ(xᵢ − μ)² = 192
N = 8
Substitute
σ² = 192 / 8
= 24 · s²
= 192 / 7 ≈ 27.43
Answer
σ² = 24 (population)

4. Take the square root → standard deviation

Variance is in squared units (cm², $²…). Take a square root to bring it back to the original units — that's the standard deviation. A value of σ = 5 cm on heights literally means about 5 cm spread from average.

σ = √(σ²)  ·  s
= √(s²)
σpopulation standard deviation·ssample standard deviation
d = 1d² = 1d = 2d² = 4d = 3d² = 9squaring turns each deviation into an area
Example
Given
σ² = 24
Substitute
σ = √24
Answer
σ ≈ 4.90

5. Standard error of the mean (SEM)

SD describes how spread the individual values are. SEM describes how much the sample mean itself bounces from sample to sample. It shrinks with the square root of N — quadruple your sample and SEM halves.

SEM = σ / √N
SEMstandard error of the mean·Nsample size
N = 25SEM ≈ 1N = 100SEM ≈ 0.5N = 400SEM ≈ 0.25SEM = σ / √N
Example
Given
σ ≈ 4.90
N = 8
Substitute
SEM = 4.90 / √8
Answer
SEM ≈ 1.73

6. Margin of error and confidence intervals

Multiply SEM by a z-score to get the half-width of a confidence interval around the mean. Higher confidence needs a bigger z, so the interval widens: 95% uses z ≈ 1.96, 99% uses z ≈ 2.58.

CI = mean ± z · (σ / √N)
zz-multiplier for the chosen confidence level·z · SEMmargin of error (half-width)
68%95%99%margin of error = z × SEM
Example
Given
mean = 18
SEM ≈ 1.73, 95% ⇒ z = 1.96
Substitute
18 ± 1.96 × 1.73
Answer
≈ [14.61, 21.39]

Common z-multipliers

Confidence levelzRoughly means
68.3%1.000±1 standard error
90%1.645commonly used, tighter interval
95%1.960the default in most research
99%2.576stricter, wider interval
99.9%3.291very high confidence

Common mistakes

  • Using the population formula on a random sample — under-estimates the true spread. Prefer N − 1 when in doubt.
  • Reporting variance and calling it standard deviation. Variance is in squared units (e.g. cm²) — always take the square root for a meaningful "spread" figure.
  • Comparing standard deviations across variables in different units. Use the coefficient of variation (s / mean) for a fair comparison.
  • Treating a confidence interval as "95% probability the true mean is in this range for this specific sample". It's a statement about the procedure, not a probability about this one interval.

Features of this calculator

  • Accepts comma, space, semicolon, tab or newline separated data — paste directly from a spreadsheet.
  • Toggle between population (N) and sample (N − 1) formulas — the result updates the correct denominator and symbol.
  • Frequency table with counts and percentages so repeated values are easy to spot.
  • Confidence-interval table at 68.3%, 90%, 95%, 99% and 99.9% with proportional error-bar visuals that grow as confidence increases.
  • Full step-by-step working: mean → each (xᵢ − mean)² → sum → variance → square root.

Frequently asked questions

+Can standard deviation be negative?

No. It's the square root of a sum of squares, so it's always ≥ 0. A standard deviation of exactly 0 means every value in the dataset is identical.

+Why do the 68%, 95%, 99.7% rules exist?

For any dataset that's roughly bell-shaped (normally distributed), about 68% of values fall within ±1σ of the mean, about 95% within ±2σ and about 99.7% within ±3σ.

+How does sample size affect the margin of error?

Margin of error scales with 1/√N, so quadrupling the sample size cuts the margin roughly in half.

Related calculators