← All cheatsheets
Data Analyst · #047 · September 8, 2026 · 1 min read

Mean vs median vs mode: which average should you use?

What each average really measures, when each one lies, the exact SQL and pandas lines for all three, and the one-second skew check: mean, median and mode on one page.

Get the free PDF

One page, print-ready, free to share. No signup needed.

Download the PDF

One number can gaslight a whole report. Mean, median and mode answer three different questions, and dashboards quietly pick the wrong one all the time. Here is the whole thing on one page. The print-ready A4 PDF is at the bottom.

The three

  • Mean: sum / count. Every value counts, which is the feature AND the bug.
  • Median: the middle value once sorted.
  • Mode: the most frequent value.

When each lies

  • Mean + one outlier: one CEO salary skews the whole team's number.
  • Median + tiny samples: jumpy under about 30 rows.
  • Mode + continuous decimals: every value is unique, so there is no "most frequent".

In SQL

SELECT
  AVG(salary)              AS mean_salary,   -- 72,400
  PERCENTILE_CONT(0.5)
    WITHIN GROUP (ORDER BY salary)
                           AS median_salary  -- 48,000
FROM team;

Both numbers are correct. Only one describes a person who exists. For the mode: GROUP BY salary ORDER BY COUNT(*) DESC LIMIT 1.

In pandas

  • s.mean(): the mean.
  • s.median(): the median.
  • s.mode()[0]: the mode, first one if tied.

Pick one

  • Salaries, prices, delays: median.
  • Categories, shoe sizes: mode.
  • Symmetric data with no outliers: the mean is fine, and it sums back to totals.

The trap table

You usedIt breaks whenReach for
meanoutliers exist (money, delays)median
medianyou need totals backmean, plus a note
modevalues are continuousbinned mode or median

Cheap tell in one second: mean far above median means right skew, a few big values dragging it up. Look at the distribution before you report either.

Frequently asked questions

What is the difference between mean, median and mode?
The mean is the sum divided by the count, so every value pulls on it. The median is the middle value once the data is sorted, so extreme values barely move it. The mode is the most frequent value. They answer three different questions, which is why a salary dataset can honestly report a mean of 72,400 and a median of 48,000 at the same time.
When should you use the median instead of the mean?
Whenever the data is skewed or contains outliers: salaries, house prices, delivery delays, transaction amounts. One director at 260k drags the mean of a nine-person team far above what anyone but the director earns, while the median still describes a real person. Rule of thumb: money and durations get medians.
How do you calculate the median in SQL?
Standard SQL has AVG() for the mean but no MEDIAN() in most engines. Use PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY column): the 50th percentile IS the median. For the mode, GROUP BY the value, ORDER BY COUNT(*) DESC and take the first row.
What does it mean when the mean is higher than the median?
Right skew: a few large values are dragging the mean up while the median stays with the crowd. It is the fastest data-quality check there is. If mean and median are far apart, plot the distribution before reporting either number.

Get the free PDF

One page, print-ready, free to share. No signup needed.

Download the PDF

More cheatsheets