Math & Science

Median Calculator

Paste a list of numbers and get the whole five-number summary, not just the median.

Written and maintained by the MarsCalc Hub editorial team Formula checked against standard statistical definitions (Tukey quartiles) Updated

Separate with commas, spaces or new lines. Up to 10,000 values.

About the Median Calculator

Paste a list of numbers and this tool returns the whole five-number summary, not just the median. You get the mean, median, mode, range, quartiles, interquartile range and standard deviation in one pass — which is usually what a statistics question actually wants.

Numbers can be separated by commas, spaces, tabs or new lines. Paste a column straight out of a spreadsheet and it will parse. Anything that is not a number gets ignored rather than breaking the calculation.

Quartiles use the exclusive (Tukey) method, which excludes the median itself when splitting the data in half. That is the version taught in most statistics courses and the one used for box plots. Other methods exist and give slightly different quartiles — the page explains where they differ.

How to use the Median Calculator

  1. Paste or type your numbers, separated however you like.
  2. Select Calculate.
  3. The median is the headline; mean, mode and range sit underneath.
  4. Quartiles and IQR use the exclusive (Tukey) method taught in most stats courses.
  5. Both population and sample standard deviation are given — check which your course wants.

How to find the median

Sort the numbers from smallest to largest, then take the middle one. With an even count there are two middle values, so average them.

Odd count  : median = the middle value

Even count : median = (the two middle values) ÷ 2

Sorting first is not optional — the median of an unsorted list is meaningless.

Worked example

Data: 7, 3, 9, 4, 12, 3, 8.

Sorted: 3, 3, 4, 7, 8, 9, 12. Seven values, so the fourth is the middle.

Median 7 — mean 6.57 — mode 3 — range 9

Add a 100 to that list and the mean jumps to 18.25, while the median only moves to 7.5. That resistance to outliers is the median's whole point.

Mean, median, mode and range calculator: the four compared

What it isAffected by outliersBest for
MeanSum ÷ countStronglySymmetric data with no extremes
MedianMiddle value when sortedBarelySkewed data — incomes, house prices
ModeMost frequent valueNoCategories and repeated values

This is why house prices and salaries are almost always reported as medians. A handful of very large values pulls the mean upward and makes it describe nobody. The median stays with the typical case.

Quartiles and the interquartile range calculator

Quartiles cut sorted data into four equal parts. Q1 is the median of the lower half, Q2 is the median itself, and Q3 is the median of the upper half. The interquartile range is simply Q3 − Q1 — the spread of the middle 50% of your data.

IQR = Q3 − Q1

Outlier fences: below Q1 − 1.5×IQR, or above Q3 + 1.5×IQR

With an odd number of values, the exclusive method used here leaves the median out of both halves when finding Q1 and Q3. The inclusive method keeps it in. Both are legitimate and they disagree slightly. Spreadsheets offer both — Excel's QUARTILE.EXC matches this tool, QUARTILE.INC does not. Check which one your course expects.

Population or sample standard deviation

The difference is the denominator, and it matters more than it looks.

  • Population (divide by n) — use it when your numbers are the whole group you care about. Every student in one class, every reading you took.
  • Sample (divide by n − 1) — use it when your numbers are a sample drawn from a larger group you want to describe.

Dividing by n − 1 is called Bessel's correction. A sample tends to underestimate the spread of the population it came from, so shrinking the denominator nudges the estimate up. With large datasets the two answers converge; with small ones the gap is real.

Reading the five-number summary

Minimum, Q1, median, Q3 and maximum together describe a distribution better than any single figure. A few patterns worth recognising:

  • Median near the middle of Q1 and Q3 — roughly symmetric data.
  • Median close to Q1 — right-skewed, with a long tail of high values.
  • Mean well above the median — the same signal, confirmed.
  • A very wide range but a narrow IQR — a tight core with a few extreme outliers.

For a plain average of grades rather than a full summary, the average grade calculator is more direct.

