Audited 27 Jul 2026·Last updated 27 Jul 2026·5 citations·Tier 1·0 uses

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

Comma-separated numbers, in any order — the calculator sorts them for you before finding the median.
Median
77.5
The middle value of the sorted dataset. When the count is even, this is the average of the two central values.
Count (n)
8
Median position (rank)
4.5
Lower middle value
75
Upper middle value
80

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.

  1. 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.
  2. 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.
  3. Read the median at the top of the results. This is your answer for 'what is the median of this dataset?'
  4. 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.
  5. 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.
  6. 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.

median = x₍ₙ⁄₂₎ + x₍ₙ⁄₂₊₁₎ ⁄ 2 (n even)

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.

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.

values68, 72, 75, 75, 80, 85, 90, 92

Frequently asked questions.

How do you find the median when there is an even number of values?
Sort the data, find the two values sitting at positions n/2 and n/2 + 1 (using 1-indexed counting), and average them. For example, with 8 sorted values 68, 72, 75, 75, 80, 85, 90, 92, the two central positions are the 4th value (75) and the 5th value (80), so the median is (75 + 80) / 2 = 77.5. This is the single most common mistake in manual median calculations — picking one of the two central values instead of averaging them, or miscounting which two positions are actually central once the dataset grows past a handful of values. This calculator removes the ambiguity by reporting both middle values by name.
How do you find the median when there is an odd number of values?
Sort the data and pick the single value sitting at position (n+1)/2. For example, with 5 sorted values 4, 8, 15, 16, 23, (n+1)/2 = 3, so the median is the 3rd value, 15. No averaging is needed because a single observation sits exactly at the centre — two values fall below it and two fall above it.
What is the difference between median and mean?
The mean is the arithmetic average — sum every value and divide by the count. The median is the middle value once the data is sorted. The mean uses the magnitude of every value, so a single very large or very small observation can shift it substantially. The median uses only rank, so it is essentially immune to outliers: replacing the largest value in a dataset with an arbitrarily larger number does not move the median by a single position. This is exactly why median household income, not mean household income, is the standard figure reported by government statistical agencies — a small number of very high earners inflate the mean without changing what a typical household actually earns.
Why does the U.S. Census Bureau report median income instead of mean income?
Because household income is heavily right-skewed: a relatively small number of very high earners pull the mean well above the income that most households actually experience, while the median — which only depends on where the middle household sits, not on how far above it the highest earners are — stays representative of the typical case. Reporting a mean in a right-skewed distribution systematically overstates what 'typical' looks like; the median is the more honest summary of central tendency whenever a distribution has a long tail in either direction.
Does the median calculator handle duplicate (tied) values correctly?
Yes. The median depends only on rank position in the sorted list, so repeated values are treated exactly like any other value — they simply occupy consecutive positions in the sort order. If a tie happens to land on one or both of the two central positions in an even-count dataset, the calculator still averages whatever values occupy those two positions, even if they are equal to each other (in which case the median exactly equals the repeated value).
Can the median be a value that doesn't actually appear in the dataset?
Yes, whenever the count is even and the two central values differ. For example, the dataset 1, 2, 3, 4 has a median of (2+3)/2 = 2.5, a value that never appears in the original list. This is expected and correct — the median is defined by the averaging rule for even counts, not by requiring the result to be one of the original observations. When the count is odd, by contrast, the median is always exactly one of the original data values, since no averaging occurs.
How is this different from the mean/median/mode calculator on Quanta?
The mean/median/mode calculator reports all three classical measures of central tendency (plus range) as one bundled summary, with the median as a single number and the odd/even rule explained only in prose. This calculator is built for the standalone question 'what is the median of my data' and makes the position math a first-class result: it reports the exact rank position (n+1)/2, and, for even-count datasets, both of the two middle values that were averaged, by name. If you want the full bundle of mean, median, mode, and range in one place, use the other calculator; if you specifically want the median with its arithmetic shown, this page is built for that.
What is the relationship between the median and percentiles or quartiles?
The median is exactly the 50th percentile and exactly the second quartile (Q2) — it is the special case of both ideas at the midpoint of the data. The Quanta percentile calculator generalises this same order-statistics idea to any percentile you choose (the 90th, the 10th, and so on), and the quartile calculator reports the 25th, 50th, and 75th percentiles together (Q1, Q2, Q3). If you only ever need the middle value, this dedicated median calculator is the fastest tool for that; if you need other ranks too, move to the percentile or quartile calculators.
Does the order I enter my numbers in matter?
No. You can paste your values in any order — ascending, descending, or completely scrambled — and the calculator sorts them internally before computing the median, the rank position, and the two middle values. The only thing that matters is that every value you intend to include actually appears in the comma-separated list, which is why the calculator echoes back the parsed count (n) so you can double-check nothing was dropped or merged.
What happens if I enter only one value?
The median of a single value is that value itself — with n = 1, the position formula (n+1)/2 = 1, and the single value occupies that position with no averaging required. This is a valid, well-defined (if trivial) edge case, and the calculator returns it directly rather than treating it as an error.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon