The word "average" hides a decision

Someone tells you the average household income in a neighbourhood is 92,000 dollars. You picture a place full of comfortable, upper-middle households. Then you walk down the street and most houses look modest, a few look very ordinary, and one enormous house sits at the end of the road with three cars in the driveway. The average is not wrong. It is just not telling you what you assumed it was telling you.

"Average" is a casual word that usually means the mean, but it can also mean the median or even the mode, depending on who is talking and what they want you to believe. Mean, median and mode are three different, precisely defined ways of answering the same question: what is the typical or central value in this set of numbers? They often agree closely. Sometimes they disagree sharply, and the gap between them is itself useful information. This article builds each one from scratch, shows exactly when they diverge, and gives you a practical way to decide which one to trust for a given dataset.

Part 2 of this path covered the four types of data: nominal, ordinal, discrete and continuous. That distinction matters immediately here, because not every centre is even mathematically valid for every type of data. We will return to that connection once each measure is defined.

A small dataset to carry through this article

To keep the numbers easy to check by hand, imagine nine freelance designers who each report their take-home pay for last month, in US dollars:

🐍Python
earnings = [1800, 1950, 2000, 2100, 2200, 2300, 2400, 2500, 15000]

Eight of the nine designers earned somewhere between 1800 and 2500 dollars. The ninth landed one large corporate contract and earned 15000 dollars that month. This is a realistic shape for income data: a cluster of ordinary values and one value far out on its own. We will compute the mean, median and mode of this list and watch how differently they behave.

The mean: the fair-share value

The intuition

Imagine the nine designers agreed to pool all their earnings for the month and split the pool equally among themselves. The amount each person would walk away with is the mean. It is the value every observation would take if the total stayed the same but the differences between people vanished. This is why the mean is sometimes called the "fair share" or the "balance point" of the data: if you imagine the numbers as weights placed on a see-saw at their positions on a number line, the mean is the point where the see-saw balances.

The definition

The mean of a set of numbers is the sum of all the values divided by how many values there are. If you have n numbers, you add them all up and divide by n. That is the entire definition. There is no sorting involved and no notion of "the middle one"; every single value pulls on the result in proportion to its size.

For the nine earnings figures, the sum is 1800 + 1950 + 2000 + 2100 + 2200 + 2300 + 2400 + 2500 + 15000 = 32250. Dividing by 9 gives a mean of 3583.33 dollars.

Notice what just happened. Eight of the nine designers earned less than the mean, most of them far less. Only the one outlier earned more than the mean, and by a wide margin. If you reported "the average freelancer earned 3583 dollars" to someone who had not seen the raw numbers, they would walk away with a picture that matches nobody in the group particularly well. The mean is accurate as a calculation and misleading as a summary, because a single unusual value dragged it a long way from where most of the data actually sits.

When the mean works well

The mean is an excellent summary when the data is reasonably symmetric and does not contain extreme values far from the rest. It also has a property that matters enormously in later parts of this path and in statistics generally: the mean uses every single data point in its calculation, so it carries the most information of the three measures when the data behaves well. It also has convenient mathematical properties that make it the building block for variance, standard deviation, correlation and most of the machine learning loss functions you will meet later. For well-behaved, roughly symmetric numeric data, the mean is usually the right first choice.

The median: the middle value

The intuition

Instead of pooling and splitting evenly, imagine lining up all nine designers in order of how much they earned, from lowest to highest, and asking the one standing exactly in the middle what they earned. That figure is the median. It does not care how much more or less the people on either side earned, only about their position in the line. The designer earning 15000 dollars could have earned 150000 dollars or 1.5 million dollars and the median would not move at all, because that designer would still simply be standing at the far end of the line.

The definition

To find the median, sort the values from smallest to largest. If there is an odd number of values, the median is the single value sitting exactly in the middle position. If there is an even number of values, there is no single middle value, so the median is defined as the mean of the two values on either side of the middle, which is equivalent to splitting the difference between them.

Our sorted earnings are: 1800, 1950, 2000, 2100, 2200, 2300, 2400, 2500, 15000. There are nine values, an odd number, so the median is the fifth value, counting from either end. That value is 2200 dollars.

