Quartile calculator

Quartiles, the interquartile range and the five-number summary — and, because there are nine published definitions of a quartile and they genuinely disagree, what each of the other eight would have given you. Nothing you type here leaves your browser — it is worked out on your own device, so there is nothing to send and nothing to log.

There is no such thing as the quartile

There are nine standard definitions. They are numbered 1 to 9 after Hyndman and Fan's 1996 paper, every serious statistics package implements several of them, and almost no calculator tells you which one it used.

They are not rounding differences. On 1, 6, 6, 6, 6 the nine definitions give seven different values for Q1 — 1, 2.25, 3.5, 4.33, 4.44, 4.75 and 6 — which is the entire range of the data. Every one is right under a published definition.

How often do they disagree? Measured.

Swept rather than guessed at. Over every sorted dataset of the integers 1 to 6 with between four and eight values — 5,838 dataset-and-quartile pairs — the nine definitions disagree on 51.3% of them.

Over twenty thousand random datasets of real numbers they disagree on essentially all of them, with a median gap of about six per cent between the highest and lowest answer, and a ninetieth percentile of twenty-eight per cent.

Even the two your spreadsheet offers — PERCENTILE.INC and PERCENTILE.EXC, which are types 7 and 6 — differed on twenty thousand of twenty thousand.

Which one should you use?

If you are matching somebody else's figures, use theirs: type 7 for R, numpy or Excel's PERCENTILE.INC; type 6 for Minitab, SPSS or PERCENTILE.EXC; type 3 for SAS.

If you are choosing freely, Hyndman and Fan recommend type 8 — its estimate is median-unbiased whatever the underlying distribution, which is a property none of the others has in general. It is almost nobody's default.

What matters more than the choice is saying which one it was. A quartile quoted without its definition is a number somebody else cannot reproduce.

Where to go next