Median Calculator
Result
Median
- Lower of the two middle values
- 4.0000
- Upper of the two middle values
- 5.0000
- Count
- 8
The median is the value that sits in the middle once the list is sorted, so half of the numbers fall below it and half above. It is the one summary of a data set that a single extreme reading cannot move: make the largest value ten times bigger and the median stays exactly where it was. Paste the numbers — one per line, or separated by semicolons, commas or spaces — and this median calculator sorts them, returns the middle value, and shows the two middle values it averaged whenever the count is even. Nothing here is divided by n − 1 or by n, so there is no sample-or-population switch to set.
Formula
Median = the middle value of the sorted list; with an even count, the average of the two middle values
- xᵢ
- One value in the data set. Only its position in the sorted list matters — how far it sits from the other values never enters the calculation, which is precisely why an extreme reading leaves the answer alone
- n
- How many values the list holds, up to 200 here. An odd count gives one middle value; an even count gives two, and their average is the median
- Y₍ₖ₎
- The k-th value once the list has been sorted from smallest to largest. NIST writes the even case as (Y(N/2) + Y(N/2+1)) / 2, which is the same pair of observations this page prints underneath the answer
- Y₍ₙ/₂₎ and Y₍ₙ/₂₊₁₎
- The two middle values. They are printed so the division can be checked by eye, and for an odd count they are the same number twice — there really is only one value in the middle
- M
- The median. It carries the original units of the data, and adding the same constant to every value shifts it by that constant and nothing else
Reach for the median whenever one reading could be wildly off and you still want a typical value: house prices, incomes, waiting times, anything with a long tail. Because it counts positions rather than sizes, the largest number in the list could be enormous and the median would not budge, and that resilience is the whole reason it exists next to the mean. It is also the natural centre for ordered labels — a rating scale, a size grade — where the gap between two neighbouring categories has no meaning and cannot be averaged. Two things it will not tell you: anything about the spread, and anything about the values away from the middle. Pair it with the quartiles when the shape of the data matters, and note that on a symmetric data set the median and the mean land almost on top of each other, so a visible gap between them is itself a reading about skew.
Worked examples
An even count: the two middle values are 4 and 5
- Sort: 2, 4, 4, 4, 5, 5, 7, 9
- Count: 8 values, so there is no single middle one — the middle pair is the 4th and the 5th
- The 4th value is 4 and the 5th is 5
- Median: (4 + 5) ÷ 2 = 4.5
4.5 is not one of the numbers in the list, and that is normal for an even count. The panel prints 4 and 5 beside it for exactly this reason: without them there is no way to tell whether the tool averaged the right pair, or whether it quietly picked one of them.
An odd count, with one value far away from the rest
- Sort: 3, 7, 9, 12, 40
- Count: 5 values, so the middle one is the 3rd
- Median: 9 — with no division, because there is only one value in the middle
The mean of these five numbers is 14.2, dragged up by the 40; the median is 9 and does not care. Replace 40 with 4000 and the mean becomes 806.2 while the median is still 9. This is the whole argument for reporting a median on skewed data, and it costs nothing to compute.
Four values, where the middle is not a value at all
- Sort: 1, 2, 3, 4
- The middle pair is the 2nd and 3rd values: 2 and 3
- Median: (2 + 3) ÷ 2 = 2.5
Two other conventions exist for this case — take the lower of the pair (2) or take the upper one (3) — and all three appear in textbooks. This page takes the average, as NIST and the GB/T vocabulary standard both do. It is the same rule the quartile and percentile pages follow, which is why 2.5 here is also the second quartile there.
Limitations
The median is a single position, so it throws away almost everything else about the data. Two lists can share a median and look nothing alike — one tightly clustered around it, one spread from end to end — which is why a median is usually reported together with the quartiles rather than alone. It needs the list sorted, which means every value has to be read before the answer exists. It says nothing about the values themselves: a median of 9 tells you a 9-ish number sits in the middle, not that 9 appears anywhere. For ordered labels such as sizes or ratings the arithmetic still works, but the answer is the middle label rather than a number you can add up. The list is capped at 200 values. A token like 1,500 is refused rather than guessed at, because a comma between digits means a decimal point in much of the world and a thousands separator elsewhere — write 1500 or 1.5. Every separator rule is the same in every language here: the numbers are read exactly as typed.
Frequently asked questions
- How do I find the median of a list of numbers?
- Sort the numbers from smallest to largest and count them. An odd count has one value in the middle — with seven numbers it is the fourth. An even count has two, and the median is their average: for 1, 2, 3, 4 the middle pair is 2 and 3, so the median is 2.5. That is the whole method. The panel above prints the count, the two middle values and the answer, so each step can be checked without sorting anything again.
- Why is the median sometimes a number that is not in my list?
- Because an even count has no single middle value, so the median is the average of the two that flank the centre. 4.5 above is not one of the eight numbers, yet it is the correct answer — half the values are below it and half above. The two middle values are printed next to the result exactly so this does not look like a mistake.
- When should I use the median instead of the mean?
- When a single extreme reading could distort the picture — incomes, house prices, waiting times, anything with a long tail on one side. The mean adds every value, so one number far from the rest pulls it; the median only counts how many values sit on each side, so that same number changes nothing. On a symmetric set the two answers nearly coincide, so a gap between them is itself a clue that the data is skewed.
- Can I paste a column straight out of a spreadsheet?
- Yes. Newlines, tabs, semicolons, spaces and a comma followed by a space all separate values, so a pasted column or a line typed with semicolons both work, and empty segments are skipped rather than rejected. Up to 200 values are read. One shape is refused on purpose: a token like 1,500 or 1.500, where three digits follow the separator — that is a thousands separator in some countries and a decimal point in others, so write 1500 or 1.5 instead.
- Does the median have a sample version and a population version?
- No, and there is no switch for it on this page. The n − 1 correction belongs to the measures of spread, which divide a sum of squared deviations by a count; the median divides nothing, it takes a position. Whether your list is a sample or the whole group, the middle value is the middle value. The pages that do need that choice are the standard deviation and variance ones, and there the divisor genuinely changes the answer.
- Why does the same list give a different median in another tool?
- Almost always the even-count rule. Three conventions are in circulation: average the two middle values, take the lower one, or take the upper one. For 1, 2, 3, 4 those give 2.5, 2 and 3. This page averages, following the definition NIST gives and the GB/T vocabulary standard, and the two middle values are printed so you can see which pair was used. A second, rarer cause is a value typed with a decimal comma that the other tool read as a separator.
References
- Measures of Location — e-Handbook of Statistical Methods, section 1.3.5.1 — National Institute of Standards and Technology (NIST)
- Measures of the Center of the Data — Introductory Statistics 2e, section 2.5 — OpenStax, Rice University
- GB/T 3358.1-2009, Statistics — Vocabulary and symbols, Part 1 (the Chinese national vocabulary standard covering the median and the other measures of location; the record page notes that no online full text is offered) — State Administration for Market Regulation, China