Compare the two numbers directly. The mean was 3583.33 dollars. The median is 2200 dollars. The median sits comfortably inside the cluster where eight of the nine designers actually earned, while the mean sits above every single one of those eight people. For this dataset, the median is the far better description of what a "typical" freelancer in this group earned that month.

To see the even-count rule in action, drop the outlier and imagine only eight designers: 1800, 1950, 2000, 2100, 2200, 2300, 2400, 2500. Now there is no single middle value; the two middle values are 2100 and 2200. The median is their average, (2100 + 2200) / 2 = 2150 dollars.

When the median works well

The median shines exactly in the situation where the mean struggles: data with outliers, or data that is skewed, meaning it has a long tail stretching out on one side. Income, house prices, hospital bills, time-to-failure of equipment and city population sizes are classic examples of skewed, real-world measurements, and government statistical agencies typically report median income rather than mean income for exactly this reason. The cost of this robustness is that the median throws away information. It does not care whether the top earner made 15000 or 1.5 million dollars, and in some situations that distinction does matter.

The mode: the most common value

The intuition

The mode asks a different question entirely: not "what is the fair share" and not "what is in the middle", but simply "what value shows up most often". If you asked a room of ten people for their favourite programming language and seven said Python, two said JavaScript and one said Rust, the mode of that survey is Python, because it is the single most frequent answer. There is no sum, no sorting by size, no notion of balance; the mode is pure counting.

The definition

The mode of a dataset is the value that occurs with the highest frequency. A dataset can have one mode (unimodal), two modes tied for the highest frequency (bimodal), more than two (multimodal), or no mode at all if every value appears exactly once.

Look back at our freelancer earnings: 1800, 1950, 2000, 2100, 2200, 2300, 2400, 2500, 15000. Every single value appears exactly once. This dataset has no mode. That alone is a useful observation: the mode is only informative when values actually repeat, which tends to happen with counts, categories, or measurements rounded to a limited set of possible values, rather than with finely measured continuous numbers like exact salaries.

To see the mode do real work, switch to a dataset where repetition is natural. Suppose a shoe shop records the European shoe size of the last 12 pairs sold: 38, 39, 39, 40, 40, 40, 40, 41, 41, 42, 43, 44. Size 40 appears four times, more than any other size, so the mode is 40. Neither the mean (40.5) nor the median (40, since the middle two values when sorted are both 40) is wrong here, but the mode answers the specific question a shop manager actually cares about: which size should I stock the most of? That is a question about frequency, not about balance or position, and the mode is built exactly for it.

Where the mode is the only option

Recall from part 2 that nominal data consists of categories with no inherent order: eye colour, country of residence, favourite programming language, blood type. You cannot sum "Python" and "JavaScript" and divide by two, and there is no meaningful way to sort categories by size to find a middle one. For nominal data, the mode is not just the best choice of centre, it is the only one of the three that makes sense at all. If a product manager asks "what is the average browser our users prefer", the honest answer is a mode: Chrome, say, because it is the most common answer, not a mean or a median of browser names.

Why the three measures disagree: skew and outliers

The freelancer example showed a gap of more than 1300 dollars between the mean and the median, caused by a single unusual value. This pattern has a name you will meet properly in part 6 of this path: skew. A distribution is right-skewed, or positively skewed, when most values cluster on the lower end and a small number of large values stretch the tail out to the right, exactly like the freelancer earnings. In a right-skewed distribution, the mean is pulled toward the long tail and ends up larger than the median. The reverse happens with a left-skewed distribution: a cluster of large values with a few unusually small ones pulls the mean below the median.

You do not need to wait until part 6 to use this idea practically. A simple, reliable rule of thumb: whenever the mean and the median of a dataset are noticeably different, the data is probably skewed or contains at least one outlier, and the median is usually the safer single number to quote. When the mean and median are close to each other, the data is reasonably symmetric, and the mean is safe to use and preferable because it uses more information.

It helps to see the comparison as a short table built from our own numbers.

  • Mean of the 9 freelancer earnings: 3583.33 dollars, pulled upward by the one large contract.
  • Median of the 9 freelancer earnings: 2200 dollars, matching where most of the group actually sits.
  • Mode of the 9 freelancer earnings: none, because no value repeats.
  • Mean of the 12 shoe sizes: 40.5, close to the middle of the data.
  • Median of the 12 shoe sizes: 40, almost identical to the mean because this dataset is fairly symmetric.
  • Mode of the 12 shoe sizes: 40, the single most useful number for restocking decisions.

