The mean is the average of a data set, calculated by summing all values and dividing by the count. The median is the middle value when data is ordered from smallest to largest—50% of values lie below it and 50% above. These measures describe central tendency differently, especially when data is skewed.
Formula
The mean (arithmetic average) is calculated as:
Mean = (Sum of all values) / (Number of values)
Symbolically:
\( \bar{x} = \frac{\sum_{i=1}^{n} x_i}{n} \)
Where:
- \( \bar{x} \) = mean
- \( x_i \) = each individual value in the data set
- \( n \) = total number of values
The median is the middle value in an ordered list. If the number of values \( n \) is odd, the median is the value at position \( (n+1)/2 \). If \( n \) is even, the median is the average of the two middle values at positions \( n/2 \) and \( (n/2)+1 \).
An Example
Using the default values from the calculator: 12, 8, 15, 23, 11.
- Order the data: 8, 11, 12, 15, 23
- Count the values: n = 5 (odd)
- Find the middle position: (5 + 1) / 2 = 3rd value
- The 3rd value is 12 → Median = 12.000
Now calculate the mean:
- Sum = 12 + 8 + 15 + 23 + 11 = 69
- Count = 5
- Mean = 69 / 5 = 13.800
The calculator outputs: Mean = 13.800, Median = 12.000.
Background and Importance
The mean and median are fundamental measures of central tendency in statistics. The mean is widely used because it incorporates every data point and supports further mathematical analysis, such as variance and standard deviation. However, it is sensitive to extreme values (outliers), which can distort it significantly.
The median is more robust to outliers. For example, in income data where a few individuals earn millions, the mean income may be much higher than what most people earn, while the median reflects the typical experience more accurately. This makes the median preferred in reporting household income, home prices, and other skewed distributions.
How to Choose Between Mean and Median
Choosing depends on the data distribution and the goal of analysis:
- Use the mean when data is symmetrically distributed (e.g., normal distribution) and outliers are rare or not influential. Examples: test scores in a large class, repeated measurements in a lab.
- Use the median when data is skewed or contains outliers. Examples: housing prices, income, survival times in medical studies.
- Report both when possible, to give a fuller picture. For instance, “The mean household income was $75,000, but the median was $58,000,” signals skewness.
Common Problems and Misconceptions
A frequent error is assuming the mean always represents the “typical” value. In skewed data, this is misleading. For example, if nine people have $10 and one has $1,000, the mean is $109, but no one is close to that amount.
Another mistake is confusing median with mode (the most frequent value). They can differ significantly: in the set {1, 2, 2, 3, 9}, the mode is 2, median is 2, mean is 3.4.
Also, people sometimes forget to sort data before finding the median. Unordered data leads to incorrect results—always sort first.
Comparisons: Mean vs. Median
Here’s how they behave under different conditions:
- Symmetric data: mean ≈ median (e.g., {1, 2, 3, 4, 5}, mean = 3, median = 3)
- Right-skewed (positive skew): mean > median (e.g., incomes, where a few high values pull the mean up)
- Left-skewed (negative skew): mean < median (e.g., age at death in a young population, where a few early deaths pull the mean down)
The difference between mean and median can itself indicate skewness. A large gap suggests non-normal data and warrants further investigation.
Assumptions
- Data values are numerical and measurable.
- No assumptions about distribution shape are required for calculating mean or median—they are descriptive statistics.
- The median assumes data can be ordered (true for interval and ratio scales).
- Calculations assume no missing values; missing data must be handled before computing.
Frequently Asked Questions
Can the mean and median be the same?
Yes. In perfectly symmetric distributions, such as a normal distribution or a uniform set like {2, 4, 6}, the mean and median are equal. For example, in {1, 3, 5}, both are 3.
What if there are two middle numbers?
When the data set has an even number of values, the median is the average of the two central numbers. For {4, 6, 8, 10}, the two middle values are 6 and 8, so the median is (6 + 8)/2 = 7.
Does the median use all data points?
No. The median only depends on the middle value(s) after sorting. Other values, even extreme ones, don’t affect it unless they change the middle position. This makes it robust against outliers.
Is the mean always better than the median?
No. The mean is mathematically convenient and useful in inferential statistics, but the median is often more representative of typical values in skewed data. Neither is universally better—they serve different purposes.
Can I calculate mean or median for categories?
No. These measures require numerical data. For categorical data (e.g., colors, types), use the mode. You cannot compute a meaningful average of “red” and “blue.”
How do I handle repeated values?
Include all values as they appear. Repeats are part of the data. For example, in {5, 5, 7}, the mean is (5+5+7)/3 = 5.67, and the median is 5 (the middle of the ordered list).
Related
Formula used
in v1 | Value 1 | - | 12 | - in v2 | Value 2 | - | 8 | - in v3 | Value 3 | - | 15 | - in v4 | Value 4 | - | 23 | - in v5 | Value 5 | - | 11 | - list data | Data Set | 12, 8, 15, 23, 11 out mean | Mean | - | mean(data) | 3 out median | Median | - | median(data) | 3 out count | Number of values | - | count(data) | 0 out range | Range | - | maxl(data) - minl(data) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.
More in this section
- Right Triangle Trigonometry Angle Calculation
- Simple Interest Rate Calculation Example$150.00
- Mean Absolute Deviation Calculation Example
- Ladder Height Calculation Problem?24.74 ft
- Average Speed Calculation Problem?100.00 km
- Simple Interest Calculation: Formula and Example150.00 USD