📊 Standard Deviation & Variance Calculator

A standard deviation calculator for sample and population, with the full working, relative standard deviation, and how much n−1 changes the answer.

Free No Signup Required Browser-Based
Sample Standard Deviation (s)
5.2372
Mean (μ): 18.0000 (Based on 8 data values)
Population SD (σ)
4.8990
Sample Variance (s²)
27.4286
Population Variance (σ²)
24.0000
Median & Range
18.50 (Range: 13)
Relative SD (CV)
29.10%

Dividing by n−1 rather than n raises the answer by 6.90% at this sample size. The correction shrinks fast as data accumulates — it is about 22% at n=3, 5% at n=10 and under 0.1% at n=1,000. Use the sample figure unless your data really is the entire population.

Step by step

Value (x)x − mean(x − mean)²
10-8.000064.0000
12-6.000036.0000
235.000025.0000
235.000025.0000
16-2.00004.0000
235.000025.0000
213.00009.0000
16-2.00004.0000
Sum of squared deviations192.0000

Then divide that sum by 8 for the population variance, or by 7 for the sample variance, and take the square root of whichever you need.

What Standard Deviation & Variance Calculator Does

Standard deviation answers one question: how far, typically, do the values sit from their own average? A small figure means the data huddles near the mean, a large one means it is spread out. The arithmetic is short — find the mean, measure each distance from it, square those distances, average them, take the square root — and every calculator on the first page of results does it identically.

The one real decision is whether to divide by n or by n−1, and it is the step people get wrong most often. Divide by n when your numbers are the entire group you care about. Divide by n−1 when they are a sample standing in for something larger, which is almost always the case.

The reason is subtle but worth understanding. A sample sits closer to its own mean than to the true mean of the population it came from, because the sample mean is calculated from those very numbers. Squared deviations measured against the sample mean therefore come out slightly too small, and dividing by n−1 instead of n compensates. That is Bessel's correction.

How much it matters depends entirely on how much data you have: it raises the answer by about 22% at n=3, roughly 5% at n=10, and under a tenth of a percent at n=1,000. With plenty of data the choice is almost irrelevant. With very little, it is the difference between an honest estimate and an optimistic one.

How to Use Standard Deviation & Variance Calculator

  1. Paste or type your numbers, separated by commas, spaces or line breaks
  2. Read the sample figure (s) if these numbers are a sample, or the population figure (σ) if they are the whole group
  3. Check the step-by-step table to see each deviation and its square
  4. Use the relative standard deviation to compare spread against datasets on a different scale

Formula Used by Standard Deviation & Variance Calculator

Sample standard deviation (use this by default)

s = √[ Σ(xᵢ − x̄)² ÷ (n − 1) ]

xᵢ
Each individual value in the data
The mean — the sum of all values divided by how many there are
n
How many values you have
n − 1
Bessel's correction, which removes the downward bias in a sample

Worked example

The dataset 5, 9, 8, 12, 6, 10, 6, 8

  1. Sum = 64, and 64 ÷ 8 = 8, so the mean is exactly 8
  2. Deviations: −3, 1, 0, 4, −2, 2, −2, 0
  3. Squared: 9, 1, 0, 16, 4, 4, 4, 0 — summing to 38
  4. Sample variance: 38 ÷ 7 = 5.4286
  5. √5.4286

Result: s = 2.3299

Population standard deviation

σ = √[ Σ(xᵢ − μ)² ÷ N ]

μ
The population mean
N
The size of the entire population — every member, not a sample

Worked example

The same eight numbers, treated as a complete population

  1. Population variance: 38 ÷ 8 = 4.75
  2. √4.75

Result: σ = 2.1794 — about 6.9% lower than the sample figure from identical data

Relative standard deviation (coefficient of variation)

RSD = (s ÷ |x̄|) × 100%

RSD
Standard deviation expressed as a percentage of the mean — unitless, so comparable across datasets

Worked example

Three datasets with very different scales

  1. Mean 100, s = 5 → 5%
  2. Mean 1,000, s = 50 → 5%
  3. Mean 2.5, s = 0.125 → 5%

Result: All three have identical relative spread despite standard deviations ranging from 0.125 to 50

How much Bessel's correction changes the answer

The ratio between the sample and population standard deviation is √(n ÷ (n−1)). It depends only on how many values you have, never on the values themselves.

Sample size nSample SD ÷ population SDSample figure is higher by
31.224722.47%
51.118011.80%
101.05415.41%
201.02602.60%
301.01711.71%
501.01021.02%
1001.00500.50%
1,0001.00050.05%

Worked example — 5, 9, 8, 12, 6, 10, 6, 8

A dataset small enough to check by hand. The mean lands on exactly 8, which keeps every step clean.

ValueDeviation from meanSquared deviation
5−39
9+11
800
12+416
6−24
10+24
6−24
800
Sum = 64, mean = 8Sum of squares = 38

Standard deviation for grouped data

When data arrives as a frequency table, use class midpoints weighted by frequency: mean = Σ(f·x) ÷ Σf, and the squared deviations become Σf(x − mean)².

Midpoint xFrequency ff × xf(x − mean)²
10330816.75
205100211.25
30824098.00
404160729.00
Totals205301,855.00
Mean = 530 ÷ 20 = 26.5σ = 9.6307s = 9.8809

How to Read Your Result

"Is my standard deviation good?" is not answerable as asked

A standard deviation of 5 is negligible on measurements averaging 1,000 and enormous on measurements averaging 6. The number carries the units of your data, so it means nothing detached from the scale. Relative standard deviation fixes this by expressing spread as a percentage of the mean: three datasets with standard deviations of 0.125, 5 and 50 can all be equally variable at 5% relative spread. That is the figure to quote when comparing across datasets.

