Find the middle value of any data set. Enter numbers (comma, space, or newline separated). Our tool sorts them in ascending order and applies the odd/even rule to return the median. Visualize the sorted list and see the median highlighted.
The median is the middle value of a data set when it is sorted in ascending or descending order. It is a measure of central tendency that is robust to outliers, unlike the mean. For an odd number of observations, the median is the exact middle number. For an even number, it is the average of the two middle numbers. The median is widely used in income distributions, housing prices, exam scores, and many other real‑world scenarios where skewed data may distort the average.
Median =
if n is odd: x(n+1)/2
if n is even: (xn/2 + xn/2 + 1) / 2
where x(i) is the i‑th value in sorted order.
Our algorithm follows a straightforward process:
This approach ensures transparency and helps users understand exactly how the median is derived.
Why the median is a robust statistic: The median has a 50% breakdown point, meaning that you must change more than half of the data values to make the median arbitrarily large or small. This makes it invaluable in fields like finance and environmental science, where extreme outliers (e.g., billionaire incomes or sensor glitches) would otherwise dominate the mean.
A company has 9 employees with salaries (in thousands): 35, 42, 48, 50, 52, 55, 60, 75, 120. The mean is heavily skewed by the 120k outlier, giving an inflated sense of average pay. The median, however, is the 5th value: 52. This gives a more accurate picture of the typical salary. Our calculator instantly provides this result, along with the sorted list and position details, empowering HR and employees to understand compensation fairness.
A teacher has 20 test scores. After sorting, the 10th and 11th values are 78 and 82. The median is (78+82)/2 = 80. This tells the teacher that half the class scored below 80 and half above, regardless of extreme high or low scores. This is particularly useful when setting pass/fail thresholds or curved grading boundaries.
An IoT weather station records temperature every minute. Over an hour, it logs 60 values. One reading is corrupted (e.g., 50°C instead of 22°C). The median of the 60 readings remains stable and close to the true average, while the mean would be noticeably biased. This is the principle behind the "median filter" widely used in embedded signal processing.