CALCULATORCASTLE

Mean Median Mode Range Calculator

Calculate mean, median, mode, and range for any data set with full statistics.

About

Mean Median Mode Range Calculator

Mean, median, mode and range each describe a different aspect of a data set. Computed together they give a reasonable picture of the data; taken alone, any one of them can mislead. This page works through all four, plus the geometric mean, largest, smallest, sum and count.

Mean

The word mean is ambiguous even within mathematics, and what it means depends on whether the context is mathematical or statistical. In its simplest form it is the arithmetic mean, also called mathematical expectation or the average: an intermediate value between a discrete set of numbers, found by dividing the sum of all values by how many there are.

x̄ = (1/N) × Σxi

where:

  • is the mean, pronounced "x bar"
  • N is the number of values
  • Σxi is the sum of all the values

The bar notation is a common indicator of some form of mean even when the variable is not x. For a population mean the Greek letter mu, μ, is used instead, and rather confusingly the sample mean in statistics is often written with a capital X̄. The equation for the arithmetic mean is virtually identical to the one for the population and sample means, differing only in the variables.

Given the data set 10, 2, 38, 23, 38, 23, 21, the summation gives:

(10 + 2 + 38 + 23 + 38 + 23 + 21) / 7 = 155 / 7 = 22.143

This is one of the simplest definitions. Others include the weighted arithmetic mean, which differs only in that certain values contribute more than others, and the geometric mean. Understanding the context usually tells you which is the relevant one.

Median

The median is the value that divides a data sample, population or probability distribution into two halves. Finding it means finding the value with a physical position in the middle of the rest.

Order matters when calculating the median of a finite list. Conventionally the values are listed in ascending order, though descending would give the same result. Where the total number of values is odd, the median is simply the number in the middle. Where it is even, the median is the mean of the two middle values. Even though the median sometimes involves computing a mean, it uses only those two middle values, while a mean uses all of them.

With the same data set sorted:

2, 10, 21, 23, 23, 38, 38

There are an odd number of values, so 23 is the median. Add one more value:

2, 10, 21, 23, 23, 38, 38, 1027892

Now there is an even count, so the median is the average of the two middle numbers, 23 and 23, which is 23. Notice that adding an outlier, a value well outside the expected range, has no real effect on the median. The mean of that same set is 128,505.875, which represents none of the eight values well. This is the main advantage of the median over the mean. Where only one can be used and the data contains extreme variation, the median gives a better estimate of a typical value.

In the odd cases where there are only two values, or an even number of values that are all the same, the mean and median are identical.

Mode

The mode is the value in a data set with the highest number of recurrences. A set can be multimodal, meaning it has more than one mode:

2, 10, 21, 23, 23, 38, 38

Both 23 and 38 appear twice, so both are modes of this set.

Like the mean and median, the mode expresses information about random variables and populations. Unlike them, it applies to non-numerical values as well, such as the brand of tortilla chips most commonly bought from a shop. If XOCHiTL is the mode and sells in a 3:2:1 ratio against Tostitos and Mission, that ratio tells the shop how many bags of each to stock: 12 XOCHiTL, 8 Tostitos and 4 Mission out of 24. Using the average instead and stocking 8 of each risks losing 4 sales to customers who wanted XOCHiTL and nothing else. It is a small example of why all the statistical measures deserve attention before drawing conclusions.

A set where every value appears exactly once has no mode at all, which the calculator reports rather than picking one arbitrarily.

Range

The range is the difference between the largest and smallest values. Range has other meanings in other areas of mathematics, but this is the basic one and the one used here.

2, 10, 21, 23, 23, 38, 38 → 38 - 2 = 36

Like the mean, range is strongly affected by extreme values. Adding that outlier again:

2, 10, 21, 23, 23, 38, 38, 1027892 → the range becomes 1,027,890 rather than 36.

One value changed a summary statistic by five orders of magnitude, which is why data sets deserve proper examination before any single number is quoted from them.

Geometric mean

The geometric mean multiplies all the values together and takes the nth root, rather than adding and dividing.

GM = (x₁ × x₂ × … × xn)1/n

For the same seven values it comes to 16.412764443111, well below the arithmetic mean of 22.143. It always is, unless every value is identical, in which case the two agree.