Why the deviations get squared

Deviations from the mean always sum to exactly zero — that is what the mean is. Averaging them directly would give zero for every dataset ever collected. Squaring removes the signs so they stop canceling, at the cost of leaving the result in squared units. Taking the square root at the end converts it back. Squaring also weights large deviations more heavily than small ones, which is why standard deviation is sensitive to outliers in a way that a simple average distance would not be.

What it does not tell you

Standard deviation is a single summary, and very different distributions can share one. The familiar rules of thumb — about 68% of values within one standard deviation, 95% within two — hold only for roughly normal data. For skewed data, or data with two peaks, or data with an extreme outlier, those percentages can be badly wrong. Plot the numbers before trusting any single summary statistic of them.

Outliers move it a long way

Because deviations are squared, a single distant value has an outsized effect. Adding one point far from the mean can inflate the standard deviation dramatically while the median barely shifts. If your data contains genuine outliers and you want a measure of typical spread that ignores them, the interquartile range is the more robust choice.

The correction is not a complete fix

The Bessel correction makes the variance an unbiased estimator of the population variance, but it does not quite make the standard deviation unbiased — taking a square root is non-linear, so the bias does not survive the operation intact. There is in fact no single estimator of sample standard deviation that is simultaneously unbiased, efficient and maximum-likelihood, and the residual bias is meaningful below about ten observations. None of that is a reason to use n instead: n−1 moves in the right direction and is universally standard. It is a reason to be sceptical of a standard deviation computed from a handful of numbers, however many decimal places it is printed to.

Limitations & Accuracy Notes

  • Standard deviation assumes the values are measurements on a meaningful numeric scale. It is not appropriate for ordinal categories such as survey ratings from one to five, however commonly it is applied to them.
  • Squaring makes the measure sensitive to outliers. One extreme value can dominate the result, so check whether an unusual figure is genuine data or a recording error before quoting the spread.
  • The 68/95/99.7 rules of thumb apply only to approximately normal distributions. For skewed or multi-modal data they can mislead substantially.
  • Relative standard deviation becomes unstable when the mean approaches zero, and is meaningless for data that can be negative, since dividing by a near-zero or sign-changing mean produces nonsense.
  • A standard deviation computed from a small sample is itself uncertain. With ten values the estimate is rough regardless of how many decimal places any calculator prints.

Frequently Asked Questions

Should I use the sample or the population formula?
Use the sample formula unless your data genuinely is every member of the group you care about. Dividing by n−1 instead of n corrects a bias: a sample tends to sit closer to its own mean than to the true population mean, so the uncorrected figure comes out too small. The correction matters most when data is scarce — it raises the answer by about 22% at n=3, 5% at n=10, and under 0.1% at n=1,000.
What is the standard deviation of 5, 9, 8, 12, 6, 10, 6, 8?
The mean is exactly 8 and the squared deviations sum to 38. Dividing by n=8 gives a population variance of 4.75 and a population standard deviation of 2.1794. Dividing by n−1=7 gives a sample variance of 5.4286 and a sample standard deviation of 2.3299 — about 6.9% higher. Which one is correct depends entirely on whether those eight numbers are your whole population or a sample from a larger one.
What is a good standard deviation?
The question has no answer without knowing the scale. A standard deviation of 5 is tiny on values averaging 1,000 and enormous on values averaging 6. Relative standard deviation — the standard deviation as a percentage of the mean, also called the coefficient of variation — is the scale-free version, and it is what lets you compare spread between datasets measured in different units.
How do I calculate standard deviation for grouped data?
Use the class midpoints weighted by frequency. The mean becomes Σ(f×x)÷Σf, and the sum of squared deviations becomes Σf(x−mean)². For midpoints 10, 20, 30 and 40 with frequencies 3, 5, 8 and 4, the total frequency is 20, the mean is 26.5, and the weighted sum of squared deviations is 1,855 — giving a population standard deviation of 9.6307 and a sample standard deviation of 9.8809.
What is the difference between variance and standard deviation?
Variance is the average of the squared deviations; standard deviation is its square root. Squaring removes the sign so that positive and negative deviations do not cancel, but it also leaves variance in squared units — square centimeters, or dollars squared — which is hard to interpret. Taking the root returns the figure to the original units, which is why standard deviation is the one usually quoted.
Should I divide by n or n − 1?
By n − 1 when your numbers are a sample and you are estimating the spread of a larger population — that is Bessel's correction. By n only when your numbers are the entire population. Getting this wrong is the most common statistics error in coursework, and on small datasets the gap is substantial.
Why does Bessel's correction exist at all?
Because a sample's values cluster around the sample mean rather than the true population mean, which systematically underestimates the real spread. Dividing by the smaller n − 1 corrects that bias. With ten values the two formulas differ by about 5%.
Why are the deviations squared rather than just made positive?
Squaring is differentiable and penalizes large deviations more than small ones, which is what makes the result well behaved in further statistics. Taking absolute values instead gives the mean absolute deviation — a legitimate measure, but one that does not slot into the rest of the toolkit.
Is a high standard deviation bad?
Neither good nor bad on its own — it describes spread. High spread in manufacturing tolerances is a problem; high spread in a set of exam results may simply mean the test discriminated well. Interpretation depends entirely on context.
How does an outlier affect it?
Strongly, because deviations are squared before averaging, so a distant value contributes disproportionately. If one point is dominating your result, that is worth investigating rather than accepting — median and interquartile range are more robust alternatives.
Is my data stored?
No. The calculation runs in your browser.

References & Further Reading

By OnlineToolHubs Team • September 2026