What Is the Median?
The median is the middle value of a data set when all the numbers are arranged in order from smallest to largest. Unlike the mean (average), the median is not pulled around by extreme outliers, which makes it a robust measure of the center for skewed data such as incomes, house prices, or response times.
How to Use This Calculator
Type your numbers into the box separated by commas or spaces (for example 3, 7, 1, 9, 4). The calculator sorts them automatically and returns the median, the number of values entered, and the two middle values it used. Decimals and negative numbers are fully supported.
The Formula Explained
First sort the list. If there is an odd number of values (\(n\)), the median is the single value at position \((n+1)/2\). If there is an even number of values, there is no single middle value, so the median is the mean of the two central values at positions \(n/2\) and \(n/2+1\).
$$\text{Median} = \begin{cases} x_{\frac{n+1}{2}} & n \text{ odd} \\[0.6em] \dfrac{x_{\frac{n}{2}} + x_{\frac{n}{2}+1}}{2} & n \text{ even} \end{cases} \quad\text{where } x = \text{sort}\!\left(\text{Numbers}\right)$$
Worked Example
Take the list 3, 7, 1, 9, 4. Sorted it becomes 1, 3, 4, 7, 9. There are 5 values (odd), so the median is the 3rd value: 4. Now take 2, 4, 6, 8. There are 4 values (even), so the median is the average of the two middle values 4 and 6, giving \((4 + 6) / 2 =\) 5.
FAQ
How is the median different from the mean? The mean adds all values and divides by the count, so it is sensitive to outliers. The median only depends on the rank order, so a single huge or tiny value barely moves it.
What if my list has an even number of values? The calculator averages the two middle numbers, which can produce a value not present in your original list (for example a median of 5 from the set 2, 4, 6, 8).
Does the order I enter numbers matter? No. The calculator sorts the values for you before finding the middle, so any input order gives the same median.