Median Calculator

Examples:

How to Find the Median

Step 1: Sort the Data

Arrange all values in ascending order.

Step 2: Find the Middle

Odd count: Median = middle value
Position: (n+1)/2
Even count: Median = average of two middle values
Positions: n/2 and (n/2)+1

What is Median?

The median is the middle value when data is sorted. It divides the dataset into two equal halves and is less affected by extreme values than the mean.

Example: 1, 3, 5, 7, 9
Median = 5

Understanding the Median

What is the Median?

The median is a measure of central tendency that represents the middle value in an ordered dataset. Unlike the mean (average), the median is resistant to outliers, making it particularly useful when data contains extreme values.

How to Find the Median

Odd Number of Values

The median is simply the middle value.

Data: 2, 5, 7, 9, 11
Position: (5+1)/2 = 3rd
Median = 7

Even Number of Values

The median is the average of the two middle values.

Data: 2, 5, 7, 9
Middle values: 5 and 7
Median = (5+7)/2 = 6

Mean vs. Median

Consider these house prices: $150K, $200K, $250K, $300K, $2M

Mean (Average)

($150K + $200K + $250K + $300K + $2M) / 5 = $580,000

Skewed by the $2M house

Median

Middle value = $250,000

Better represents typical price

Quartiles and IQR

Quartiles divide sorted data into four equal parts:

Q1
25th percentile
Lower quartile
Q2
50th percentile
Median
Q3
75th percentile
Upper quartile
IQR
Q3 - Q1
Middle 50%

When to Use Median

Income data: Median household income is more representative than mean because a few billionaires skew the average.
House prices: Real estate reports often use median to give a better picture of "typical" prices.
Response times: In software, median latency is often more useful than mean because outliers (slow requests) distort averages.

Key Insight

For symmetric distributions (like normal/bell curve), the mean and median are equal. When they differ significantly, the data is skewed—if mean > median, data is right-skewed; if mean < median, data is left-skewed.

Frequently Asked Questions

How do you find the median of an even set of numbers?

For an even count of numbers, first sort them from smallest to largest. Then find the two middle values and calculate their average. For example, in the set [2, 4, 6, 8], the two middle values are 4 and 6, so the median is (4 + 6) / 2 = 5.

Why is median better than mean for income data?

Median is preferred for income data because it's not affected by extreme values (outliers). A few billionaires can dramatically increase the mean income, making it unrepresentative of typical earnings. The median shows what the middle person actually earns, giving a more accurate picture of typical income.

What is the interquartile range (IQR)?

The IQR is the difference between the third quartile (Q3) and first quartile (Q1), representing the middle 50% of your data. It's used to measure spread and identify outliers. Values below Q1 - 1.5*IQR or above Q3 + 1.5*IQR are often considered outliers.

When are mean and median equal?

Mean and median are equal (or very close) when data is symmetrically distributed, like a perfect bell curve. When they differ significantly, the data is skewed. If mean > median, data is right-skewed (tail extends right); if mean < median, data is left-skewed.