How to Calculate Mean, Median, and Mode
Learn the formulas for mean, median, mode, and range with a clear worked data set you can use to understand scores, prices, and survey results.
By CalcWell Team · ·
The mean is the sum of all values divided by how many there are. The median is the middle value once the data is sorted. The mode is the value that appears most often. Each one summarizes a data set differently, and picking the wrong one can mislead you. This guide shows how to calculate all three by hand, how to handle ties and even-sized sets, and when each is the right choice. To check numbers quickly, use the mean, median, and mode calculator.
What each measure tells you
- Mean (average): the balance point of the data. Every value contributes, so unusually large or small values pull it toward them.
- Median: the midpoint. Half the values sit below it and half above. It ignores how extreme the outer values are.
- Mode: the most common value. It is the only one of the three that also works for categories, such as the most popular shirt size.
- Range: the highest value minus the lowest. It is not a measure of the center, but it tells you how spread out the data is.
Formulas and steps
Mean = (sum of all values) ÷ (number of values). Add everything, then divide by the count n.
Median: sort the values from smallest to largest. If n is odd, the median is the value in position (n + 1) ÷ 2. If n is even, take the two middle values, in positions n ÷ 2 and n ÷ 2 + 1, and average them.
Mode: count how often each value occurs and pick the highest count. A set can have one mode, several modes, or none.
Worked example 1: an odd-sized set
Data: 4, 8, 6, 5, 3, 8, 9 (n = 7).
- Sum: 4 + 8 + 6 + 5 + 3 + 8 + 9 = 43. Mean = 43 ÷ 7 ≈ 6.14.
- Sorted: 3, 4, 5, 6, 8, 8, 9. The middle position is (7 + 1) ÷ 2 = 4th, so the median is 6.
- Mode: 8 appears twice, every other value once, so the mode is 8.
- Range: 9 - 3 = 6.
Worked example 2: an even-sized set with no mode
Data: 12, 15, 11, 18, 14, 20 (n = 6).
- Sum: 12 + 15 + 11 + 18 + 14 + 20 = 90. Mean = 90 ÷ 6 = 15.
- Sorted: 11, 12, 14, 15, 18, 20. The middle values are the 3rd and 4th: 14 and 15.
- Median = (14 + 15) ÷ 2 = 14.5. Note the median does not have to be a value in the set.
- Mode: every value appears once, so there is no mode. Do not report 0, which would be a different claim.
If two or more values tie for the highest count, all of them are modes. In 2, 3, 3, 5, 7, 7, 9 both 3 and 7 appear twice, so the set is bimodal with modes 3 and 7.
Worked example 3: how an outlier changes everything
Seven employees at a small firm earn $42,000, $45,000, $47,000, $48,000, $50,000, $52,000, and $400,000 (the owner).
- Sum: 42,000 + 45,000 + 47,000 + 48,000 + 50,000 + 52,000 + 400,000 = 684,000.
- Mean = 684,000 ÷ 7 ≈ $97,714.
- Median = the 4th value = $48,000.
Six of the seven people earn less than $53,000, yet the mean says $97,714. Remove the owner and the mean of the other six is 284,000 ÷ 6 ≈ $47,333, very close to the median. This is why income and house prices are usually reported as medians. The median barely moved, while the mean more than doubled. For a formal measure of spread that also reacts to outliers, see the standard deviation calculator.
Worked example 4: weighted mean
A plain mean treats every value equally. When some values count more, multiply each by its weight. Formula: weighted mean = (sum of value × weight) ÷ (sum of weights).
A course counts homework at 20%, quizzes at 30%, and the exam at 50%. A student scores 85 on homework, 90 on quizzes, and 78 on the exam.
- 85 × 0.20 = 17
- 90 × 0.30 = 27
- 78 × 0.50 = 39
- Total: 17 + 27 + 39 = 83. The weights sum to 1, so no further division is needed.
The plain mean of those three scores would be (85 + 90 + 78) ÷ 3 ≈ 84.33, which overstates the result because it ignores that the exam matters most. The grade calculator automates this kind of weighting.
Which measure should you use?
| Situation | Best measure | Why |
|---|---|---|
| Symmetric data, no extreme values (test scores, heights) | Mean | Uses every value and is easy to compare |
| Skewed data or outliers (salaries, home prices) | Median | Not pulled by extreme values |
| Categories (favorite color, shoe size to stock) | Mode | Works where averaging makes no sense |
| Values with different importance (course grades) | Weighted mean | Reflects each value's true contribution |
| Describing how spread out the data is | Range or standard deviation | Center alone hides variability |
A quick diagnostic: if the mean and median are far apart, the data is skewed or has outliers, and the median is usually the more honest summary.
Common mistakes
- Not sorting before finding the median. The middle of the list as written is meaningless. Sort first.
- Forgetting to average the two middle values when the count is even.
- Dividing by the wrong count. Count the values carefully, including repeats. In 4, 8, 8, 6 the count is 4, not 3.
- Calling the highest number the mode. The mode is the most frequent value, not the largest.
- Averaging averages. The mean of two group means is only correct when the groups are the same size. Otherwise use a weighted mean.
Frequently asked questions
Can a data set have more than one mode?
Yes. Two modes is bimodal, and more than two is multimodal. If every value appears equally often, the set is usually described as having no mode.
Is the median always one of the numbers in the data?
With an odd count, always. With an even count the median is the average of the two middle values, so it is a data value only when those two are equal (for 1, 2, 2, 3 the median is 2); otherwise it falls between data points (for 1, 2, 3, 4 it is 2.5).
What is the difference between mean and average?
In everyday use they are the same thing. Strictly, “average” can also refer to the median or mode, so “mean” is the precise word. The average calculator computes the mean.
Does the order of the data matter?
Not for any of these three measures. You can shuffle the list and get the same mean, median, and mode.
Run your own numbers
Paste your list into the mean, median, and mode calculator to get all three plus the range in one step, then compare against your hand calculation. More statistics tools are in the math calculators hub.
References
- CalcWell methodology: How we calculate
- For unit factors used in conversion guides, see NIST SP 811 Appendix B (SI conversion factors): nist.gov/pml/special-publication-811