How to find the median of a data set

  1. Sort the numbers from smallest to largest.
  2. If the count is odd, the median is the middle number.
  3. If the count is even, take the two middle numbers and average them.
  • Odd: 3, 7, 8, 12, 20 → median is 8.
  • Even: 3, 7, 8, 12, 20, 25 → (8 + 12) ÷ 2 = 10.

The median of just two numbers is simply their average.

Median from a frequency table

When data comes as a table of values and counts, find the middle position first.

Goals scoredMatchesRunning total
044
1711
2516
3319

There are 19 values, so the median is the 10th. The running total passes 10 in the "1" row. The median is 1 goal.

Mean absolute deviation

Mean absolute deviation (MAD) shows how far values sit from the mean, on average.

  1. Find the mean.
  2. Find how far each value is from the mean, ignoring minus signs.
  3. Average those distances.

For 2, 4, 6, 8: mean = 5. Distances: 3, 1, 1, 3. MAD = 8 ÷ 4 = 2. It is simpler than standard deviation and easier to explain.

How to find the first quartile

Sort the data, find the median, then take the median of the lower half. That is the first quartile (Q1). The median of the upper half is the upper quartile (Q3).

For 3, 5, 7, 8, 10, 12, 15, 18: the median is 9, the lower half is 3, 5, 7, 8 so Q1 = 6, and the upper half is 10, 12, 15, 18 so Q3 = 13.5. The interquartile range is 13.5 − 6 = 7.5. Different textbooks use slightly different quartile methods, so answers can differ by a little.

Just need a median finder or the average? Paste the numbers above. For a step-by-step guide to averages, see how to find the average of numbers.

Other ways to use this calculator

Paste a list once and get every common statistic.

  • Mean, median, mode and range calculator — all four appear together with quartiles.
  • Mean and median calculator — useful for comparing the typical value with the average.
  • Find the median calculator — works for odd and even counts automatically.
  • Average calculator — the mean shows alongside the median.
  • Quartile calculator — Q1, Q3 and the interquartile range are part of the result.
  • How to find median for even numbers — average the two middle values.
  • Median from frequency table — see the frequency table section above.
  • Mean median mode range calculator — all four appear together in the result.

Related guides

Frequently asked questions

The median is the middle value once the numbers are sorted; the mean is the total divided by how many there are. They differ because the mean counts every value's size while the median only counts its position. For 3, 3, 4, 7, 8, 9, 12 the median is 7 and the mean is 6.57. Add one value of 100 and the mean leaps to 18.25 while the median barely moves to 7.5.

Take the average of the two middle values. For 4, 8, 11, 15 the two middle numbers are 8 and 11, so the median is (8 + 11) ÷ 2 = 9.5. The median does not have to be one of your data points, and with an even count it usually is not. Sort the list first — the median of an unsorted list is meaningless.

The interquartile range is Q3 minus Q1 — the spread of the middle 50% of your data. Because it ignores the top and bottom quarters, it describes spread without being distorted by outliers, which is why box plots use it. It also defines the standard outlier test: anything below Q1 − 1.5×IQR or above Q3 + 1.5×IQR is flagged as an outlier.

Use population (divide by n) when your numbers are the entire group you care about. Use sample (divide by n − 1) when they are a sample representing something larger. The n − 1 adjustment is Bessel's correction: samples tend to understate the true spread, so the smaller denominator corrects upward. For most coursework and real studies, sample is the right choice.

Sort the values, take the two in the middle and average them. For 3, 7, 8, 12, 20 and 25, the middle pair is 8 and 12, so the median is 10.

Sources and further reading

  1. NIST/SEMATECH e-Handbook of Statistical Methods — definitions of median, quartiles and standard deviation
  2. NIST — Exploratory data analysis and the five-number summary — box plots and the 1.5×IQR outlier rule
  3. Median — Encyclopaedia Britannica — background on measures of central tendency