It is the right average for anything that compounds or is expressed as a ratio: growth rates, investment returns, population change, index numbers. An investment gaining 50% then losing 50% has an arithmetic mean return of 0% and a geometric mean of about -13.4%, and the geometric figure is the one matching what actually happened to the money.

It requires every value to be above zero, since a single zero collapses the product and a negative value makes the root undefined for even n. The calculator reports that rather than returning a meaningless number.

Choosing between them

MeasureBest forWeakness
MeanRoughly symmetric data with no extreme valuesDragged badly by outliers
MedianSkewed data, incomes, house prices, response timesIgnores the size of values away from the middle
ModeCategories, repeated readings, stocking decisionsMay not exist, or may not be unique
RangeA quick sense of spreadUses only two values, so one outlier defines it
Geometric meanGrowth rates, returns, ratiosNeeds all values above zero

The gap between the mean and the median is itself informative. When they sit close together the data is roughly symmetric. When the mean sits well above the median the distribution has a long right tail, which is why average income is consistently higher than median income: a small number of very high earners pull the mean up while the median stays where most people actually are.

A worked example, end to end

Take 10, 2, 38, 23, 38, 23, 21.

Sort it: 2, 10, 21, 23, 23, 38, 38. The count is 7 and the sum is 155, so the mean is 155 / 7 = 22.142857142857. With seven values the median is the fourth, which is 23. The largest is 38 and the smallest is 2, so the range is 36. Both 23 and 38 appear twice while everything else appears once, so the set is bimodal with modes of 38 and 23. The geometric mean is the seventh root of the product, 16.412764443111.

Mean 22.14, median 23, modes 38 and 23. All three sit reasonably close here, which tells you the data has no severe skew, and the range of 36 against a mean of 22 tells you it is fairly spread out for its size.

What these four leave out

None of them describes how tightly the values cluster around the centre. Two data sets can share a mean and a range while looking nothing alike: 1, 50, 50, 99 and 1, 1, 99, 99 both have a mean of 50 and a range of 98, but the first clusters at the centre and the second sits entirely at the edges.

Standard deviation fills that gap by measuring the typical distance from the mean, and it is the statistic to reach for next. Quartiles and the interquartile range do a similar job while resisting outliers the way the median does.

Sample size matters as much as any of it. A mean of four values and a mean of four thousand are not equally trustworthy, however similar the numbers look, which is why the count is reported alongside everything else here.

Common questions

Frequently asked questions

The mean is the sum divided by the count. The median is the middle value once the data is sorted. The mode is the value appearing most often. For 2, 10, 21, 23, 23, 38, 38 the mean is 22.14, the median is 23, and the modes are 23 and 38.

Sort the data and average the two middle values. With eight values, take the fourth and fifth, add them and divide by two. That is the one case where finding a median involves calculating a mean, and it uses only those two numbers rather than all of them.

Yes. A set with two modes is bimodal and one with several is multimodal. In 2, 10, 21, 23, 23, 38, 38 both 23 and 38 appear twice, so both are modes. A set where every value appears exactly once has no mode at all.

Subtract the smallest value from the largest. For 2, 10, 21, 23, 23, 38, 38 that is 38 minus 2, which is 36. Range uses only those two numbers, so a single extreme value defines it entirely.

Because outliers barely move it. Add 1,027,892 to that seven-value set and the median stays at 23 while the mean jumps to 128,505.875, a figure that describes none of the eight values. This is why house prices and incomes are usually reported as medians.

Anything that compounds or is a ratio: growth rates, investment returns, index numbers. An investment that gains 50% then loses 50% has an arithmetic mean return of 0% but a geometric mean of about -13.4%, and the geometric figure matches what actually happened to the money.

It always is, unless every value is identical, in which case they are equal. For the seven-value example the geometric mean is 16.41 against an arithmetic mean of 22.14. The gap widens as the values become more spread out.

Yes, and that is what separates it from the mean and median. You cannot average a brand of tortilla chips, but you can say which one sells most, and use the ratio between brands to decide what to stock.

Then the set has no mode, and reporting one would be misleading. The calculator says so rather than picking a value at random. This happens whenever every value appears exactly once.

Standard deviation. Mean, median, mode and range say nothing about how tightly values cluster: 1, 50, 50, 99 and 1, 1, 99, 99 share a mean of 50 and a range of 98, yet one clusters at the centre and the other sits at the edges. Standard deviation measures the typical distance from the mean and fills that gap.