Skip to main content

Statistics Calculator — Mean, Median, Mode, Standard Deviation

Calculate all key statistics from any dataset: mean, median, mode, standard deviation, variance, range, quartiles, and IQR. Enter comma-separated numbers.

Count (n)

10

Sum

61.0000

Mean

6.1000

Median

7.0000

Mode

7

Std dev, sample (s)

3.6347

Variance, sample (s²)

13.2111

Std dev, population (σ)

3.4482

Variance, population (σ²)

11.8900

Range

12

Min

1

Max

13

Q1 (25th)

3

Q3 (75th)

8

IQR

5

What is Descriptive Statistics?

Descriptive statistics answer two questions about a set of numbers: where is the middle, and how spread out is it. Everything else — mean, median, standard deviation, quartiles — is a different way of answering one of those two.

The reason there are several measures of each is that "middle" and "spread" are genuinely ambiguous. A single extreme value can drag the mean somewhere no actual data point sits, while leaving the median untouched. Neither is wrong; they are answering slightly different questions, and knowing which one your data calls for is most of statistical literacy.

The one genuine trap in this page is the difference between population and sample statistics, because it changes the arithmetic and almost nobody is told why. That is derived below rather than asserted.

The formula — how to calculate Descriptive Statistics

Mean: x̄ = Σx ÷ n Variance (sample): s² = Σ(x − x̄)² ÷ (n − 1) Variance (population): σ² = Σ(x − μ)² ÷ n Standard deviation: the square root of the variance
Σ
= sigma — "add up all of these"
x̄ (x-bar)
= the sample mean; μ (mu) denotes a population mean
n
= how many values you have
n − 1
= Bessel's correction, explained below — it is not arbitrary

Variance is in squared units, which is why standard deviation exists: taking the square root returns the spread to the same units as the original data, making it interpretable.

Step-by-step example

  1. 01Dataset: 2, 4, 6, 8.
  2. 02Mean: (2 + 4 + 6 + 8) ÷ 4 = 20 ÷ 4 = 5.
  3. 03Deviations from the mean: −3, −1, +1, +3. Notice they sum to zero — always. That is why we square them; otherwise the spread would cancel itself out.
  4. 04Squared deviations: 9, 1, 1, 9. Sum = 20.
  5. 05Sample variance: 20 ÷ (4 − 1) = 6.667. Sample standard deviation: √6.667 ≈ 2.582.
  6. 06Population variance: 20 ÷ 4 = 5. Population standard deviation: √5 ≈ 2.236.
  7. 07The sample figure is larger, and deliberately so — the reasoning is derived in the next section.
  8. 08Median: with an even count, average the two middle values of the sorted set: (4 + 6) ÷ 2 = 5. Here it matches the mean because the data is symmetric.

Why sample variance divides by n − 1

This is the step textbooks state and rarely justify, so here is the reasoning from the ground up.

Variance measures how far values sit from the true mean. When you have the entire population, you know the true mean, and dividing the summed squared deviations by n is exactly right.

With a sample, you do not know the true mean — you estimate it from the same data you are measuring the spread of. And the sample mean is, by construction, the value that makes the sum of squared deviations as small as it can possibly be. Any other number, including the true population mean, would produce a larger sum.

So measuring spread around your own sample mean systematically understates the real spread. Dividing by n − 1 rather than n inflates the result by exactly enough to correct that bias on average. This is Bessel's correction.

The intuition for why it is n − 1 specifically: once you know the mean and any n − 1 of the values, the final value is fixed — it carries no independent information. You have n − 1 degrees of freedom, not n.

The practical consequence is that the correction matters enormously for small samples and barely at all for large ones. At n = 4 it changes variance by 33%; at n = 1,000, by 0.1%.

Which one should you use?

If your numbers are the complete set you care about — every exam in one class, every transaction last month — use the population figure. If they are a sample you intend to generalise from, use the sample figure. When in doubt, use the sample version: it is the conservative choice and the default in nearly all statistical software.

Mean, median, mode — and when each lies

The mean uses every value, which is its strength and its weakness. It is efficient and mathematically tractable, and a single extreme value can drag it somewhere no observation actually sits.

The classic demonstration: incomes of £25k, £28k, £30k, £32k and £1.5m have a mean of about £323k. That figure describes nobody in the room. The median of £30k describes the group honestly. This is precisely why income and house price statistics are almost always reported as medians.

The mode — the most frequent value — is the only measure that works on categorical data, where "average colour" is meaningless but "most common colour" is not. It can also be absent or multiple, which the other two never are.

A useful diagnostic: when mean and median diverge substantially, the distribution is skewed, and the direction tells you which way. Mean above median means a long right tail, usually a few large values.

Choosing a measure of centre

MeasureUse whenWeakness
MeanData is roughly symmetric with no extreme outliersDragged by outliers
MedianData is skewed or contains outliersIgnores the magnitude of values
ModeData is categorical, or you want the most typical caseMay not exist or may not be unique

Reading spread: standard deviation and the IQR

Standard deviation expresses typical distance from the mean in the original units. For roughly bell-shaped data it carries a useful rule of thumb: about 68% of values fall within one standard deviation of the mean, about 95% within two, and about 99.7% within three.

That rule only holds for approximately normal distributions. Applied to skewed data — incomes, waiting times, city populations — it will mislead, and the mean it is built around is already unreliable there.

The interquartile range takes a different approach: sort the data, find the value a quarter of the way through (Q1) and three quarters through (Q3), and take the difference. That range holds the middle half of the data and is completely unaffected by how extreme the extremes are.

This robustness is why box plots use quartiles rather than standard deviations, and why the IQR is the better spread measure whenever you have chosen the median as your measure of centre. The two pair naturally: mean with standard deviation, median with IQR.

What descriptive statistics cannot tell you

Summary numbers discard information, and occasionally the discarded part is the whole story. Anscombe's quartet is the standard demonstration: four datasets with near-identical means, variances and correlations that look completely different when plotted — one linear, one curved, one with a single dominant outlier.

The practical lesson is to plot the data before trusting a summary of it. A histogram takes seconds and reveals skew, bimodality and outliers that no combination of summary statistics will surface.

These measures also say nothing about cause. Two variables can move together for reasons that have nothing to do with either affecting the other, and no amount of descriptive statistics distinguishes those cases.

Key considerations

  • Use sample statistics (n − 1) unless your data is genuinely the entire population.
  • Report the median rather than the mean for skewed data such as income or house prices.
  • Pair mean with standard deviation, and median with interquartile range.
  • A large gap between mean and median signals skew and tells you its direction.
  • The 68-95-99.7 rule applies only to approximately normal data.
  • Plot a histogram before trusting any summary — different data can share identical statistics.
  • Watch input formatting: a stray trailing separator can silently add a zero to your dataset.

Common mistakes to avoid

  • Using population variance on sample data, which understates the true spread.
  • Reporting a mean for heavily skewed data, producing a figure that describes nobody.
  • Applying the 68-95-99.7 rule to non-normal distributions.
  • Discarding outliers because they are inconvenient rather than because they are errors.
  • Comparing standard deviations between datasets with very different means — use the coefficient of variation instead.
  • Treating a correlation between two variables as evidence that one causes the other.

Frequently asked questions

Sources & references

Written and fact-checked by the CalcProLabs Editorial Team. Read our calculation methodology and editorial policy.

Last updated