Ultimate Calculator
Math guide

Mean, median and mode explained

What mean, median and mode are, how to calculate each one, when to use which, and how outliers pull the mean. Includes worked examples.

The mean is the sum of the values divided by how many there are, the median is the middle value when the data is sorted, and the mode is the value that appears most often. All three describe the "typical" value of a data set, but they can give different answers.

How to calculate each one

Take this data set of seven quiz scores: 4, 8, 6, 5, 3, 8, 8.

Mean

Mean = Sum of values ÷ Number of values

The sum is 4 + 8 + 6 + 5 + 3 + 8 + 8 = 42. There are 7 values, so the mean is 42 ÷ 7 = 6.

Median

Sort the values first: 3, 4, 5, 6, 8, 8, 8. With 7 values, the middle one is the 4th, so the median is 6.

When the count is even there are two middle values, and the median is their mean. For 3, 5, 7, 10 the two middle values are 5 and 7, so the median is (5 + 7) ÷ 2 = 6.

Mode

Count how often each value appears. In the quiz scores, 8 appears three times and every other value once, so the mode is 8.

A data set can have more than one mode (1, 1, 2, 3, 3 has modes 1 and 3) or no mode at all if every value appears once.

For long lists, paste the numbers into the mean, median and mode calculator to get all three at once.

How outliers affect each measure

An outlier is a value far from the rest. The mean uses every value, so a single outlier can drag it a long way. The median only cares about the middle position, so it barely moves.

Worked example. Five employees earn (in thousands of dollars) 32, 35, 38, 40 and 45.

  • Mean: (32 + 35 + 38 + 40 + 45) ÷ 5 = 190 ÷ 5 = 38.
  • Median: the 3rd value, 38.

Now the owner, who earns 250, is added to the list: 32, 35, 38, 40, 45, 250.

  • Mean: 440 ÷ 6 ≈ 73.3.
  • Median: (38 + 40) ÷ 2 = 39.

The mean nearly doubled, and now no employee earns anywhere close to the "average" salary. The median moved by 1. This is why house prices and incomes are usually reported as medians.

When to use each

MeasureBest forWeakness
MeanRoughly symmetric data with no extreme values, such as test scores or heights; any case where the total mattersDistorted by outliers and skewed data
MedianSkewed data or data with outliers, such as incomes, house prices, waiting timesIgnores how far the extreme values are
ModeCategories and counts, such as most common shoe size, favorite color, most frequent answerMay not exist, may not be unique, and can sit far from the center

A useful habit is to compare the mean and the median. If they are close, the data is roughly symmetric. If the mean is well above the median, a few large values are pulling it up (right skew). If it is well below, a few small values are pulling it down (left skew).

Weighted mean

Sometimes values do not count equally. Multiply each value by its weight, add the results, and divide by the total weight.

Worked example. Coursework is worth 30% of a grade and the exam 70%. You score 80 on coursework and 90 on the exam.

Weighted mean = (80 × 0.30) + (90 × 0.70) = 24 + 63 = 87

The plain mean of 80 and 90 would be 85, which understates the result because it ignores the exam's larger weight.

Common mistakes

  • Not sorting before finding the median. The middle of the unsorted list 4, 8, 6, 5, 3, 8, 8 is 5, but the true median is 6.
  • Picking one of the two middle values. With an even count, average the two middle values.
  • Averaging averages. If class A has 20 students averaging 70 and class B has 30 students averaging 80, the combined mean is (20 × 70 + 30 × 80) ÷ 50 = 3,800 ÷ 50 = 76, not 75.
  • Reporting the mode as the count. The mode is the value (8), not how many times it appears (3).
  • Using the mean on skewed data without comment. If one value dominates, give the median as well.
  • Stopping at the center. Two data sets can share a mean and still look nothing alike. A measure of spread, from the standard deviation calculator, completes the picture.

Common questions

What is the difference between mean and median?

The mean is the total divided by the count, while the median is the middle value of the sorted data. The median is much less affected by extreme values.

Can a data set have more than one mode?

Yes. If two or more values tie for the highest frequency, each is a mode. If every value appears only once, there is no mode.

Which average should I use for salaries or house prices?

Use the median. A few very high values pull the mean upward, so the median gives a better picture of a typical value.