Mean, Median, Mode Calculator — Dataset Statistics
Mean
—
Median
—
Mode
—
Range
—
Std Dev
—
Variance
—
Sum
—
Count
—
Min/Max
—
Sorted Data
—
How Mean, Median, and Mode Work
Mean, median, and mode are the three primary measures of central tendency in statistics, each describing the "center" of a dataset from a different perspective. According to the Khan Academy statistics curriculum and the American Statistical Association, understanding when to use each measure is a foundational skill in data literacy.
The mean (arithmetic average) is the most commonly used measure but is sensitive to outliers. The median is the middle value when data is sorted and is robust against extreme values, making it preferred for skewed distributions like income data. The mode is the most frequently occurring value and is the only measure applicable to categorical data. This calculator computes all three along with standard deviation, variance, range, sum, and count.
These statistics are used across every field: business analysts use them for sales data, researchers use them for experimental results, educators use them for test scores, and healthcare professionals use them for patient data. The U.S. Census Bureau, for example, reports median household income ($74,580 in 2022) rather than mean income because the median better represents a typical household when extreme wealth skews the distribution.
Formulas for Mean, Median, and Mode
Each measure of central tendency uses a different calculation method:
Mean = Sum of all values / Count of values
Median = Middle value of sorted data (average of two middle values if count is even)
Mode = Value(s) that appear most frequently
- Range = Maximum - Minimum
- Variance = Average of squared deviations from the mean
- Standard Deviation = Square root of variance (same units as data)
Worked example: Dataset: 5, 10, 10, 15, 20. Mean = (5+10+10+15+20)/5 = 12. Median = 10 (3rd value). Mode = 10 (appears twice). Range = 20-5 = 15. Variance = [(7^2 + 2^2 + 2^2 + 3^2 + 8^2)]/5 = 25.2. Standard deviation = 5.02.
Key Terms You Should Know
- Outlier — a data point significantly different from others. Outliers heavily affect the mean but not the median. The NIST Engineering Statistics Handbook defines outliers as values more than 1.5x the interquartile range beyond Q1 or Q3.
- Skewness — a measure of distribution asymmetry. Right-skewed data (income, home prices) has mean > median. Left-skewed data has mean < median.
- Population vs Sample — population statistics use all data (divide variance by N); sample statistics use a subset (divide by N-1 for unbiased estimate).
- Bimodal / Multimodal — a dataset with two or more modes, suggesting multiple clusters or subgroups in the data.
- Interquartile Range (IQR) — the range of the middle 50% of data (Q3 - Q1), a robust measure of spread.
When to Use Mean vs Median vs Mode
Choosing the right measure of central tendency depends on your data type and distribution shape. The table below summarizes best practices used in academic research and data science.
| Situation | Best Measure | Why |
|---|---|---|
| Symmetric data, no outliers | Mean | Uses all data points, most efficient |
| Skewed data (income, prices) | Median | Not affected by extreme values |
| Categorical data (colors, brands) | Mode | Only measure for non-numeric data |
| Data with outliers | Median | Robust against extreme values |
| Normal distribution | Mean = Median = Mode | All three converge in symmetric data |
Practical Examples
Example 1 — Test scores: Class test scores: 55, 70, 72, 75, 78, 80, 82, 85, 90, 98. Mean = 78.5, Median = 79, Mode = none. This is approximately symmetric, so mean and median are close. Use either to summarize performance.
Example 2 — Home prices: Listing prices: $200K, $220K, $230K, $245K, $250K, $1.2M. Mean = $390,833 (misleading due to the $1.2M outlier). Median = $237,500 (better represents the typical home). This is why real estate reports use median price. Use the average calculator for quick mean computations.
Example 3 — Shoe sizes in inventory: Sizes sold: 8, 9, 9, 10, 10, 10, 11, 11, 12. Mode = 10 (most frequent). For inventory planning, the mode tells the retailer which size to stock the most. Use a sample size calculator to determine how many data points you need for reliable statistics.
Tips for Analyzing Your Data
- Always check for outliers first: Compare mean and median. If they differ significantly, outliers are likely present and the median is more representative.
- Report multiple measures: Presenting mean, median, and standard deviation together gives readers a complete picture of center and spread.
- Look at the sorted data: This calculator displays sorted values so you can visually inspect for patterns, gaps, or clusters.
- Use standard deviation for context: A mean of 50 with SD of 2 is very different from a mean of 50 with SD of 20. The SD tells you how spread out the data is around the mean.
- Consider sample size: Statistics from small datasets (under 30 observations) are less reliable. The Central Limit Theorem states that sample means approximate a normal distribution as sample size increases.
Frequently Asked Questions
What is the difference between mean and median?
The mean is the arithmetic average calculated by summing all values and dividing by the count, while the median is the middle value when data is sorted in order. The key difference is sensitivity to outliers: a single extreme value can dramatically shift the mean but has no effect on the median. For example, incomes of $40K, $50K, $60K, $70K, and $500K have a mean of $144K but a median of $60K. The U.S. Census Bureau reports median household income rather than mean for this reason. Use the mean for symmetric, outlier-free data and the median for skewed distributions.
When should I use population vs sample standard deviation?
Use population standard deviation (dividing by N) when your dataset includes every member of the group you are studying, such as all employees in a company or all students in a class. Use sample standard deviation (dividing by N-1, called Bessel's correction) when your data is a subset of a larger population, such as a survey of 500 people representing a country. The N-1 correction produces an unbiased estimate of the population variance. In practice, most real-world analyses use sample standard deviation because complete population data is rarely available.
What if there is no mode in my dataset?
If every value in your dataset appears exactly once (or all values appear with equal frequency), there is no mode. This is common with continuous data like precise measurements (e.g., 2.341, 2.352, 2.367). In such cases, the mode is not a useful measure of central tendency. You can create a mode by grouping continuous data into bins or ranges. A dataset can also be bimodal (two modes) or multimodal (three or more modes), which often indicates the data contains distinct subgroups that may warrant separate analysis.
How is variance related to standard deviation?
Standard deviation is the square root of variance. Variance measures the average squared deviation from the mean, giving the spread in squared units (e.g., dollars-squared). Standard deviation converts this back to the original units by taking the square root. For example, if test scores have a variance of 225 points-squared, the standard deviation is 15 points. Standard deviation is more intuitive because it uses the same units as the data. About 68% of values fall within one standard deviation of the mean in a normal distribution, and 95% within two standard deviations.
How many data points do I need for reliable statistics?
There is no universal minimum, but statisticians generally recommend at least 30 observations for the Central Limit Theorem to apply, meaning sample means will approximate a normal distribution regardless of the underlying data shape. For detecting small differences, you may need hundreds or thousands of data points. Use our sample size calculator to determine the exact number needed for a given confidence level and margin of error. With fewer than 10 observations, treat any statistics as preliminary estimates rather than definitive measures.