Average Calculator

Find the mean, median, mode and range of a list of numbers, or a weighted average.

6 numbers

Separate numbers with commas, spaces or new lines. A comma always separates, so write 1234, not 1,234.

Mean of 6 numbers

15.16666667

Median
15
Mode
15 (twice)
Range
9
Count
6
Sum
91
Smallest
11
Largest
20

Other means

Geometric mean
14.84259458
Harmonic mean
14.52322738

Sorted, with the middle marked

11, 12, 15, 15, 18, 20

Paste or type a list of numbers to get its mean, median, mode, range, count, sum, smallest and largest value, with the geometric and harmonic means beside them. Two more ways of entering data cover values that repeat (a frequency table) and values that count for different amounts (a weighted average). The results update as you type, and the working uses your own numbers.

Which average to use

The mean is the sum divided by the count. It uses every value, so one very large or very small value pulls it. The median is the middle value of the sorted list, and half the values lie on each side of it; an extreme value moves it little or not at all. For data with a long tail, such as salaries or house prices, the median describes a typical value better than the mean.

The mode is the value that occurs most often, and the only average that works for things that are counted rather than measured, such as shoe sizes sold. The range is the largest value minus the smallest.

The geometric mean suits values that multiply, such as yearly growth factors; the harmonic mean suits rates over the same distance or amount, such as speeds over equal distances. Both are defined only for numbers above 0; otherwise the tool shows “Needs positive numbers”.

How to use it

Simple takes a list separated by commas, spaces, semicolons, tabs or new lines, so a column copied from a spreadsheet works as it is. It opens on 12, 15, 11, 15, 18, 20, whose mean is 15.16666667. A comma always separates two numbers, so write 1234, not 1,234. A list can hold up to 100,000 numbers, and an entry that is not a number is named under the box.

With frequencies takes each value once with the number of times it occurs, a whole number. Every result is the same as if the value were typed that many times.

Weighted takes each value with a weight, which may be a decimal, and gives the weighted mean, the sum of the weights and the unweighted mean for comparison. A weight cannot be negative, and the weights must not add up to 0.

In both grids, pasting two columns from a spreadsheet replaces the rows; a grid holds up to 200 rows. Under the working, the sorted list is shown with the middle value, or the two middle values, marked. Everything runs in your browser.

The formulas

The median of an even count is the mean of the two middle values. The mode lists every value tied for the most occurrences, so a list can have several. When different values all occur equally often, as in 1, 2, 3 or 1, 1, 2, 2, the tool reports “No mode — every value appears equally often”: no value is more common than another. Some textbooks call every value a mode in that case.

Numbers are held in double precision and shown to 10 significant figures. Sums are compensated, so adding 0.1 ten times gives exactly 1.

Mean = (x₁ + x₂ + … + xₙ) ÷ n
Weighted mean = (x₁w₁ + x₂w₂ + … + xₙwₙ) ÷ (w₁ + w₂ + … + wₙ)
Geometric mean = ⁿ√(x₁ × x₂ × … × xₙ)
Harmonic mean = n ÷ (1 ÷ x₁ + 1 ÷ x₂ + … + 1 ÷ xₙ)
Range = largest − smallest

Examples

Marks in five tests

With Simple and the numbers 72, 85, 90, 66, 85: the mean is 79.6, the median 85, the mode 85 (twice) and the range 24.

  1. Add the numbers. 72 + 85 + 90 + 66 + 85 = 398
  2. Divide the sum by how many numbers there are. 398 ÷ 5 = 79.6
  3. For the median, sort the numbers and take the middle one. Median = 85

A grade point average with credits

With Weighted, grade points as the values and course credits as the weights (8 with 4, 9 with 3, 6 with 2, 10 with 1): the weighted mean is 8.1, against an unweighted mean of 8.25. The four-credit course counts four times as much as the one-credit course.

  1. Multiply each value by its weight and add the results. 8 × 4 + 9 × 3 + 6 × 2 + 10 × 1 = 81
  2. Add the weights. 4 + 3 + 2 + 1 = 10
  3. Divide the first sum by the sum of the weights. 81 ÷ 10 = 8.1

House prices with one outlier

Six sale prices, 45, 52, 48, 50, 55, 400: the mean is 108.3333333, more than five of the six prices, because the one large sale pulls it up. The median is 51, which is what a typical house here sold for.

A frequency table

With With frequencies and the rows the tool opens with (10 × 2, 20 × 5, 30 × 3): the mean is 21, the median 20 and the mode 20 (5 times).

  1. Multiply each value by its frequency and add the results. 10 × 2 + 20 × 5 + 30 × 3 = 210
  2. Add the frequencies. 2 + 5 + 3 = 10
  3. Divide the first sum by the sum of the frequencies. 210 ÷ 10 = 21
  4. For the median, sort the numbers and average the two in the middle. (20 + 20) ÷ 2 = 20

Frequently asked questions

Yes. In 15, 15, 18, 18, 20 the tool gives 15 and 18 (each twice). Two values tied for the most occurrences are both modes, and the list is called bimodal.
The plain mean counts every value once. A weighted mean counts each value in proportion to its weight, so it moves toward the values with the largest weights. The two are equal only when every weight is the same.

See also