The shoe size example shows what agreement looks like: when mean, median and mode sit close together, you can trust any of them and the choice mostly comes down to which question you are answering. The earnings example shows what disagreement looks like, and disagreement is the signal that should make you stop and look at the raw data before quoting a single number.

Connecting back to data types

Part 2 introduced nominal, ordinal, discrete and continuous data. Each type restricts which centres are mathematically defensible, independently of skew.

  • Nominal data (categories with no order, such as blood type or favourite language): only the mode is valid. Mean and median require either arithmetic or a meaningful order, and nominal categories have neither.
  • Ordinal data (categories with a meaningful order but unequal or undefined gaps between them, such as a five-point satisfaction rating or a t-shirt size scale of S, M, L, XL): the mode is always valid, and the median is usually defensible because you can sort ordinal values and find a middle one. The mean is debated and often misleading, because it silently assumes that the gap between "satisfied" and "very satisfied" is the same size as the gap between "dissatisfied" and "neutral", which the dat
  • Discrete numeric data (counts, such as the number of children in a household or the number of support tickets filed per day): mean, median and mode are all valid, since the values are real numbers you can add, sort and count.
  • Continuous numeric data (measurements such as weight, temperature or income): mean and median are both valid and usually the most useful; the mode is often undefined or unstable, because continuous measurements rarely repeat exactly unless they have been rounded.

A common mistake is to take an ordinal rating scale, say 1 to 5 stars, and report its mean as though the scale were a true measurement, for example "our average rating is 3.7 stars". This is extremely common in practice and not necessarily wrong to report, but it carries a hidden assumption: that going from 3 stars to 4 stars represents the same increase in satisfaction as going from 1 star to 2 stars. Many survey researchers doubt that assumption, since the emotional distance between "terrible" and "poor" may not match the distance between "good" and "excellent". When you see a mean reported for a rating scale, treat it as a useful rough signal, but check whether the underlying distribution of individual ratings (how many 1s, 2s, 3s, 4s and 5s there actually were) tells a different story, for instance a mix of mostly 5-star and 1-star ratings with very few in between, which would average out to a middling score that matches almost nobody's actual experience.

A second worked example: exam scores

To practise on a cleaner, less skewed dataset, consider the scores out of 100 for 11 students on a short quiz:

🐍Python
scores = [58, 61, 63, 65, 67, 68, 70, 71, 73, 75, 95]

Sum the scores: 58 + 61 + 63 + 65 + 67 + 68 + 70 + 71 + 73 + 75 + 95 = 766. There are 11 students, so the mean is 766 / 11, which is 69.64, rounding to two decimal places.

The scores are already sorted. With 11 values, the median is the sixth value, which is 68.

No score repeats, so once again there is no mode. This dataset is far closer to symmetric than the freelancer earnings: the mean (69.64) and median (68) are close, only about a point and a half apart, even though there is one noticeably high score of 95. That single high score nudges the mean up slightly but is not extreme enough, relative to the spread of the rest of the class, to create the kind of dramatic gap we saw with the earnings data. This is a useful contrast: not every unusually large value causes a big mean-median gap. Whether a value counts as a disruptive outlier depends on how far it sits from the rest of the data relative to how spread out that data already is, which is exactly the question the next part of this path, on spread, is built to answer.

Computing all three in Python

The example below uses only the standard library's statistics module, available in Python 3 with no extra installation, so the exact numbers shown are reproducible on any standard Python 3 installation (tested against Python 3.11; the statistics module has been part of the standard library since Python 3.4).

🐍Python
import statistics

earnings = [1800, 1950, 2000, 2100, 2200, 2300, 2400, 2500, 15000]

mean_value = statistics.mean(earnings)
median_value = statistics.median(earnings)

print("mean:", mean_value)
print("median:", median_value)

try:
    mode_value = statistics.mode(earnings)
    print("mode:", mode_value)
except statistics.StatisticsError as error:
    print("mode: not defined --", error)

