Understanding the Median: Definition, Formula & Examples

    By Oge Nwaozuzu4 min readUpdated: December 15, 2025

    Imagine a neighborhood where five houses sold for $250K, $275K, $295K, $310K, and $2,100K. The mean price is $646K—but does that represent what a typical house costs? Not really. The median ($295K) tells the true story: the $2.1M mansion pulled the average way up, but half the houses still sold for under $295K.

    What Is the Median?

    The median is the middle value when you arrange a dataset in order from smallest to largest. If you line up all your data points, the median is literally the one standing in the middle.

    In the context of the five number summary, the median is also called Q2 (the second quartile) or the 50th percentile. It divides your data into two equal halves, serving as the foundation for calculating Q1 and Q3.

    It's important to distinguish the median from the mean (average). The mean adds up all values and divides by the count. The median simply finds the middle position. These two measures can be quite different, especially in skewed datasets.

    How to Calculate the Median

    For an Odd Number of Values

    When you have an odd count of data points, the median is simply the middle value.

    Formula: The median is at position (n + 1) / 2, where n is the count of values.

    Example: Dataset: 3, 7, 9, 15, 22

    • Count (n) = 5 (odd)
    • Position = (5 + 1) / 2 = 3
    • The 3rd value is 9
    • Median = 9

    For an Even Number of Values

    When you have an even count, there's no single middle value. Instead, you take the average of the two middle values.

    Formula: Average the values at positions n/2 and (n/2) + 1.

    Example: Dataset: 4, 8, 12, 16, 20, 24

    • Count (n) = 6 (even)
    • Middle positions = 3 and 4
    • Values at those positions: 12 and 16
    • Median = (12 + 16) / 2 = 14
    • Median = 14

    Median vs. Mean: When to Use Which

    Understanding when to use the median versus the mean is crucial for accurate data interpretation.

    The mean is sensitive to outliers. A single extreme value can dramatically pull the mean up or down. For example, if a billionaire walks into a room of average earners, the mean income skyrockets. But nobody's actual income changed.

    The median is resistant to outliers. That same billionaire has virtually no effect on the median income, because the median only cares about position, not magnitude.

    Pro Tip

    If someone tells you the "average" income in a city is $150,000, ask if that's the mean or median. The median often tells a more accurate story of what typical people actually earn. Income data is almost always right-skewed, making the median more representative.

    When to use the mean:

    • Data is roughly symmetric (no major outliers)
    • You need to calculate totals (mean × count = sum)
    • Data follows a normal distribution

    When to use the median:

    • Data is skewed (e.g., income, home prices)
    • Outliers are present
    • You want the "typical" value
    • You don't know the distribution shape

    The Median in the Five Number Summary

    In the five number summary, the median serves as Q2—the central value. Its position relative to Q1 and Q3 reveals the shape of your distribution:

    • Median centered between Q1 and Q3: Symmetric distribution
    • Median closer to Q1: Right-skewed (tail extends toward higher values)
    • Median closer to Q3: Left-skewed (tail extends toward lower values)

    The median also serves as the dividing line for finding Q1 and Q3. You calculate Q1 as the median of all values below the overall median, and Q3 as the median of all values above it.

    Examples

    Example 1: Simple Dataset

    Dataset: 2, 5, 7, 10, 15

    With 5 values (odd), the median is the 3rd value: Median = 7

    Example 2: Real-World Application (Home Prices)

    Home prices in a neighborhood (in thousands): 250, 275, 280, 295, 310, 325, 890

    Mean: (250 + 275 + 280 + 295 + 310 + 325 + 890) / 7 = $375,000

    Median: The 4th value = $295,000

    The $890,000 home (perhaps a mansion) pulls the mean up significantly. The median of $295,000 better represents what a typical home in the neighborhood costs.

    Conclusion

    The median is a robust measure of central tendency that resists the influence of outliers. It's the foundation of the five number summary and provides a more accurate picture of "typical" values in many real-world datasets.

    Understanding when to use the median versus the mean is a fundamental statistical skill that will serve you well in any data analysis context.

    Verify Your Calculations

    Use the free five number summary calculator to check your work.

    Open Calculator

    Written by Oge Nwaozuzu

    Statistics educator and data analyst. Creator of 5numbersummarycalculator.app.