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.
Statistical Summary
Median, mean, mode, quartiles, and range for your dataset
5-Number Summary & Box Plot
Min → Q1 → Median → Q3 → Max distribution
Step-by-Step Solution
How the median is calculated from your data
Step 1: Sort the values in ascending order
n = 10 values
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
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̃ (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.
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