Median Calculator
How to Find the Median of Odd and Even Number Sets
The median is a foundational measure of central tendency representing the exact 50th percentile of a numerical dataset. Fifty percent of the numbers lie below the median, and fifty percent lie above it.
To find the median, you must first sort the entire dataset in ascending order from lowest to highest: x₁ ≤ x₂ ≤ ... ≤ xₙ.
Case 1: Odd Count of Values (n is odd). The median is the single middle element located at index (n + 1) ÷ 2. For instance, in the sorted five-item list [10, 11, 13, 15, 16], the median is the 3rd value: 13.
Case 2: Even Count of Values (n is even). There is no single center item. Instead, take the two middle elements at positions n ÷ 2 and (n ÷ 2) + 1, and calculate their arithmetic mean: (mid₁ + mid₂) ÷ 2. For instance, in [2, 3, 5, 12], the middle elements are 3 and 5, producing a median of (3 + 5) ÷ 2 = 4.
Unlike the arithmetic mean, the median is a robust statistic: extreme outliers (such as an ultra-luxury mansion in a modest neighborhood) do not distort the median.
Worked Real Estate Example (Outlier Resistance)
Worked Example: Real Estate Neighborhood Sale Prices
Six homes in a suburban neighborhood sell for the following prices: $320,000, $345,000, $310,000, $360,000, $330,000, and an expansive multi-acre estate for $2,800,000. What is the median home price?
- Sort all sale prices in ascending order: [$310,000, $320,000, $330,000, $345,000, $360,000, $2,800,000].
- Count the number of sales: n = 6 (even count).
- Identify the two middle elements at positions 6/2 = 3rd and 4th: $330,000 and $345,000.
- Calculate their arithmetic average: ($330,000 + $345,000) ÷ 2 = $675,000 ÷ 2 = $337,500.
- Notice the contrast: The arithmetic mean is $744,167 (distorted by the $2.8M estate), whereas the median of $337,500 accurately captures typical home values.
The median home sale price is $337,500.00, providing an accurate, outlier-resistant benchmark.
Odd vs. Even Median Sample Calculations Table
Observe how the median identifies the single central item for odd sample sizes, and averages the two middle values for even sizes.
| Dataset Elements | Sorted Dataset | Count Type | Middle Position(s) | Median Value |
|---|---|---|---|---|
| 7, 1, 9 | 1, 7, 9 | Odd (n=3) | 2nd position (7) | 7.00 |
| 10, 4, 2, 8 | 2, 4, 8, 10 | Even (n=4) | 2nd & 3rd (4, 8) | 6.00 |
| 15, 20, 25, 30, 35 | 15, 20, 25, 30, 35 | Odd (n=5) | 3rd position (25) | 25.00 |
| 1, 2, 3, 4, 5, 6 | 1, 2, 3, 4, 5, 6 | Even (n=6) | 3rd & 4th (3, 4) | 3.50 |
| -5, 10, 0, -10, 5 | -10, -5, 0, 5, 10 | Odd (n=5) | 3rd position (0) | 0.00 |
| 10, 20, 30, 1000 | 10, 20, 30, 1000 | Even (n=4) | 2nd & 3rd (20, 30) | 25.00 |
Common Median Mistakes to Avoid
- Forgetting to sort the numbers before picking the middle value: In [12, 3, 5, 2], picking 3 or 5 without sorting yields incorrect results. Always sort ascending first: [2, 3, 5, 12].
- Picking only one middle value for even counts: For an even number of values, you must average the two center numbers.
- Confusing median with mean: The mean is the total sum divided by count; the median is the midpoint rank.
- Ignoring duplicates: If a dataset is [4, 4, 4, 9, 10], keep all three 4s in the ordered list.
Suggested Tools & Learning Resources
Independent, reputable tools to accelerate your mathematical problem solving and study.
Google Sheets
Cloud spreadsheet platform with built-in financial, statistical, and percentage calculation functions.
RStudio (Posit)
Premier integrated development environment for the R language, specialized in statistics and data graphics.
Statology
Online educational resource explaining statistical formulas, probability concepts, and practical Excel/R guides.
Desmos Graphing Calculator
Free, intuitive online graphing calculator capable of plotting functions, sliders, tables, and statistics.
Frequently Asked Questions About the Median
How do you find the median of an even set of numbers?
Sort the numbers, locate the two middle values at positions n/2 and (n/2)+1, add them together, and divide by 2.
Why is the median preferred over the mean for income and home prices?
Because income and home prices are heavily skewed by a tiny percentage of ultra-high values. The median represents what a typical person earns or pays without distortion.
Can the median be a number that is not in the original dataset?
Yes. When the count of numbers is even, the average of the two middle values can produce a number not present in the list (e.g., median of [1, 2] is 1.5).
What is the median of 1, 2, 3, 4, 5?
The median is 3. Since there are 5 numbers (an odd count), the exact center element is 3.
What happens to the median if you add an extreme outlier?
The median moves at most to the adjacent number in the sorted list, unlike the mean which can shift dramatically.
How does this calculator handle negative numbers?
Negative numbers are sorted in order from most negative to least negative (e.g. -10, -5, 0, 5), and the exact midpoint is identified.