Skip to main content

Mean, median and mode calculator

Paste your numbers, or values and frequencies from a table. You get every average and measure of spread, how each was found, and a box plot.

Separate with spaces, commas or new lines.

One frequency per value, in the same order.

Mean 14.8, median 15.0, mode 15
n
9
Mean
14.8
Median
15.0
Mode
15
Range
9.00
Q1
12.5
Q3
16.5
IQR
4.00
Graph loads here
Show the working

n = 9,   Σx = 133,   Σx² = 2030

Mean x̄ = Σx ÷ n = 133 ÷ 9 = 14.8

Median: put the 9 values in order; the median is value number (9 + 1) ÷ 2 = 5: 15.0.

Mode: 15 (3 times).

Range = 20 − 11 = 9.00

Quartiles: Q1 = 12.5 and Q3 = 16.5 (the medians of the lower and upper halves, leaving out the median), so IQR = 16.5 − 12.5 = 4.00.

Textbooks use slightly different rules for quartiles; this is the one graphic calculators use. For a large data set or a cumulative frequency graph, the exam may use (n + 1)/4 or n/4: follow your course.

Answers are rounded to 3 significant figures, which is what IB papers ask for unless a question says otherwise.

How to do it by hand

  1. Mean: add the values and divide by how many there are. From a frequency table, Σfx ÷ Σf.
  2. Median: put the values in order and take the middle one, the ((n + 1) ÷ 2)th value; with an even number of values, take halfway between the middle two.
  3. Mode: the value that appears most often. Range: largest minus smallest.
  4. Quartiles: the medians of the lower and upper halves; the interquartile range is Q₃ − Q₁.

Worked example

A survey asks 25 students how many books they read last month. 0 books: 4 students, 1 book: 7, 2 books: 8, 3 books: 4, 4 books: 2. Find the mean, median and mode.

Solution

n = 25,   Σx = 43.0,   Σx² = 107

With a frequency table, Σx means Σfx (each value times its frequency) and n = Σf.

Mean x̄ = Σx ÷ n = 43.0 ÷ 25 = 1.72

Median: put the 25 values in order; the median is value number (25 + 1) ÷ 2 = 13: 2.00.

Mode: 2 (8 times).

Range = 4 − 0 = 4.00

Quartiles: Q1 = 1.00 and Q3 = 2.50 (the medians of the lower and upper halves, leaving out the median), so IQR = 2.50 − 1.00 = 1.50.

Textbooks use slightly different rules for quartiles; this is the one graphic calculators use. For a large data set or a cumulative frequency graph, the exam may use (n + 1)/4 or n/4: follow your course.

Answer: Mean 1.72, median 2.00, mode 2

Every number in this example is worked out by the same code as the tool above, and the code is tested against independent results from Python's SciPy library.

Where you need it

Where it is used in IB Maths
AA SLMean, standard deviation, quartiles and outliers from a list or frequency table.
AA HLAs SL.
AI SLAs AA SL.
AI HLAs SL.

On your calculator

In the exam you use your own calculator, so practise it too. Our guides give the exact keystrokes for the Casio fx-CG50, TI-Nspire CX II and TI-84 Plus CE, with a worked example to check against:

Common mistakes

Questions students ask

Which average should I use?

The mean uses every value but is pulled by extreme values; the median is not affected by them; the mode is the only average for non-numerical data. Say why you chose one when a question asks.

Can a data set have more than one mode?

Yes. If two values are equally the most common, both are modes (bimodal). If every value appears once, there is no mode.

Why do different calculators give different quartiles?

There are several conventions. This tool uses the one graphic calculators use (the medians of the two halves, leaving out the median when n is odd). For a large data set or a cumulative frequency graph, use the method your course teaches.

More maths tools