STATISTICS · MEASURES OF CENTER

The mean is the sum of all values divided by how many there are. The median is the middle value once the data is sorted. The short answer: use the mean when the data is roughly symmetric and every value should count, and use the median when the data is skewed, has extreme values, or is ranked rather than measured.

Both numbers try to answer the same question, "what is a typical value?", and on tidy data they agree. They split apart when a few values sit far from the rest. This guide shows the difference with small worked examples, explains why the gap appears, and ends with a checklist for choosing between them. It belongs to our wider statistics guides. If you also want the mode, the shorter mean, median and mode guide covers all three side by side.

Mean vs Median at a Glance

  • Mean Add all values, divide by the count; uses every value and is pulled by extremes
  • Median The middle value of the sorted data; ignores how far the extremes are
  • Symmetric data The two are equal or very close
  • Skewed data or outliers The mean moves toward the tail; the median stays near the bulk of the data
  • Ranked or rated data The median is the safer choice
  • Default choice Report the median for skewed data, the mean for symmetric data, and show both when they disagree
Two number lines with the values 3, 7, 8, 12 and 15. Left: the mean shown as a balance point at 9. Right: the median shown as the middle value, 8, with two values below and two above
The same five values give a mean of 9 and a median of 8.

What Is the Mean?

The mean, often just called the average, is the arithmetic average of a data set. Picture the values as weights on a plank: the mean is the point where the plank balances. Because every value pulls on that balance point, one very large or very small value shifts it.

Mean Formula

Mean = (x₁ + x₂ + … + xₙ) ÷ n, where each x is a value and n is how many values you have.

Mean Example

Take 3, 7, 8, 12 and 15. The sum is 45 and there are 5 values, so the mean is 45 ÷ 5 = 9. Notice that 9 is not one of the values. The mean does not have to be a number that appears in the data.

What Is the Median?

The median is the middle observation. Half of the values fall at or below it and half at or above it. It depends on the order of the values, not on how large they are, which is why it reacts so little to extremes.

Median Formula

  1. Sort the values from smallest to largest.
  2. Count them. Call the count n.
  3. If n is odd, the median is the value in position (n + 1) ÷ 2.
  4. If n is even, the median is the average of the two middle values, in positions n ÷ 2 and n ÷ 2 + 1.

Median Example

With the five values 3, 7, 8, 12 and 15, the middle one is the third value, so the median is 8. Add a sixth value, 20, and the middle sits between 8 and 12. The median becomes (8 + 12) ÷ 2 = 10, while the mean becomes 65 ÷ 6, which is about 10.8.

Key Differences Between Mean and Median

Mean versus median
FeatureMeanMedian
What it isSum of values ÷ countMiddle value of sorted data
Uses every valueYesNo, only the position
Effect of outliersLarge; it moves toward themSmall
Skewed dataDragged toward the long tailStays near the bulk of the data
Symmetric dataEquals the medianEquals the mean
Ordinal data (ranks, ratings)Often not meaningfulWorks
Good for totalsYes: mean × n gives the totalNo
Excel functionAVERAGEMEDIAN
Typical examplesTest scores in a normal range, daily temperature, lab measurementsIncome, house prices, response times, order values

Worked Example: One Outlier Changes the Mean, Not the Median

A small team has seven salaries, in thousands of dollars: 40, 42, 45, 48, 50, 52 and 55. The mean is 332 ÷ 7, about 47.4, and the median is the fourth value, 48. The two agree closely.

Now a new executive joins at 400. The list has eight values and the sum is 732. The mean jumps to 732 ÷ 8 = 91.5. The median is the average of the fourth and fifth values, (48 + 50) ÷ 2 = 49. Nobody else's pay changed, yet the mean nearly doubled and the median moved by one thousand dollars.

  • $47.4KMean before
  • $91.5KMean after
  • $49KMedian after
Grouped bar chart. The mean of seven salaries is 47.4 thousand dollars and rises to 91.5 thousand when one 400 thousand dollar salary is added. The median goes from 48 thousand to 49 thousand
Adding one extreme value. The data is hypothetical.