Running this prints a mean of 3583.333333333333, a median of 2200, and, for the mode, a StatisticsError, because in Python's statistics module mode() raises that error when no value is the single most common one and there is no unique mode to return. (In Python 3.8 and later, statistics also offers multimode(), which returns a list of all values tied for the most frequent, and would simply return the whole list here, since every value appears exactly once.) This matches exactly the hand calculations earlier: the mean is pulled toward the outlier, the median is not, and the mode is undefined because nothing repeats. Running the same code on the shoe size list from earlier would instead print a clean mode of 40, since that value genuinely repeats more often than any other.

A practical checklist before you trust a centre

When you are handed a dataset and need to report or interpret a central value, it helps to work through a short sequence of questions rather than reaching straight for whichever function your tool offers first.

  1. What type of data is this? If it is nominal, stop here and use the mode; mean and median are not mathematically meaningful. If it is ordinal, favour the median or the mode and treat a reported mean with caution. If it is discrete or continuous, all three are available.
  2. Look at the sorted raw values, or at least a histogram, before computing anything. Are there one or two values that sit far away from the rest? That visual check often tells you more than any formula.
  3. Compute both the mean and the median. If they are close, the data is roughly symmetric and either is safe to quote, with the mean preferred for its extra use of information. If they differ noticeably, treat that gap as a warning sign of skew or outliers, and lean toward the median as the headline number.
  4. Check whether any value repeats meaningfully. If a small number of distinct values account for most of the observations, as with shoe sizes or survey ratings, the mode adds something the mean and median cannot: which specific value is most common.
  5. State which measure you used when you report a number. "Average" on its own is ambiguous. Writing "median income" or "mean quiz score" costs three extra words and removes the ambiguity entirely.

Common mistakes worth naming directly

A few errors show up again and again in real analysis work, and it is worth calling them out by name so you recognise them immediately.

  • Reporting the mean of heavily skewed data without mentioning the median. Income, house prices, response times and hospital stay lengths are classic examples; quoting only the mean for these routinely overstates the typical case, because a small number of very large values drag it upward.
  • Averaging an average. If you are given the mean score for each of several classes and you take the mean of those class means, you get the correct overall mean only if every class has exactly the same number of students. Otherwise, larger classes should count more, and you need the total sum of all scores divided by the total number of students, not a simple average of averages.
  • Computing a mean or median on codes that look numeric but are not. Postal codes, phone numbers, product IDs and category codes such as 1 for "small", 2 for "medium", 3 for "large" are nominal or ordinal labels wearing numeric disguises. A mean postal code or a mean product ID is meaningless even though the spreadsheet will happily calculate one.
  • Trusting a mode computed from very few observations. If you survey only six people about their favourite colour and three say blue while the other three are split across three other colours, the mode is technically blue, but it rests on a fragile three-way comparison that could flip with one more respondent. The mode becomes more trustworthy as the sample size grows, exactly like the other two measures, a point this path will return to when it discusses samples versus populations.
  • Assuming the median of an even-sized dataset is always one of the original values. As shown earlier, when n is even the median is the average of the two middle values, which can produce a number, such as 2150, that does not appear anywhere in the original data. This is expected and correct, not an error, but it surprises people who assume the median must always be an actual observed value.

Summary and what comes next

The mean is the fair-share value, found by summing everything and dividing by the count; it uses all the information in the data but is sensitive to extreme values and skew. The median is the middle value after sorting, found differently depending on whether the count is odd or even; it resists outliers well but discards information about how extreme the extremes actually are. The mode is the most frequently occurring value; it is the only valid centre for nominal data and the most useful one whenever you specifically care which single value is most common, such as stock sizes or survey categories. None of the three is universally correct. The right choice depends first on the type of data you have, and second, for numeric data, on whether the mean and median agree closely or pull apart, which tells you whether skew or outliers are shaping the picture.

Knowing the centre of a dataset is only half the story. Two datasets can share exactly the same mean and median while looking completely different, one tightly clustered and the other wildly scattered. Part 4 of this path picks up exactly there, introducing range, variance, standard deviation and the interquartile range, the tools that measure how spread out the data is around whichever centre you decide to trust.