Median Calculator

Free median calculator. Enter any numbers to find the median, mean, mode, quartiles (Q1, Q3), IQR, and outliers instantly. Shows step-by-step solution for both odd and even datasets with a visual box plot. Essential for statistics, data analysis, and math homework.

Supports commas, spaces, tabs, or new lines. Paste from spreadsheets works too.

10 values parsed
Median
5.0000
10 values
Sum: 52
(5 + 5) ÷ 2

Statistical Summary

Median, mean, mode, quartiles, and range for your dataset

Median
Middle value
5
Mean
Arithmetic avg
5.2
Mode
2× each
2, 5…
Q1
25th percentile
3
Q3
75th percentile
8
IQR
Q3 − Q1
5
Min
2
Max
9
Range
7
Count
10
10 values, sorted ascending
2234556889
Median

5-Number Summary & Box Plot

Min → Q1 → Median → Q3 → Max distribution

Min
2
Q1
3
Median
5
Q3
8
Max
9
IQR = 5 (the middle 50% of your data spans 5 units)

Step-by-Step Solution

How the median is calculated from your data

Step 1: Sort the values in ascending order

n = 10 values

2234556889

Step 2: Find the middle positions

n = 10 (even) → average positions 5 and 6

Position 5 = 5 and position 6 = 5

Step 3: Calculate the median

Median = (5 + 5) ÷ 2 = 5

Average the two middle values: (5 + 5) ÷ 2 = 5

Median vs Mean comparison

Median
5
Not affected by outliers
Mean
5.2000
No significant skew

What Is the Median?

The middle value of a sorted dataset

The median is the middle value in a dataset when the values are sorted in ascending or descending order. Half of the values fall below the median and half fall above it. Unlike the mean, the median is not pulled by extreme values (outliers), making it the preferred measure of central tendency for skewed data.

Odd number of values

2, 5, 7, 9, 12

Median = 7 (position 3 of 5)

Even number of values

2, 5, 7, 9, 12, 15

Median = (7 + 9) ÷ 2 = 8

The median is also the 50th percentile — exactly half the data lies below it. Its symbol is M or (x-tilde). It is one of three key measures of central tendency alongside the mean and the mode.

Median vs Mean — When to Use Which

Choosing the right measure of central tendency

The median and mean both describe the center of a dataset, but they respond very differently to extreme values. Knowing when to use each prevents misleading analysis.

Use Median when:

  • Data has outliers (e.g., billionaires in income data)
  • Distribution is skewed (e.g., housing prices)
  • Reporting "typical" values to the public
  • Ordinal data (e.g., satisfaction ratings)
  • You want a 50/50 split of the data

Use Mean when:

  • Data is symmetric (bell-shaped distribution)
  • No significant outliers present
  • You need further statistical calculations (SD, variance)
  • Continuous numerical data
  • Aggregating totals (e.g., average class test score)

Classic example — Salaries:

{$40K, $45K, $48K, $52K, $55K, $2,000K}

Mean = $373K (distorted by the CEO's salary). Median = $50K (represents the typical employee). The median is the right tool here.

Quartiles, IQR & Outlier Detection

The 5-number summary and how to find outliers

Quartiles split sorted data into four equal parts. Together with the minimum and maximum, they form the 5-number summary used in box plots.

MinThe smallest value in the dataset.
Q1The 25th percentile — the median of the lower half. 25% of data falls below Q1.
Q2The median — 50% of data falls below this value.
Q3The 75th percentile — the median of the upper half. 75% of data falls below Q3.
MaxThe largest value in the dataset.

IQR = Q3 − Q1

The interquartile range is the spread of the middle 50% of data. It is resistant to outliers.

Tukey Fence Method (outlier detection):

Lower fence = Q1 − 1.5 × IQR

Upper fence = Q3 + 1.5 × IQR

Any value below the lower fence or above the upper fence is considered a potential outlier. This is the same method used in standard box-and-whisker plots.

Finding the Median in Excel & Google Sheets

Built-in formulas for median, quartiles, and percentiles

Both Excel and Google Sheets have native functions for the median and related statistics. If your data is in cells A1 through A20:

Median & Quartiles

  • =MEDIAN(A1:A20)
  • =QUARTILE(A1:A20, 1) ← Q1
  • =QUARTILE(A1:A20, 3) ← Q3
  • =QUARTILE.EXC(A1:A20, 1)

Percentiles & IQR

  • =PERCENTILE(A1:A20, 0.5)
  • =PERCENTILE.EXC(A1:A20, 0.25)
  • =IQR: Q3−Q1 manually
  • =MEDIAN(IF(A1:A20<>"",A1:A20))

Note that QUARTILE and QUARTILE.EXC use slightly different interpolation methods. QUARTILE.EXC matches the exclusive method used by this calculator, which excludes the median from both halves when the count is odd.

Frequently Asked Questions

Common questions about median, quartiles, IQR, and when to use median vs mean