Median Calculator
Find the median (middle value) of any dataset. Shows sorted data and exactly how the median is determined.
Results
How to Find the Median
The median is the middle value of a dataset when sorted in order. It divides the data exactly in half: 50% of values fall below the median, 50% above. Because it only depends on the middle position (not the actual values of other data points), it resists the distortion caused by extreme outliers.
Odd vs Even Count
For an odd number of values: the median is the value at position (n+1)/2 in the sorted list. For an even number: average the values at positions n/2 and n/2+1. Example: [1, 2, 3, 4] → median = (2+3)/2 = 2.5.
Real-World Uses
Home prices, salaries, and response times are almost always reported as medians. A neighborhood with one $10M mansion and nine $200K houses has a mean home price of $1.18M — wildly unrepresentative. The median ($200K) correctly describes what a typical buyer pays.
Worked Example
Find the median of: 14, 7, 21, 3, 18, 10, 5. Step 1: Sort → 3, 5, 7, 10, 14, 18, 21. Step 2: n=7 (odd), middle position = (7+1)/2 = 4. Step 3: The 4th value is 10. Median = 10.
Now find the median of: 4, 9, 15, 2, 11, 7. Step 1: Sort → 2, 4, 7, 9, 11, 15. Step 2: n=6 (even), middle positions = 3 and 4. Step 3: Average the 3rd and 4th values = (7+9)/2 = 8. Median = 8.
Comparing Mean and Median
| Data Type | Mean | Median | Better Measure |
|---|---|---|---|
| Normal exam scores: 70,75,80,82,85 | 78.4 | 80 | Either (similar) |
| Salaries with CEO: $40k,$45k,$50k,$500k | $158.75k | $47.5k | Median |
| Heights: 160,162,165,168,170 cm | 165 cm | 165 cm | Either |
| Response times with error: 1,2,2,3,600ms | 121.6ms | 2ms | Median |
Frequently Asked Questions
The median is the middle value when data is sorted. For odd n, it's the middle element. For even n, it's the average of the two middle elements. Exactly half the data lies below and half above the median.
The mean uses all values equally (sum ÷ count). The median only uses the position of values, ignoring how extreme they are. One billionaire in a sample of 1000 people raises the mean income enormously but barely moves the median.
For an even-count dataset, you average the two middle values to get one median. Some textbooks call these the "lower median" and "upper median," but typically a single value is reported.
The median is the best measure of central tendency for skewed distributions or data with outliers. It's the foundation of box plots, the interquartile range, and non-parametric statistical tests.
For a continuous distribution, the median is the value m where exactly half the probability lies on each side: P(X ≤ m) = 0.5. For a normal distribution, the median equals the mean. For a skewed distribution like exponential, the median is ln(2)/λ — less than the mean, which is pulled higher by the long tail.
Add a cumulative frequency column. The median is in the class where the cumulative frequency first reaches or exceeds n/2 (half the total count). Then interpolate: Median = L + ((n/2 − CF)/f) × h, where L is the lower class boundary, CF is the cumulative frequency before that class, f is the class frequency, and h is the class width.