HomeTools › Mean, Median & Mode Calculator

Mean, Median & Mode Calculator

Paste a column of numbers, or a value-and-count frequency table, and get the three measures of center at once: the mean, the median and the mode, plus the range and midrange. Every step is shown, multimodal and no-mode data are handled honestly, and a plain-English note tells you when the median is the more trustworthy summary.

I want the mean, median and mode of a list of numbers

Your data

One number per line, or separated by commas or spaces. Headers, currency symbols and blanks are handled.

Try:
 
measures of center
 
 
Range
 
Midrange
 
Minimum
 
Maximum
 
Count n
 
Sum
 
Std dev (n-1)
 
Skewness
 
 
 
 
Show the steps on your data
The same thing in R
 
No data leaves your browser Verified against R's mean(), median() and table() Free, no sign-up

Mean, median or mode: which center should you report?

All three describe the "center" of your data, but they answer slightly different questions and disagree the moment the data is skewed.

Mean (the average)

Add every value and divide by the count. It uses all the data and is the right choice for symmetric data, but it is pulled toward outliers: one very large value drags the mean up.

Median (the middle)

Sort the data and take the middle value. It ignores how extreme the outliers are, so it stays near the bulk of the data. Prefer it whenever the data is skewed or has outliers.

Mode (the most common)

The value that appears most often. It is the only center that works for categories, and the only one that can be missing or come in twos and threes. Best for spotting the typical category.

When the median beats the mean

The gap between the mean and the median is a quick read on skew. When the data is symmetric the two land in the same place. When a long tail stretches to the right, a few large values pull the mean above the median, so the distribution is right-skewed and the mean overstates the typical value. A long left tail does the reverse. The rule of thumb: the mean sits on the side of the longer tail, and the further it is from the median, the more skewed the data. For skewed data like incomes, house prices or response times, the median is the honest headline number, which is why the sketch above draws both the mean and the median so you can see the pull.

What each number means

QuantityFormulaWhat it tells you
Meansum(x) / nThe balance point of the data. Uses every value, so outliers move it.
Medianmedian(x)The middle value once sorted (average of the two middle for an even count). Resistant to outliers.
Modeux[tab == max(tab)]The value or values that occur most often. Can be none (all unique) or several (ties).
Rangemax(x) - min(x)Total spread from smallest to largest. Driven entirely by the two extremes.
Midrange(min(x) + max(x)) / 2Midpoint of the two extremes. A crude center, very sensitive to outliers.
Frequently asked questions
When should I use the median instead of the mean?

Use the median when the data is skewed or has outliers. The mean is the balance point and gets pulled toward extreme values, so a few very large or very small numbers can drag it away from where most of the data sits. The median is the middle value and ignores how far out the extremes are, so it stays close to the bulk of the data. When the mean and median are far apart the median is usually the more honest summary; when they are close the data is roughly symmetric and the mean is fine.

What if there is no mode, or more than one mode?

A data set has no mode when every value appears exactly once, since nothing is more frequent than anything else. It is bimodal or multimodal when two or more values tie for the highest frequency. This calculator reports all of the tied values and says plainly when there is no single mode, instead of silently picking one. The mode is the only measure of center that can be missing or come in multiples.

How do you calculate the mode in R?

R has no built-in function for the statistical mode (mode() returns a variable's storage type, not the most common value). The honest way is to tabulate the values and keep those tied at the top frequency: ux <- unique(x); tab <- tabulate(match(x, ux)); ux[tab == max(tab)]. That returns every mode, so it handles ties. The shortcut names(which.max(table(x))) returns only the first mode as text and hides ties.

What is the difference between range and midrange?

The range is the spread from the smallest to the largest value, max - min, a single number for how wide the data is. The midrange is the midpoint between those two extremes, (min + max) / 2, a crude center. Both depend only on the two most extreme values, which makes them very sensitive to outliers, so the midrange is rarely used as the headline center.

Can the mean, median and mode be equal?

Yes. For a perfectly symmetric, single-peaked distribution the three coincide, and the normal distribution is the classic example with mean, median and mode all at the center. In real data they are rarely exactly equal, but when they are close the data is roughly symmetric. The bigger the gap between the mean and the median, the more skewed the data, with the mean on the side of the longer tail.

How is the median found for an even number of values?

Sort the values and average the two in the middle. With an even count there is no single middle value, so the median is the mean of the two central order statistics; for eight sorted values it is the average of the 4th and 5th. With an odd count the median is just the single middle value. This matches R's median().

Keep going

Tools that pick up where the three centers leave off.