An average salary of $91,500 describes nobody on this team. The median of $49,000 describes the group much better. To spot values like the $400K one before you choose a measure, see how to find outliers or run your column through the outlier calculator.

Why the Mean Moves and the Median Does Not

The mean adds up the actual size of every value, so a value of 400 contributes 400 to the sum. The median only asks where each value falls in the order. The 400 is simply "the largest one," and it would count the same whether it were 60 or 6,000. Penn State's course notes make this point directly: of the three measures of center, the mean is the one most influenced by outliers or skewness, and the median is often preferred when either is present (Penn State STAT 200).

The reverse is also true. The mean uses all the information in the data, which is an advantage when the values are well behaved or when you need a total. The median throws some of that information away, and that is exactly what makes it steady.

Mean vs Median in Skewed Distributions

Skewness describes which side of a distribution has the longer tail. The mean follows the tail, and the median stays closer to the peak. You can see this in a histogram, and our guide to histogram shapes shows how to read each one.

Three curve shapes. Right-skewed: mode lowest, then median, then mean. Symmetric: all three coincide. Left-skewed: the order reverses with the mean lowest
Mean, median and mode for three distribution shapes. The curves are illustrative.

Right-Skewed Distribution

Most values are low and a few are very high, such as income or house prices. The mean is pulled up and ends above the median. OpenStax states the usual ordering as mode below median below mean (OpenStax Statistics).

Left-Skewed Distribution

Most values are high and a few are very low, such as scores on an easy exam where a handful of students did badly. Take ten scores: 35, 78, 82, 84, 85, 86, 88, 90, 92 and 95. The mean is 81.5 and the median is 85.5. The single 35 drags the mean below the median.

Symmetric Distribution

The two sides mirror each other, so the mean and median land on the same spot. In that case the mean is usually the preferred summary, because it uses all the data and nothing is distorting it.

One caution. "Mean above median means right skew" is a rule of thumb, not a law. Paul von Hippel showed that textbook versions of the rule fail for some distributions, mostly discrete ones such as counts (Journal of Statistics Education). Look at the histogram or box plot as well, instead of judging shape from two numbers. The box plot guide explains how to read one.

When to Use the Mean

The mean is the better choice when most of these are true:

  • The distribution is roughly symmetric, with no extreme values pulling one way.
  • Every value should count, as in a lab measurement repeated several times.
  • You need a total. Mean revenue per order times the number of orders gives total revenue. The median cannot do that.
  • You plan further calculations. Standard deviation, many forecasts and many statistical tests are built on the mean. See standard deviation explained for the link.
  • The data is measured on a numeric scale, not ranks.

When to Use the Median

Pick the median when any of these apply:

  • The data is skewed, as with income, prices, session length or wait times.
  • There are outliers you cannot or should not remove.
  • The data is ordinal. The gap between rank 1 and rank 2 may not equal the gap between rank 4 and rank 5.
  • You want the "typical" case. Half the group is above the median and half below, which is easy to explain.
  • The sample is small and one odd value could dominate the mean.

Neither measure is universally better. A common mistake is to treat the median as the "safe" answer. If a few large values are the business story, such as a handful of customers producing most revenue, the median hides them and the mean shows them.

Mean vs Median vs Mode

The mode is the most frequent value. It is the only one of the three that works for categories such as "most common shoe size" or "most popular plan." A data set can have no mode, one mode or several. For numeric data you usually look at the mean and median first and add the mode when the data has clear repeating values. Our mean, median and mode guide compares all three, and descriptive statistics shows where they fit among the other summary measures.

Real-World Examples

Income

Income is the standard case for the median. The U.S. Census Bureau reports median household income, defined as the midpoint where half of households have more and half have less. For 2025 it was $87,460 in inflation-adjusted dollars (U.S. Census Bureau). A mean would be pulled up by very high earners and would describe fewer households.

House Prices

Take nine homes on a street, priced in thousands of dollars: 280, 295, 310, 320, 335, 350, 360, 380 and 1,900. The mean is 4,530 ÷ 9, about 503. The median, the fifth value, is 335. Eight of the nine homes sell below the mean, so a buyer quoted "the average price is $503K" would be misled.

