Percentile

Sorts the data and finds the value that a given share of it falls below. The 50th percentile is the median. When the rank is not a whole number, the value is interpolated between its two neighbours.

A percentile tells you the value below which a given share of the data lies. The 90th percentile is the point with 90% of the data at or beneath it. The 50th percentile is exactly the median.

The position is found like this.

r=(n1)×p100r = (n - 1) \times \dfrac{p}{100}

The position is counted from 0. Multiplying by n1n - 1 rather than nn is what makes 0% land exactly on the minimum and 100% exactly on the maximum.

When the position is not a whole number, the value is interpolated between its two neighbours. A position of 8.1 means one tenth of the way from the value at index 8 towards the value at index 9.

Example

Take the default data 12, 15, 18, 20, 25, 30, 33, 38, 42, 50 and ask for the 90th percentile. There are 10 values, already in order.

The position is (101)×0.9(10 - 1) \times 0.9, which is 8.1. Counting from 0, index 8 holds 42 and index 9 holds 50, so go one tenth of the way between them: 42+0.1×(5042)42 + 0.1 \times (50 - 42) gives 42.8.

Check the 50th percentile too. The position is 9×0.59 \times 0.5, or 4.5, exactly halfway between the 25 at index 4 and the 30 at index 5, giving 27.5. That matches the median of an even-sized data set.

Points to watch

There is more than one way to define a percentile. The interpolating method used here is the one found in spreadsheets and scientific libraries. Others skip the interpolation and return the value at the nearest rank.

This calculator's quartile tool follows the Japanese textbook definition, splitting the data at the median and taking the median of each half. Because the definitions differ, the 25th percentile and the first quartile can disagree on the same data. Here they give 18.5 and 18 respectively. Neither is wrong; they are simply different conventions.

Response times are commonly reported at the 95th or 99th percentile. An average lets a handful of very slow responses be diluted away, whereas a high percentile supports the statement that almost every user saw something faster than this.