What Is the Median: How to Find the True Middle Value
Ben Orlin draws on classroom teaching experience and a deep interest in making mathematics understandable. His practical knowledge connects mathematical ideas with everyday examples, helping readers explore concepts and approach learning with curiosity.
Quick answer
The median is the middle value in an ordered data set. It separates the higher half of numbers from the lower half. You find it by arranging numbers from smallest to largest. Then, take the central value from all those numbers. If the total count is even, average the two middle numbers.
The Median as a Measure of Center
In statistics, a measure of central tendency describes an entire set of data with a single number representing its middle or center point. The median is the specific value that splits an ordered data sample into two equal halves. Half of the observations are smaller than or equal to the median, and half of the observations are larger than or equal to it. Because it partitions a sample into two equal groups, the median is classified formally as a 2-quantile, the second quartile, the fifth decile, or the 50th percentile.
To understand the median, you must compare it with other standard measures of center. When you calculate an arithmetic average, you sum all observed values and divide by the total number of items. That resulting value is the sample mean. The mode represents the single number that appears most frequently in your sample. The midrange simply splits the absolute difference between your maximum and minimum values. While the mean depends on the exact numeric value of every entry, the median depends strictly on the relative rank order of the items.
| Measure Type | Mathematical Definition | Calculation Method | Resulting Value |
|---|---|---|---|
| Median | Middle entry separating the upper and lower halves | Select fourth sorted position: 3 | 3 |
| Mean | Sum of entries divided by sample size | (1 + 2 + 2 + 3 + 4 + 7 + 9) / 7 = 28 / 7 | 4 |
| Mode | Most frequently occurring observation | Locate highest frequency count: 2 appears twice | 2 |
| Midrange | Midway value between minimum and maximum | (Smallest + largest) / 2 = (1 + 9) / 2 | 5 |
Step-by-Step Method for Odd and Even Data Sets
Finding the median requires a consistent algorithmic process. You cannot pick a center number from a random collection; the entries must follow an orderly numerical sequence before locating the center rank.
- Sort your observations: Arrange every value in ascending order, from lowest to highest. You may also sort in descending order, which yields the exact same middle point.
- Count the sample size: Determine the total number of data points, denoted as N or n. Check whether N is an odd integer or an even integer.
- Apply the position rule: Use the corresponding mathematical index formula based on whether N is odd or even.
- Determine the final value: Retrieve the observation at the calculated position index, or take the midpoint if two middle values share the center.
Calculating with an Odd Sample Size
When your data set contains an odd number of items, exactly one observation sits directly in the middle. The position index formula for an odd sample size N is:
Position = (N + 1) / 2
If N is 7, the position index is (7 + 1) / 2 = 4. The fourth value in your sorted list is the median. An equal number of values (three items) will sit below this point, and three items will sit above it.
Calculating with an Even Sample Size
When your data set contains an even number of items, no single number occupies the exact mathematical center. Instead, two numbers share the middle position. You locate these two positions using two simple indices:
First Middle Position = N / 2
Second Middle Position = (N / 2) + 1
After identifying the numbers located at these two positions, you calculate their arithmetic mean by adding them together and dividing by 2:
Median = [Y_(N / 2) + Y_((N / 2) + 1)] / 2
You can keep the result as a fraction or convert fractions to decimals to express the exact midpoint cleanly.
Checked Examples for Both Data Sizes
Working through real numerical samples demonstrates how the sorting step and the index formulas operate in practice. Both examples below use illustrative survey data tracking retirement ages in years.
Illustrative Worked Example: Odd Sample Size
Consider an illustrative survey recording the retirement ages of 11 individuals, measured in whole years:
Unsorted values: 58, 54, 57, 54, 60, 56, 57, 54, 60, 58, 55
Step 1: Arrange the 11 observations in ascending numerical order:
54, 54, 54, 55, 56, 57, 57, 58, 58, 60, 60
Step 2: Confirm the sample size N = 11. Because 11 is odd, apply the odd position formula:
Position = (11 + 1) / 2 = 12 / 2 = 6
Step 3: Count across the sorted list to identify the 6th observation. The 6th entry is 57.
Step 4: Verify the result. The entries below 57 are (54, 54, 54, 55, 56), which equals 5 observations. The entries above 57 are (57, 58, 58, 60, 60), which also equals 5 observations. Because exactly 50 percent of the observations lie on either side, 57 years is verified as the exact sample median.
Illustrative Worked Example: Even Sample Size
Now consider an illustrative data set where a 12th individual retiring at age 52 is added to the previous sample:
Unsorted values: 58, 54, 57, 54, 60, 56, 57, 54, 60, 58, 55, 52
Step 1: Sort the complete list from smallest to largest:
52, 54, 54, 54, 55, 56, 57, 57, 58, 58, 60, 60
Step 2: Identify the sample size N = 12. Because 12 is an even integer, identify the two central positions:
First Position = 12 / 2 = 6
Second Position = (12 / 2) + 1 = 6 + 1 = 7
Step 3: Read the values located at positions 6 and 7. The 6th observation is 56 years, and the 7th observation is 57 years.
Step 4: Calculate the average of these two middle numbers:
Median = (56 + 57) / 2 = 113 / 2 = 56.5 years
Step 5: Verify the balance. Exactly 6 values (52, 54, 54, 54, 55, 56) are less than or equal to 56.5, and exactly 6 values (57, 57, 58, 58, 60, 60) are greater than 56.5. This confirms that 56.5 years divides the data set into two equal groups of six.
Why the Median Handles Outliers and Skewed Data
The primary advantage of the median over the mean is its resistance to extreme values, known as outliers. Because the mean sums every value, a single extraordinarily large or small number pulls the mean toward that tail. The median, by contrast, relies solely on position ranks.
Consider the original 11-person retirement group. In statistics, this group is called a sample. The ages are (54, 54, 54, 55, 56, 57, 57, 58, 58, 60, 60). As an illustrative calculation, summing all 11 ages (623 years) and dividing by 11 gives roughly 56.64 years. This mean is often rounded to 56.6 years. Suppose the final person did not retire at age 60, but retired at age 81 instead. The new data set becomes:
54, 54, 54, 55, 56, 57, 57, 58, 58, 60, 81
Recalculating the arithmetic mean reveals a noticeable shift:
New Mean = (54 + 54 + 54 + 55 + 56 + 57 + 57 + 58 + 58 + 60 + 81) / 11 = 644 / 11 ≈ 58.55 years
As an illustrative calculation, the extreme outlier pulls the sample mean up from 56.6 years to roughly 58.55 years. However, the median remains exactly 57 years. The 6th sorted position is still occupied by the number 57. The size of the highest number does not alter the center rank. For this reason, official economic reports frequently report median household income rather than mean household income. A handful of multi-billionaires would inflate the mean income dramatically. The median income is different. It reflects what a typical household actually earns.
Distribution Shapes and Skewness
The relationship between the mean, median, and mode changes predictably depending on the shape of your data distribution:
- Symmetric distributions: In a balanced distribution with matching tails, such as a normal distribution, the mean, median, and mode coincide at identical values.
- Positively skewed distributions (right-skewed): When a distribution has a long tail stretching toward higher positive numbers, the mean is pulled into the right tail. In most cases, the mode is smallest, followed by the median, with the mean being largest.
- Negatively skewed distributions (left-skewed): When the tail stretches toward smaller or negative numbers, the mean is pulled toward the left. Typically, the mean is smallest, the median sits in the center, and the mode is largest.
Although analysts often expect the mean to exceed the median in positively skewed data, mathematical exceptions exist. Certain discrete distributions, such as Poisson distributions, can exhibit positive skewness while maintaining a mean that is smaller than the median. When distributions develop heavy tails, like the theoretical Cauchy distribution, the sample mean fluctuates wildly and fails to provide a meaningful measure of center. In those conditions, the median remains stable and informative.
Domain Constraints and Data Types
While the median is versatile, it cannot be applied universally to every kind of information. Knowing its mathematical boundaries helps you select the right summary statistic for your problem. You can explore other related calculation guides across our math reference guide.
Measurement Scales
The median requires data that can be ordered in a natural ranking. It works directly on quantitative interval and ratio data, such as height, income, test scores, and age. It also functions on ordinal qualitative data, such as letter grades from A to F, because grades possess an agreed ranking order. An odd group of ranked student grades produces a clear median grade. However, the median cannot be calculated for nominal categorical data, such as hair color, city of residence, or college major. Because nominal categories have no logical numeric or ranked sequence, you cannot sort them, leaving the mode as the only valid measure of central tendency.
Continuous Distributions and Non-Unique Medians
For theoretical probability distributions, the median is any real number m that satisfies two inequalities. The probability of observing a value less than or equal to m must be at least half. Also, the probability of observing a value greater than or equal to m must be at least half. Continuous distributions can have flat regions. In these regions, probability density equals zero over an interval. Any point within that interval satisfies the condition. Under such circumstances, the median is not strictly unique.
Alternative Measures of Location
The sample mean is sensitive to outliers. The sample median can also ignore detailed spread information in normal tails. For these reasons, statisticians developed intermediate alternatives:
- Trimmed mean: Discards a fixed percentage of observations from both the upper and lower extremes (such as trimming 5 percent off each end) and averages the remaining middle values.
- Mid-mean: A specific trimmed mean that computes the arithmetic average of observations falling strictly between the 25th and 75th percentiles.
- Winsorized mean: Replaces extreme tail values with the nearest accepted percentile values rather than discarding them, then averages the entire set.
These hybrid estimators maintain the outlier resistance of the median. They also retain the mathematical efficiency of the mean. This applies when working with nearly normal data sets.
Frequently asked questions
Can the median be a number that does not appear in the original data set?
Yes. When a data set contains an even number of observations, the median is the arithmetic mean of the two middle numbers. If those two middle numbers are different, their midpoint will be a value that was not part of your original data collection.
How do you find the median if two middle numbers are identical?
You average the two identical middle numbers together. Because adding two identical values and dividing by 2 returns that exact same number, the median simply equals that shared value. For example, if the two middle values are 8 and 8, the median is 8.
Why is the median preferred over the mean for reporting incomes?
The median is preferred because income distributions are heavily skewed to the right. A small group of extremely high earners inflates the arithmetic mean significantly. The median ignores the raw size of extreme outliers, reflecting what a typical household in the exact middle earns.
Can you calculate a median for categorical survey answers?
You can calculate a median for categorical data only if the categories have a natural, logical order, such as satisfaction ratings or letter grades. You cannot calculate a median for nominal categories like favorite colors or job titles, because those values cannot be sorted sequentially.
Sources
- 1.3.5.1. Measures of Location · itl.nist.gov
- Measures of central tendency · Australian Bureau of Statistics (abs.gov.au)
- Median - Wikipedia · en.wikipedia.org
Prepared from these references and checked against them. References retrieved October 12, 2026.
Spotted an error? Tell us what needs correcting.