Median Calculator
Free median calculator: paste a dataset and get the median, the exact rank position, and both middle values shown step by step for odd or even counts.
Median Calculator
Background.
The Quanta median calculator takes any list of numbers — exam scores, house prices, commute times, response times, anything you can paste as a comma-separated line — and returns the median together with the exact rank position and, when the count is even, the two middle values that were averaged to produce it. The median is the value that sits at the very centre of a sorted dataset: half of the observations fall at or below it, and half fall at or above it. That single property is what makes the median so useful and so different from the mean. The mean is pulled around by every value in the dataset, including the extreme ones; the median only cares about rank, so a single outlier — one mansion in a street of modest homes, one billionaire in a room of a hundred people — cannot move it by more than a fraction of a position.
Finding the median by hand is simple in principle but easy to get subtly wrong, and the wrongness usually shows up at exactly the step this calculator makes explicit: what happens when the count of values is even. With an odd number of values, sorting the data and picking the middle one is unambiguous — five values sorted have a clear third value sitting exactly in the centre, with two below and two above. With an even number of values there is no single middle observation; there are two, sitting on either side of the true centre, and the median is defined as their average. Students (and more than a few spreadsheets) get this wrong by picking one of the two values instead of averaging them, or by miscounting which two positions are actually the middle ones once the list grows past a handful of entries. This calculator removes that ambiguity entirely: it reports the exact rank position of the median as a number — a whole number for an odd count, a half-integer like 4.5 or 10.5 for an even count — and it reports both middle values by name whenever there are two, so you can see precisely which numbers were averaged and verify the arithmetic yourself in seconds.
The median's resistance to outliers is not a curiosity; it is the entire reason government statistical agencies use it. The U.S. Census Bureau reports median household income, not mean household income, because income distributions have a long right tail — a small number of very high earners would drag the mean well above what a typical household actually earns, while leaving the median essentially untouched. The same logic applies to home prices (a single luxury sale can distort a neighbourhood's average price but barely nudges the median), to salary negotiations, to standardized test score reporting, and to any dataset where a handful of extreme values could otherwise mislead a reader who assumes "average" means "typical."
This calculator is deliberately narrow and deliberately explicit: it does one job — finding the median — and it shows every step of that job, including the sort, the rank position, and (for even counts) both of the values that got averaged. If you also want the mean, the mode, and the range of the same dataset in one summary, use the companion mean/median/mode calculator; if you want any percentile other than the 50th, or the quartiles that box plots are built from, the percentile and quartile calculators extend the same order-statistics idea to any rank you choose. Paste your numbers below, in any order, and read off the median, its rank, and the arithmetic behind it.
What is median calculator?
The median of a dataset is the value at the 50th percentile: the point that splits the sorted data exactly in half, with as many observations below it as above it. Formally, given n observations sorted into ascending order x₍₁₎ ≤ x₍₂₎ ≤ … ≤ x₍ₙ₎ (the order statistics), the median is defined by rank rather than by value. When n is odd, there is a single observation sitting exactly at the centre: the median is x₍₍ₙ₊₁₎⁄₂₎ — for example, with 7 values, the median is the 4th value once sorted. When n is even, no single observation sits at the exact centre; instead two values, x₍ₙ⁄₂₎ and x₍ₙ⁄₂₊₁₎, straddle it, and the median is defined as their arithmetic mean. This two-case definition is universal across statistics textbooks and software — R, Excel, Python's statistics.median, and every major stats package implement exactly this rule — so there is no competing convention to disclose here, unlike percentiles and quartiles where several interpolation methods exist. The median belongs to the same family as percentiles and quartiles: it is literally the 50th percentile and the second quartile (Q2). What makes it worth a dedicated tool rather than folding it into a general percentile calculator is that it is by far the most commonly requested single statistic, has this clean and unambiguous two-case definition, and deserves to have its arithmetic (the sort, the rank, and — critically — the even-count averaging step) shown explicitly rather than buried inside a more general-purpose percentile engine.
How to use this calculator.
- Paste your dataset into the box as comma-separated numbers, in any order — for example 68, 72, 75, 75, 80, 85, 90, 92. The calculator sorts the values for you, so you don't need to order them first.
- Check the count (n) shown in the results against the number of values you intended to enter. A mismatch usually means a stray character — a missing comma, a duplicated separator, a letter mixed in — confused the parser.
- Read the median at the top of the results. This is your answer for 'what is the median of this dataset?'
- Look at the position (rank) output to see whether your dataset had an odd or even count. A whole number (like 5) means a single middle value was used directly. A half-integer (like 4.5) means two values were averaged.
- If the count is even, check lowerMiddleValue and upperMiddleValue to see exactly which two numbers were averaged to produce the median — this is the step most manual calculations get wrong.
- If you also need the mean, mode, and range of the same data, use the mean/median/mode calculator. If you need any other percentile (not just the 50th) or the quartiles used to build a box plot, use the percentile or quartile calculators — they generalise the same sorted-data idea to any rank.
The formula.
Sort the n values into ascending order to get the order statistics x₍₁₎ ≤ x₍₂₎ ≤ … ≤ x₍ₙ₎. If n is odd, there is a single value exactly at the centre of that sorted list, at position (n+1)/2 (using 1-indexed counting): median = x₍₍ₙ₊₁₎⁄₂₎. For example, with n = 5, (n+1)/2 = 3, so the median is the 3rd smallest value — two values sit below it, two sit above it, and nothing needs to be averaged. If n is even, no single position sits exactly at the centre; the two candidate positions are n/2 and n/2 + 1, and the median is defined as their average: median = (x₍ₙ⁄₂₎ + x₍ₙ⁄₂₊₁₎) / 2. For example, with n = 8, the two central positions are the 4th and 5th smallest values, and the median is their mean. This calculator reports the general position formula, (n+1)/2, for both cases: when n is odd this evaluates to a whole number matching the single middle rank; when n is even it evaluates to a half-integer (such as 4.5 for n = 8) that signals two values were averaged, and the calculator surfaces exactly which two values those were as lowerMiddleValue and upperMiddleValue. Internally the calculator parses the comma-separated input, coerces every token to a number, and throws a descriptive error naming the exact token that failed to parse (so a typo like 'seven' is caught immediately rather than silently dropped or coerced to zero). It then sorts a copy of the array numerically (not lexicographically — '9' correctly sorts before '10') before computing rank position and median. No division by the count is ever performed on an empty list; at least one value is required.
A worked example.
Eight quiz scores, already listed in ascending order: 68, 72, 75, 75, 80, 85, 90, 92. Because n = 8 is even, there is no single middle score — the two candidates are the 4th and 5th smallest values. Counting from the start, the 4th value is 75 and the 5th value is 80, so lowerMiddleValue = 75 and upperMiddleValue = 80. The median is their average: (75 + 80) / 2 = 77.5. The position output confirms this: (8 + 1) / 2 = 4.5, a half-integer, signalling that two values were averaged rather than one being picked directly. Notice this dataset also has a repeated value (75 appears twice) — ties never cause a problem for the median, because it only depends on rank position, not on values being distinct. Compare this to the mean of the same eight scores, (68+72+75+75+80+85+90+92)/8 = 79.625: the mean and median are close here because the data has no extreme outlier, which is itself a useful diagnostic — when mean and median sit close together, the data is roughly symmetric, and either one is a reasonable single-number summary.
Frequently asked questions.
How do you find the median when there is an even number of values?
How do you find the median when there is an odd number of values?
What is the difference between median and mean?
Why does the U.S. Census Bureau report median income instead of mean income?
Does the median calculator handle duplicate (tied) values correctly?
Can the median be a value that doesn't actually appear in the dataset?
How is this different from the mean/median/mode calculator on Quanta?
What is the relationship between the median and percentiles or quartiles?
Does the order I enter my numbers in matter?
What happens if I enter only one value?
References& sources.
- [1]NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.1 — Measures of Location. Defines the sample mean and the median (including the odd/even split) as the two primary measures of location.
- [2]OpenStax. Introductory Statistics 2e. Rice University, 2023. §2.3, 'Measures of the Location of the Data' — covers the median alongside percentiles and quartiles as a single family of order-statistics summaries.
- [3]Casella, George and Berger, Roger L. Statistical Inference, 2nd edition. Duxbury / Cengage, 2002. Chapter 5 covers order statistics and the sample median rigorously.
- [4]U.S. Census Bureau. 'Income in the United States: 2024.' Report P60-282, September 2025 — official source reporting median (not mean) household income, cited here for the median's real-world use against skewed distributions.
- [5]Khan Academy. 'Mean, median, and mode review.' Statistics and probability — free explainer aligned to the same order-statistics definitions used above.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled