Odd count
Let n be the number of observations and x(1) ≤ … ≤ x(n) the sorted sample. If n is odd, the median is x((n+1)/2) — the term whose index is the middle position.
Even count
If n is even, there is no single middle index. The usual sample median is (x(n/2) + x(n/2+1)) / 2. Some texts pick one of the two values for an integer median; this calculator uses the average, which is the common statistics convention.
Quartiles and IQR
Q1 and Q3 are the 25th and 75th percentiles of the same sorted list (linear interpolation between ranks). The interquartile range is IQR = Q3 − Q1. It measures the spread of the middle half and is the yardstick for the outlier fence on the calculator.
Grouped data
A frequency table with class intervals needs an interpolated median inside the median class. This tool expects a raw list, not binned counts. Expand the bins to individual values if you need that estimate here.
FAQ
Is the median unique?
For an odd count, yes — it is one of the sample values. For an even count the average of the two centre values may not appear in the list.
Population versus sample?
For a finite list you already have every value. There is no separate “population median” formula on this page.
Type a problem on the calculator — it runs in this browser and nothing is uploaded.
Open the calculator — Median Calculator