Home / Statistics

Mean, Mode and Median

Three different answers to “what is a typical value?” — and they disagree more often than you would think. Add one billionaire to the room and watch only one of them survive.

Controls


Click the chart to add a value there. Each bar is a count of data points.

Distribution with All Three Averages

click to add a value

Live Calculation

mean
0
median
0
mode
0
n
0

Mean, Mode and Median

Three measures of "typical" — and knowing which one someone quoted you matters enormously.

What this is

All three are measures of central tendency — attempts to summarise a whole dataset with one number. They answer subtly different questions, and on skewed data they can be wildly far apart.

The Three Definitions

  • Mean — add everything up and divide by the count. The balance point: if the data sat on a seesaw, this is where it would tip.
  • Median — sort the values and take the middle one. Half the data is below it, half above.
  • Mode — the value that occurs most often. The tallest bar on the chart.

On a perfectly symmetric distribution all three land in the same place. Load Symmetric and see the three markers stack up.

The Billionaire Test

Press Add a billionaire. One extreme value arrives and the mean lurches toward it, while the median barely twitches and the mode does not move at all.

This is why median household income is reported rather than mean. The mean answers "what if the total were shared equally?" — a real question, but not the same as "what does a typical household earn?". Whenever someone quotes an "average", the first thing worth asking is which one.

Skew Tells You Which Is Bigger

The relationship between the three is a reliable fingerprint of shape:

  • Symmetric — mean ≈ median ≈ mode.
  • Right-skewed (a long tail of large values) — mean > median > mode. The tail drags the mean up. Incomes, house prices and web-session lengths all look like this.
  • Left-skewed — mean < median < mode.

The mean is always pulled toward the tail, because it is the only one of the three that uses the actual magnitude of every value.

Which Should You Use?

  • Mean — for roughly symmetric data with no wild outliers. It uses every value and feeds directly into variance, standard deviation and most ML maths.
  • Median — for skewed data or when outliers are present. It is robust: changing the largest value to a trillion moves it not at all.
  • Mode — for categorical data, where the others are meaningless. The mean of {red, red, blue} is not a colour, but the mode is.

In practice this is a data-cleaning decision: filling missing values with the mean is standard for symmetric numeric columns, with the median for skewed ones, and with the mode for categories.

Three answers to "what is typical"

MeasureHow it is foundBest when
MeanAdd everything, divide by the countSymmetric data, no extreme values
MedianSort, take the middle valueSkewed data, or outliers present
ModeThe most frequently occurring valueCategories, or finding a peak

Take seven salaries: 22, 25, 27, 30, 32, 35, and 250 (thousand).

  • Mean = 421 / 7 = 60.1
  • Median = the fourth value = 30
  • Mode = none, since every value appears once

Six of the seven people earn less than the mean. That single observation is the whole argument for the median: one extreme value pulled the average up by 30, while the middle value did not move at all.

This is why house prices, incomes and response times are reported as medians. Anyone quoting a mean for a skewed distribution is either being careless or making a case.

Robustness, in one idea

The median is robust: changing the largest value to a billion does not move it. The mean is not: every value has a vote weighted by its size, so one outlier can dominate.

Formally, the median has a breakdown point of 50% — you can corrupt almost half the data before it becomes meaningless. The mean has a breakdown point of 0%: one bad value is enough.

The trade-off is that the mean uses all the information and the median throws most of it away. On clean, symmetric data the mean is the more efficient estimator, which is why it remains the default when the data justifies it.

The relationship between them is also diagnostic:

  • Mean ≈ median → roughly symmetric.
  • Mean > median → right-skewed, with a tail of large values (incomes, sales).
  • Mean < median → left-skewed, with a tail of small values (exam scores near a ceiling).

Comparing the two costs one line of code and tells you immediately whether averages are safe to quote.

Where each is used in machine learning

Mean. StandardScaler subtracts it; mean squared error is built from it; the loss reported during training is a mean. Because it is a sum, it is differentiable, which is why optimisers like it.

Median. The default for imputing skewed numeric features, the basis of mean absolute error's optimum, and the centre used by RobustScaler, which scales by the interquartile range instead of the standard deviation.

Mode. The natural imputation for categorical features, the prediction of a classification tree's leaf, and the aggregation used when a random forest votes.

One clean way to remember which loss goes with which: minimising squared error gives you the mean, minimising absolute error gives you the median. So a model trained on MAE predicts the median outcome and is naturally robust to outlying targets.

One salary bends the mean

The same ten numbers, summarised three ways. Watch which summary survives an outlier and which one chases it.

example_01.pyNumPy
Output

Guided experiments

  1. Start symmetric. All three markers sit almost on top of each other — on nice data the distinction genuinely does not matter.
  2. Switch to right-skewed and confirm mean > median > mode, exactly as the rule predicts.
  3. Press "Add a billionaire" two or three times. Track how far the mean travels versus the median. This single demo explains most misleading statistics you will ever read.
  4. Load "Two peaks". The mean and median both land in the empty valley between the clusters — a "typical" value that describes nobody. Sometimes no single number is honest.
  5. Load "Flat". The mode becomes unstable and meaningless, because no value is genuinely more common than the others.

Worth remembering

The mean is the balance point and uses every value — which makes it precise but fragile. The median is the middle and shrugs off outliers. The mode is the most common and is the only option for categories. Skewed data pulls them apart, and "average" without qualification is an ambiguous word.

Beyond the centre

A single number never describes a distribution. Three companions turn "typical" into a picture:

Spread. The standard deviation goes with the mean; the interquartile range (the middle 50%) goes with the median. Reporting a centre without a spread is close to reporting nothing — "average delivery 3 days" is a different promise at ±0.5 days than at ±6.

Quartiles and percentiles. The median is the 50th percentile. The 25th and 75th bracket the middle half, and the 95th or 99th are what service-level agreements are written against, because the average response time hides exactly the slow requests users complain about.

Shape. Skew says which way the tail leans; a histogram says whether there are two peaks. A bimodal distribution — two groups mixed together — has a mean and a median that both sit in the empty valley between them, describing nobody.

That last case is worth taking seriously. Any summary statistic assumes the data is one population. If it is two, the right move is to split it and describe each.

Questions people ask

Which should I report? The median for skewed data, the mean for symmetric data, and both when you can — the gap between them is itself informative.

Can there be more than one mode? Yes. Two peaks is bimodal, and usually means two populations are mixed together.

How do I compute a median for an even count? Average the two middle values after sorting.

Why do models use the mean if it is fragile? Because it is differentiable and uses every data point. Squared error's smooth gradient is what makes optimisation practical.

Should I remove outliers before averaging? Only if they are genuinely errors. Removing real but inconvenient values makes the number look better and the description worse — use the median instead.

What is a trimmed mean? The mean after discarding a fixed percentage from each end — a compromise between the two, common in scoring competitions.

Recap in one screen

  • Mean is the balance point, median is the middle value, mode is the most common one.
  • The mean is dragged by outliers; the median is not, which is why skewed data is reported as a median.
  • Mean above median means a right tail; mean below means a left tail; equal means roughly symmetric.
  • Squared-error loss predicts the mean, absolute-error loss predicts the median.
  • Always pair a centre with a spread, and check for two peaks before summarising at all.

Recall check

0 of 3

Say the answer out loud before you reveal it — recalling it is what makes it stick, and rereading it is not.

  1. Without scrolling back — what is the one-line takeaway from this module?

  2. What does this module say about “What this is”?

  3. What does this module say about “The Three Definitions”?

Cheat sheet

Mean, Mode and Median

Three different answers to “what is a typical value?” — and they disagree more often than you would think. Add one billionaire to the room and watch only one of them survive.

MATHS · vizlearn.in/maths/mean_mode_and_median.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.