How to Calculate Mean, Median, and Mode

Mean, median, and mode are the three ways statisticians answer the simplest question in data: “what’s typical?” They sound interchangeable, but they behave very differently — pick the wrong one and a single billionaire can make a whole town look rich. Here’s how to calculate all three, when each one is honest, and the traps that catch students every year.

1. The Mean (Average)

Add every value, divide by how many there are:

Mean = (sum of all values)/(n)

The mean uses every data point, which is its strength — and its weakness.

The outlier trap

The mean’s fatal flaw is its sensitivity to extreme values. One enormous outlier drags the mean toward itself and produces a “typical” value that represents nobody. This is exactly why economists report median household income rather than the mean — a handful of billionaires would otherwise distort the picture beyond recognition.

If a dataset might contain outliers, never trust the mean alone. Compute the median alongside it and compare — a big gap between the two is the fingerprint of skew.

2. The Median (Middle Value)

The median is the positional center: half the values sit below it, half above.

  1. Sort the data in ascending order — this step is non-negotiable.
  2. Odd count (n): the median is the single middle value, at position (n + 1) ÷ 2.
  3. Even count (n): the median is the average of the two middle values — add them and divide by 2. It is one number, never two.

Because the median only cares about position, outliers barely move it. That’s why it’s the go-to measure for incomes and house prices.

3. The Mode (Most Frequent Value)

The mode is simply the value that appears most often:

  • No mode: every value appears equally often (e.g., each appears once).
  • Unimodal: exactly one value is the most frequent.
  • Bimodal / multimodal: two or more values tie for the highest frequency.

Unlike the other two, the mode works on non-numerical data too — favorite colors, shoe sizes, survey answers. You can’t average “blue,” but you can certainly find the most popular color.

Worked Example 1: All Three Measures

Find the mean, median, and mode of: 15, 22, 18, 22, 12, 25, 17

Step 1: Sort the data

12, 15, 17, 18, 22, 22, 25  (n = 7)

Step 2: Mean

Sum = 12 + 15 + 17 + 18 + 22 + 22 + 25 = 131

Mean = 131 ÷ 7 ≈ 18.71

Step 3: Median

n = 7 is odd, so the middle position is (7 + 1) ÷ 2 = 4th value.

The 4th sorted value is 18, so the median is 18.

Step 4: Mode

22 appears twice; every other value appears once. Mode = 22.

Summary: mean ≈ 18.71, median = 18, mode = 22.

Worked Example 2: The Outlier Effect

Weekly hours worked by six freelancers: 5, 6, 7, 8, 9, 200

Mean: (5 + 6 + 7 + 8 + 9 + 200) ÷ 6 = 235 ÷ 6 ≈ 39.17 hours

Median: sorted already; the two middle values are 7 and 8, so median = (7 + 8) ÷ 2 = 7.5 hours

See the problem? The mean claims a “typical” freelancer works 39 hours a week, when five of the six work under 10. The median’s 7.5 is the honest answer here.

Worked Example 3: Bimodal Data

Quiz retake scores: 2, 3, 3, 5, 5, 8

Both 3 and 5 appear twice — this dataset is bimodal: modes = 3 and 5. There’s nothing wrong with that; it often signals two distinct groups in the data (here, perhaps students who restudied and students who didn’t).

Which One Should You Use?

  • Mean: symmetric data with no outliers — test scores, measurements, anything bell-shaped.
  • Median: skewed data or data with outliers — incomes, house prices, wait times.
  • Mode: categorical data, or when you need the single most common value — popular products, survey winners.

3 Mistakes to Avoid

  • Finding the median without sorting: the middle of an unsorted list is a random number, not a statistic. Sort first, always.
  • Reporting two medians for even datasets: average the two middle values into one number. “The median is 7 and 8” is wrong; it’s 7.5.
  • Writing “Mode = 0” when nothing repeats: zero is a number — claiming it’s the mode says zero is the most frequent value. The correct answer is “no mode.”

On exams, the mean–median comparison is the favorite trick question: if they differ noticeably, the data is skewed — and they’ll ask you which direction. Mean pulled right of median means right skew (a few large values); left of median means left skew.

Scroll to Top