MathsStatistics & Probability

Percentile
calculator.

A percentile tells you where a value sits among the others in a set of numbers.

How it's worked out

A percentile answers two opposite questions. The value at a percentile asks where a given share of the data falls below: the 90th percentile of delivery times is the time that about 90% of deliveries beat. A percentile rank asks the reverse: given one value, what share of the data is below it?

Sort the n values so that the smallest comes first. Each rule below finds a position h in that list, with p as a share between 0 and 1. The ⌈ ⌉ brackets mean round up to a whole number.

inclusive: h\displaystyle \text{inclusive: } h=(n−1)p+1\displaystyle {}= (n - 1)p + 1
exclusive: h\displaystyle \text{exclusive: } h=(n+1)p\displaystyle {}= (n + 1)p
nearest rank: h\displaystyle \text{nearest rank: } h=⌈np⌉\displaystyle {}= \lceil np \rceil

If h is not whole, the inclusive and exclusive rules move part of the way from the value at the whole part of h to the next one. Write k for that whole part and d for what is left over, and the answer is:

x(k)+d(x(k+1)−x(k))x_{(k)} + d\,\bigl(x_{(k+1)} - x_{(k)}\bigr)

There is more than one rule because a list of separate values has no single right place for "75%". NIST names them R6, R7 and R8 after the Hyndman and Fan survey. R6 is the exclusive rule here, R7 the inclusive rule that NIST says Excel uses, and any of the three is generally fine. Nearest rank never blends two values, so its answer is always one of yours.

For a rank, count the values below yours and the values equal to it, then divide by n. Ties need a choice, because counting them or not moves the answer.

rank\displaystyle \text{rank}=below+0.5×equaln×100\displaystyle {}= \frac{\text{below} + 0.5 \times \text{equal}}{n} \times 100

Worked examples

The top quarter of a class test

Twelve students scored between 8 and 67. By the inclusive rule, h = 11 × 0.75 + 1 = 9.25. That is a quarter of the way from the 9th score, 45, to the 10th, 51, which gives 46.5.

Nobody scored 46.5 exactly, and that is normal for an interpolated percentile. Turn the question around and a score of 38 has 7 scores below it and 1 equal to it, for a rank of 62.5 with half of the tie counted.

Open this example in the tool

The 90th percentile of 12 wafer readings

NIST works this one by hand on 12 silicon wafer resistivity readings. The position is 0.9 × 13 = 11.7, so the exclusive rule gives 95.1981 ohm.cm. The inclusive rule gives 95.1957 from the same readings.

The two differ only from the third decimal place on here, because the readings sit close together. In a small set with widely spaced values at the top, the gap between rules can be much larger.

Open this example in the tool

Three students tied on 70

In the scores 60, 70, 70, 70, 80, 90, three people have 70. Only 1 score is below it, so strictly below gives a rank of 16.67. Counting half of the ties gives 41.67, and at or below gives 66.67. The same student can be reported three ways, so say which rule you used.

Open this example in the tool

Reading your result

A percentile is a position, not a score. Getting 80% of the questions right says nothing about rank. If most people did better, 80% could be a low percentile.

Rules agree in the middle and part ways at the ends. The table shows the rules on the five values 15, 20, 35, 40, 50. At the median they match, and at the 90th percentile they run from 46 to 50. The gap shrinks as the data grow.

Three rules on five values
RuleP25P50P90
Inclusive203546
Exclusive17.53550
Nearest rank203550

Be careful far out in the tails. The exclusive rule needs at least 19 values to place the 95th percentile and 99 to place the 99th. With fewer, NIST sets the result to the maximum, and so does this tool, while Excel returns an error when it cannot interpolate.

Percentiles ignore how far out an extreme value is. Double the largest of 100 values and the median does not move. That helps with stray readings, but it hides how bad the worst case was, so look at the maximum as well.

Common mistakes

  • Comparing percentiles from different software without checking the rule. A spreadsheet and a statistics package can both be right and still disagree. Set the method to match before you call either one wrong.
  • Reporting a 99th percentile from 20 values. It is set almost entirely by the largest value, so one new reading could move it far.
  • Averaging percentiles from separate groups. The 95th percentile of the whole is not the average of each group's 95th percentile. Pool the raw values and work it out again.
  • Using this on growth charts. Percentiles here describe your own data. A child's growth percentile comes from a reference population, so use the baby percentile calculator for that.

Questions people ask

A percentage compares your marks with the maximum possible. A percentile compares you with other people. A student on 60% can be at the 90th percentile if the paper was hard, and the two only match by chance.

Sources