Statistics Calculator

Calculate mean, median, mode, range, variance and standard deviation from a list of numbers, with the sample and population distinction handled explicitly.

Why sample variance divides by n − 1

The usual explanation is a wave of the hand: you “lose a degree of freedom” to the mean, so divide by one less. True, and unsatisfying, because it makes the correction sound like a nudge somebody decided was about right. It is not approximately right. Dividing by n understates the variance by exactly the factor (n − 1)/n.

Drawing 400,000 samples from a population whose variance is known to be exactly 1:

Sample sizeDivide by nDivide by n − 1How low ÷n runs
2 0.5006 1.0012 50.0%
3 0.6657 0.9985 33.3%
5 0.7994 0.9992 20.0%
10 0.8994 0.9993 10.0%
30 0.9672 1.0006 3.3%
100 0.9902 1.0002 1.0%

The third column lands on 1 at every sample size. The second lands on (n − 1)/n at every sample size. That is not a correction that happens to help — it is the exact size of the error, which is why it is the right thing to divide by rather than merely a safer one.

The reason is that the sample mean is pulled towards whatever the sample happened to contain. Deviations get measured from a centre sitting among them, so they come out too small — and by a knowable amount, because the mean absorbs exactly one of the n independent pieces of information the sample carried.

Practically this is a small-sample problem. At n = 100 the difference is 1% and nobody will notice. At n = 3 the wrong divisor loses a third of the variance, and at n = 2 it loses half. If you are working with a handful of measurements, it is the difference between an answer and a wrong answer.

How to use

  1. Paste or type your numbers, separated however you like.
  2. Choose sample or population.
  3. Read the full set of statistics.
  4. Check the median against the mean if the data may be skewed.

Frequently asked questions

What is the difference between sample and population variance?

The divisor. Population variance divides by the number of values; sample variance divides by one fewer. The correction exists because a sample's own mean sits closer to its data than the true population mean does, so dividing by the count would systematically underestimate the spread.

Which one should I use?

Sample, almost always. Unless your numbers are the entire group you care about — every employee in a company, every item in a finished batch — you have a sample drawn from something larger, and the sample formula is the correct one. Statistical software defaults to it for this reason.

When is the median better than the mean?

Whenever the data is skewed or has outliers. Incomes are the standard example: a handful of very high earners pull the mean well above what a typical person earns, while the median stays representative. If the mean and median differ substantially, that gap is itself telling you something.

What does standard deviation actually tell me?

The typical distance of a value from the mean, in the same units as the data. For roughly bell-shaped distributions, about two thirds of values fall within one standard deviation of the mean and about 95 per cent within two — a rule that fails badly for data that is not bell-shaped.

Can data have more than one mode?

Yes. Two values tied for the most frequent make the data bimodal, and more than that multimodal. Genuine bimodality often means two different groups have been mixed together, which is usually more interesting than the mode itself.

Why is the range a weak measure of spread?

Because it depends entirely on the two most extreme values and ignores everything between them. A single outlier can multiply it. The interquartile range, covering the middle half of the data, is far more stable and is what a box plot displays.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.