Bar chart of nine home prices. Eight homes sell between 280 and 380 thousand dollars and one sells for 1.9 million. The median is 335 thousand and the mean is about 503 thousand
One expensive home lifts the mean far above what most homes cost. Hypothetical data.

Exam Scores

Scores in a normal range are often close to symmetric, so the mean works. When a few students score far below the class, as in the left-skewed example above, report the median or show both so readers see the gap.

Business Revenue and Customer Spending

Order values and customer spending are usually right-skewed: many small purchases and a few very large ones. The mean tells you revenue per order, which you need for forecasting. The median tells you what a typical customer spends. Reporting both avoids setting prices or targets on a number that few customers match. Our guides to sales data analysis and KPI examples show where each fits in reporting.

A Quick Decision Checklist

  1. Check the scale. Ranks or rating scales point to the median.
  2. Look at the shape. Draw a histogram or box plot. A long tail points to the median.
  3. Compare the two numbers. If they are close, the choice barely matters. If they are far apart, the data is skewed or has outliers.
  4. Ask what the reader will do with it. Totals and forecasts need the mean. "What does a typical case look like?" needs the median.
  5. Check the outliers. Remove an outlier only if it is an error, not because it is inconvenient.
  6. When they disagree, report both and say why.
Flowchart: if the data is ordinal use the median; if there are extreme values or a long tail use the median and show the mean beside it; if you need a total or every value must count use the mean; otherwise the data is roughly symmetric and either works
The checklist as a flow. It is a guide, not a law.

A center value alone does not describe a data set. Pair the mean with the standard deviation, and the median with the interquartile range, so readers also see how spread out the values are. The guide to reading summary statistics explains how.

How to Calculate Mean and Median in Excel, Python and SQL

Excel and Google Sheets. Use =AVERAGE(B2:B9) for the mean and =MEDIAN(B2:B9) for the median. Pivot tables offer Average but not Median, so for a median by group use =MEDIAN(FILTER(B2:B100, A2:A100="North")) in a version of Excel that supports FILTER. More spreadsheet steps are in our Excel data analysis guide.

Python. The standard library and pandas both have the two functions. This uses the salary example from above:

import statistics as st
import pandas as pd

salaries = [40, 42, 45, 48, 50, 52, 55]      # $K
with_ceo = salaries + [400]

print(st.mean(salaries), st.median(salaries))   # 47.43  48
print(st.mean(with_ceo), st.median(with_ceo))   # 91.5   49.0

# Mean and median by group in pandas
df = pd.DataFrame({
    "team": ["A", "A", "A", "B", "B", "B"],
    "revenue": [10, 12, 90, 20, 22, 24],
})
print(df.groupby("team")["revenue"].agg(["mean", "median"]))
# Team A: mean 37.3, median 12.0   Team B: mean 22.0, median 22.0

SQL. The mean is AVG() everywhere. The median depends on the database. In PostgreSQL:

SELECT AVG(salary) AS mean_salary,
       PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY salary) AS median_salary
FROM employees;

MySQL has no built-in median function, so people usually rank the rows or use a window function instead. If you would rather skip code, paste a column of numbers into the descriptive statistics calculator, or ask for both measures in plain English with AI data chat. Messy input will give wrong answers, so clean it first with the CSV cleaning guide.

Mean and Median in School and Exams

Exam questions on this topic repeat a few patterns. Sort first, every time. For an even count, average the two middle values. For "find the missing value," work from the total: if five numbers have a mean of 12, they sum to 60, so subtract the four you know. When asked which measure to use, name the reason: "the median, because the data is skewed" earns more marks than the bare word.

Common Mistakes With Mean and Median

  • Not sorting before finding the median. The middle of an unsorted list means nothing.
  • Forgetting to average the two middle values when the count is even.
  • Using the mean for skewed data and calling it "typical."
  • Using the median when you need a total. Median × n does not give the sum.
  • Deleting outliers to make the mean look better. Remove only values that are errors.
  • Reporting one number alone. Without a measure of spread, a center value can mislead.
  • Averaging medians of groups to get the overall median. It does not work; compute it from the combined data.
  • Calling the two interchangeable. "Average" usually means the mean, and mixing the terms confuses readers.

