Mathematics · Probability & Statistics
Mean Median Mode Calculator
Calculate the mean, median, mode, range, and standard deviation of any dataset with step-by-step results.
Calculator
Formula
The mean (x̄) is the sum of all values divided by the count n. The median is the middle value when data is sorted; for even n it is the average of the two central values. The mode is the most frequently occurring value. The population standard deviation (σ) measures spread around the mean.
Source: Freedman, Pisani & Purves, Statistics (4th ed.), W. W. Norton & Company; NIST/SEMATECH e-Handbook of Statistical Methods, Section 1.3.5.
How it works
The mean (arithmetic average) is calculated by summing all values in the dataset and dividing by the total count. It is the most widely used measure of central tendency and is highly sensitive to extreme values (outliers). For example, a single very large or very small number can pull the mean significantly away from the center of the rest of the data, making it less representative in skewed distributions.
The median is the middle value when the dataset is arranged in ascending or descending order. For an odd number of data points, it is the exact middle value. For an even number of points, it is the arithmetic average of the two central values. The median is robust to outliers and is the preferred measure of center when data is skewed — for instance, household income distributions are almost always reported using the median rather than the mean.
The mode is the value that appears most frequently in the dataset. A dataset can be unimodal (one mode), bimodal (two modes), multimodal (many modes), or have no mode at all if every value appears exactly once. The mode is the only measure of central tendency that can be applied to non-numerical (categorical) data, such as the most common surname in a population. The range (maximum minus minimum) and population standard deviation complement these measures by quantifying how spread out the data is around its center.
Worked example
Consider the dataset: 4, 7, 13, 2, 7, 9, 1
Step 1 — Count and Sum: There are n = 7 values. Their sum is 4 + 7 + 13 + 2 + 7 + 9 + 1 = 43.
Step 2 — Mean: Mean = 43 ÷ 7 = 6.1429
Step 3 — Median: Sort the data in ascending order: 1, 2, 4, 7, 7, 9, 13. With 7 values, the median is the 4th value = 7.
Step 4 — Mode: The value 7 appears twice; all others appear once. Mode = 7.
Step 5 — Range: Maximum − Minimum = 13 − 1 = 12.
Step 6 — Standard Deviation: Compute each squared deviation from the mean (6.1429): (4−6.1429)² = 4.592, (7−6.1429)² = 0.734, (13−6.1429)² = 47.020, (2−6.1429)² = 17.163, (7−6.1429)² = 0.734, (9−6.1429)² = 8.163, (1−6.1429)² = 26.449. Sum of squared deviations = 104.855. Variance = 104.855 ÷ 7 = 14.979. Population standard deviation = √14.979 = 3.8702.
Limitations & notes
This calculator computes the population standard deviation (dividing by n), which is appropriate when your dataset represents the entire population of interest. If your data is a sample drawn from a larger population and you need to estimate the population's standard deviation, you should use the sample standard deviation formula, which divides by (n − 1) instead — this is known as Bessel's correction. Additionally, when a dataset has multiple modes (bimodal or multimodal distributions), this calculator reports only the first mode found; always examine your full frequency distribution in such cases. The mean is a poor measure of center for heavily skewed distributions or datasets containing significant outliers — consider using the median instead. Input values must be valid numbers separated by commas; non-numeric entries are automatically ignored.
Frequently asked questions
When should I use the median instead of the mean?
You should prefer the median whenever your dataset is skewed or contains significant outliers, because the median is not influenced by extreme values. Classic examples include income data, housing prices, and response times — all of which are typically right-skewed, meaning a small number of very high values would artificially inflate the mean and give a misleading picture of the 'typical' value. The median always represents the true midpoint of your sorted data regardless of how extreme the tails are.
What does it mean if a dataset has no mode?
A dataset has no mode when every value in it appears exactly once — meaning no value occurs more frequently than any other. In this case, the mode is considered undefined or non-existent, and it is simply not a useful statistic for that particular dataset. This is common in continuous measurement data (such as precise weight measurements) where exact repetitions are rare, and in that context the mode is rarely a meaningful summary statistic anyway.
What is the difference between population and sample standard deviation?
Population standard deviation (σ) divides the sum of squared deviations by n and is used when your data represents every member of the group you are studying. Sample standard deviation (s) divides by (n − 1) — a correction known as Bessel's correction — and is used when your data is a random sample drawn from a larger population, to produce an unbiased estimate of the true population variability. In practice, for large datasets (n > 30) the difference between the two is negligible, but for small samples it can be significant.
Can the mean, median, and mode all be equal?
Yes — when the mean, median, and mode are all equal, the distribution is said to be perfectly symmetrical and unimodal, which is characteristic of the ideal normal distribution (bell curve). In such a distribution, the data is evenly distributed around the center with no skew. While this is a mathematically clean scenario, perfectly symmetric real-world datasets are rare; most empirical data exhibits at least some degree of skew or asymmetry.
What does the range tell me that the standard deviation doesn't?
The range (maximum − minimum) gives you the absolute span of your data — the simplest possible measure of spread — and is very easy to interpret and communicate. However, it is extremely sensitive to outliers because it depends entirely on the two most extreme values and ignores all intermediate data. The standard deviation, by contrast, takes every single data point into account and measures the average spread around the mean, making it a far more robust and informative measure of variability for most analytical purposes. Both statistics are useful: range for a quick boundary check, standard deviation for understanding typical variability.
Last updated: 2025-01-15 · Formula verified against primary sources.