Median Calculator
Enter any list of numbers to find the median, mean, mode, and full descriptive statistics instantly.
📖 What is the Median?
The median is the middle value of a dataset when all values are arranged in ascending or descending order. It is one of the three primary measures of central tendency in statistics, alongside the mean (arithmetic average) and the mode (most frequent value). Unlike the mean, the median is not calculated from all values - it is a positional measure that identifies the exact center of the ordered dataset.
To find the median, you first sort the data. For an odd number of values, the median is the single middle value. For an even number of values, the median is the average of the two middle values. For example, in the dataset {3, 7, 9, 12, 15} (n = 5, odd), the median is 9 - the third value. In {4, 8, 15, 16} (n = 4, even), the median is (8 + 15) / 2 = 11.5.
The median's most important property is its robustness to outliers. Consider household incomes in a neighborhood: if one billionaire moves in, the mean income rises dramatically, but the median barely changes. This is why economists, governments, and researchers consistently prefer the median when reporting income, house prices, wealth, and other distributions that tend to be right-skewed. When data is skewed, the median gives a far more representative picture of the "typical" value than the mean.
The median also has a clear probabilistic interpretation: it is the value such that 50% of the data falls below it and 50% falls above it. This makes it equivalent to the 50th percentile (second quartile, Q2). In a perfectly symmetric distribution such as the normal bell curve, the median equals the mean and the mode. In right-skewed distributions (common in income and price data), the median is less than the mean; in left-skewed distributions, the median is greater than the mean. This relationship between mean and median is used as a quick diagnostic for skewness in a dataset.
📐 Formula
Where:
- x = the dataset sorted in ascending order
- n = the total count of values
- xk = the value at position k in the sorted list (1-indexed)
Worked example (odd n): Dataset = {9, 3, 15, 7, 12}. Step 1: Sort → {3, 7, 9, 12, 15}. Step 2: n = 5 (odd), so median position = (5+1)/2 = 3. Step 3: The value at position 3 is 9. Median = 9.
Worked example (even n): Dataset = {42, 23, 16, 4, 8, 15}. Step 1: Sort → {4, 8, 15, 16, 23, 42}. Step 2: n = 6 (even), so take positions n/2 = 3 and n/2+1 = 4. Step 3: Values at positions 3 and 4 are 15 and 16. Step 4: Median = (15 + 16) / 2 = 15.5.
✍ How to Use This Calculator
- Enter your numbers - type your dataset into the text area, separated by commas or spaces (e.g.
4, 8, 15, 16, 23, 42). Negative numbers and decimals are fully supported. - Click Calculate - the calculator instantly computes the median, mean, mode, count (n), minimum, and maximum for your dataset.
- Review the sorted list - the sorted dataset is displayed below the results with the median value(s) highlighted in blue so you can visually confirm which value(s) define the center.
- Try an example - click any "Try this example" link in the Examples section below to pre-fill the calculator with a worked dataset and instantly see the results.