Practice Questions With Answers

1. Find the mean and median of 4, 9, 11, 12 and 14.

Mean 10, median 11. The sum is 50, and 50 ÷ 5 = 10. The middle value is 11.

2. Find the mean and median of 6, 8, 10 and 20.

Mean 11, median 9. The sum is 44, and 44 ÷ 4 = 11. The median is (8 + 10) ÷ 2 = 9.

3. The mean of five numbers is 12. Four of them are 8, 10, 14 and 15. What is the fifth?

13. The total must be 5 × 12 = 60. The four known values add to 47, and 60 − 47 = 13.

4. Five homes sell for 250, 260, 270, 280 and 1,440 (thousands). Which measure describes the typical home?

The median, 270. The mean is 500, which is higher than four of the five homes because of one expensive sale.

5. Test scores are 70, 72, 75, 78 and 80. A missing paper is entered as 0. What happens to the mean and median?

The mean drops from 75 to 62.5, the median from 75 to 73.5. The mean falls by 12.5 points, the median by 1.5.

6. A data set has a mean of 50 and a median of 40. Which way is it probably skewed?

To the right. The mean is above the median, which usually means a long tail of high values. Check a histogram to confirm.

Try Both Measures on Your Own Data

Compare the two numbers on your own column. The descriptive statistics calculator summarizes it, the histogram maker and box plot maker show its shape, the outlier calculator flags extreme values, and the frequency table maker counts repeated values. For a charting workflow, see our data visualization features.

Frequently Asked Questions About Mean vs Median

What is the difference between mean and median?

The mean is the sum of the values divided by the count. The median is the middle value of the sorted data. The mean uses every value and is pulled by extremes, while the median depends only on position.

Which is better, mean or median?

Neither wins every time. The mean suits symmetric data and totals. The median suits skewed data, outliers and ranked data. When the two differ a lot, report both.

When should you use the mean instead of the median?

Use the mean when the data is roughly symmetric, when every value should count, or when you need a total or plan to do further calculations such as standard deviation.

When should you use the median instead of the mean?

Use the median when the data is skewed, has outliers, or is ordinal. Income, house prices and wait times are common cases.

Why is the median less affected by outliers?

The median only uses the order of the values. An extreme value is just the largest or smallest one, whatever its size, so it barely changes which value sits in the middle.

Can the mean and median be the same?

Yes. In a symmetric distribution they are equal or nearly equal. They can also match by chance in a small data set, such as 2, 4 and 6, where both are 4.

What happens to the mean when an outlier is added?

It moves toward the outlier. In the salary example, adding one value of 400 to seven values near 48 raised the mean from about 47.4 to 91.5.

Is the mean always greater than the median?

No. In right-skewed data the mean is usually higher, in left-skewed data it is usually lower, and in symmetric data they match. Even the "usually" can fail for some discrete distributions.

Can the median be higher than the mean?

Yes. That is typical of left-skewed data, such as the exam scores above where one very low score pulls the mean below the median.

Which measure is best for income?

The median, in most cases. Income is right-skewed, so a few very high earners lift the mean. The U.S. Census Bureau reports median household income for this reason.

Is the mean the same as the average?

In everyday use, yes. "Average" normally means the arithmetic mean. Strictly, mean, median and mode are all averages, so name the one you mean.

How do you find the median of an even number of values?

Sort the values, take the two in the middle and average them. For 6, 8, 10 and 20 the median is (8 + 10) ÷ 2 = 9.

Should analysts report both mean and median?

When the two differ noticeably, yes. The gap itself tells the reader the data is skewed or has outliers. When they are close, one number is enough.

Key Takeaways

  • The mean balances every value; the median marks the middle. They answer slightly different questions.
  • On symmetric data the two agree. On skewed data the mean follows the long tail.
  • One extreme value can move the mean a lot and the median very little.
  • Use the median for income, prices, wait times and ranked data. Use the mean for totals and symmetric data.
  • A big gap between the two is a signal. Look at a histogram before deciding.
  • When unsure, report both and add a measure of spread.

Bottom line: The right measure is the one that describes the data without misleading the reader. For more on summarizing data, browse the full statistics category.

Further Reading and Sources