Median Calculator
Find the middle value (median) of your data set.
Quick Examples
What is Median?
The median is the middle value when data is sorted in order. Half the values are above the median and half are below.
How to Find Median
Odd number of values: The middle value after sorting.
Example: {1, 3, 5, 7, 9} - Median = 5
Even number of values: The average of the two middle values.
Example: {1, 3, 5, 7} - Median = (3 + 5) / 2 = 4
When to Use Median
- When data is skewed (not symmetric)
- When outliers are present
- For ordinal data
- Income and housing prices (where outliers are common)
Median Formulas
After sorting the data, the median is found by position. With an odd count n, the median is the value at position (n+1)/2:
With an even count, average the two middle values at positions n/2 and n/2+1:
Worked Examples
Example 1: Odd count
Data: 7, 3, 9, 4, 12, 1, 8. Sorted: 1, 3, 4, 7, 8, 9, 12. With n = 7, the middle position is (7+1)/2 = 4, and the 4th value is 7 — so the median is 7.
Example 2: Even count
Data: 10, 2, 8, 4, 6, 14. Sorted: 2, 4, 6, 8, 10, 14. The middle two values sit at positions 3 and 4 — 6 and 8. The median is (6+8)/2 = 7, which appears nowhere in the original data. That is normal for even-sized sets.
Example 3: One outlier changes everything
Data: 4, 5, 6, 7. Mean = median = 5.5. Now add one extreme value, 88: the mean jumps to (4+5+6+7+88)/5 = 22, while the median moves only to 6. This is the median's strength — it holds steady while the mean chases outliers.
Median vs Mean: Which to Use?
| Situation | Better choice | Why |
|---|---|---|
| Symmetric data, no outliers | Mean | Uses every value; more precise |
| Skewed data or outliers | Median | Resists extremes |
| Incomes, house prices | Median | A few huge values would distort the mean |
| You need the total (sum) | Mean | Mean × n recovers the sum; the median cannot |
Common Mistakes
- Forgetting to sort: the median is defined by position, so unsorted data gives the wrong middle value.
- Picking one middle value for even counts: with an even number of values, the median is the average of the two center values, not one of them.
- Expecting the median to be in the data: for even-sized datasets it often is not — that is correct behavior.
- Using the median to recover totals: the median cannot be multiplied by n to get the sum the way the mean can.
Quick Answers
Is the median always between the mean and the mode? Not always, but for skewed distributions they tend to line up: in right-skewed data, mode < median < mean.
Can a dataset have more than one median? No — unlike the mode, the median is always a single value.
When do the median and mean agree? For symmetric distributions (like the normal distribution), the median and mean coincide.
The Median in Spreadsheets
You rarely need to sort by hand. In Excel or Google Sheets, =MEDIAN(A1:A20) sorts the range and returns the median in one step — handling both odd and even counts automatically. Empty cells and text are ignored, so you can point it at a raw pasted column.
Median, Quartiles, and Percentiles
The median is also the second quartile (Q2) and the 50th percentile: half the data falls below it, half above. Q1 marks the 25th percentile and Q3 the 75th; together with the minimum and maximum they form the five-number summary behind every box plot. Whenever you see a box plot, the line inside the box is the median.
Where the Median Is the Standard
- Salaries and income: reports quote median income because a few very high earners would drag the mean upward and misrepresent the typical household.
- Home prices: the "median home price" describes what a typical buyer faces; one mansion sale should not move the headline figure.
- Test scores: the median shows where the middle of the class landed, even when one or two scores are far off.
- Commute and wait times: a few terrible commutes inflate the mean; the median tells you what to plan for.
More Quick Answers
What is the median of just two numbers? Their average: the median of 5 and 8 is (5+8)/2 = 6.5.
Does a bigger dataset change the median much? Usually very little — adding values near the middle barely moves it, which is exactly why it is trusted for skewed data.
Is the median always less than the mean? No. In right-skewed data the median sits below the mean; in left-skewed data it sits above; in symmetric data they match.