Two questions that share one word
"Percentile" is used for two different operations that run in opposite directions. Given a value, what fraction of the data lies below it — that is a percent rank. Given a percentage, which value sits at that point in the data — that is a percentile value. The first mode on this page answers the first question, the second mode the second. They are not clean inverses of each other, and small datasets are where that shows.
Whichever direction you are going, percent rank and "top x percent" always add to 100. A percent rank of 90 is the top 10 percent. This page prints both, because the swap between them is the single most common misreading of a percentile figure.
The three methods, and where they split
Take the data 1, 2, 3, 4 and ask for the 25th percentile. With four values, ranks run 1 to 4 and 25 percent does not land on one of them, so every method has to decide what to do about the gap. They decide differently.
| Method | Rank formula | Rank here | Answer | Called |
|---|---|---|---|---|
| Nearest rank | ceil(p x n) | ceil(1.0) = 1 | 1 | The classic textbook definition |
| Exclusive interpolation | p x (n + 1) | 1.25 | 1.25 | Excel PERCENTILE.EXC, R type 6 |
| Inclusive interpolation | p x (n - 1) + 1 | 1.75 | 1.75 | Excel PERCENTILE.INC, numpy default, R type 7 |
All three are correct, in the sense that each is a published, defended, widely implemented definition. The spread here is 0.75 on data whose full range is 3 — a quarter of the entire spread — produced by nothing but the choice of convention.
The reasoning behind each is straightforward once you see it. Nearest rank refuses to invent values: it returns an actual data point, always, which is what you want if quoting a value nobody scored would be misleading. Inclusive interpolation stretches the ranks so that the 0th percentile is exactly the minimum and the 100th is exactly the maximum, treating your data as the whole story. Exclusive interpolation assumes your data is a sample from something larger, with unobserved values past both ends; that is why it uses n + 1, and why it refuses to compute anything below 1/(n+1) or above n/(n+1). At n = 4 that means it cannot give you a 10th or a 90th percentile at all.
What this page reports
The percentile-value mode leads with inclusive linear interpolation, because it matches the most widely used defaults — Excel's PERCENTILE.INC and QUARTILE.INC, numpy's percentile, pandas' quantile, and R's type 7 — and because it always returns an answer. Both alternatives are printed on the same screen with their rank arithmetic shown, so the number you quote is a choice you made rather than one a default made for you.
The percent-rank mode uses the mid-rank convention: count everything strictly below your value, add half of anything tied with it, divide by n. Halving the ties keeps the measure symmetric, so a value sitting inside a group of identical values lands at 50 percent rather than at 0 or 100 depending on which comparison the code happened to use. The strictly-below and below-or-equal versions are shown too. Excel's PERCENTRANK.INC divides by n - 1 and interpolates between neighbours, so it is a fourth answer again; if you are reconciling against a spreadsheet, that is the line to check.
Quartiles inherit the whole argument
The first quartile is the 25th percentile, so every disagreement above lands on quartiles too, and from there on the interquartile range and on box plots. Excel ships both QUARTILE.INC and QUARTILE.EXC for this reason. Tukey's hinges, which is what many hand-drawn box plots use, is yet another rule, based on splitting the sorted data at the median and taking the median of each half. On 1, 2, 3, 4 the lower hinge is 1.5, a fourth distinct answer to the same question. When two box plots of the same data look different, the definition is usually the cause and the data is usually fine.
The normal mode, and its limits
When you have no list — only a mean and a standard deviation — the third mode converts your value to a z-score and reads off the cumulative normal probability. z = +1 is roughly the 84th percentile, z = +2 roughly the 97.7th. The approximation used is the standard Abramowitz and Stegun rational form, accurate to better than a millionth of a percentage point, which is far tighter than the assumption it rests on.
That assumption is the weak part, not the arithmetic. The normal model needs a symmetric bell shape, and it fails in the places people most often reach for it: incomes and prices, which have a long right tail; easy tests, where scores pile up against a ceiling; and any measure that mixes two populations, which shows two peaks. In all of those the model can be off by tens of percentage points in the tails, which is exactly where percentiles usually get quoted. Get the standard deviation from the standard deviation calculator if you need it, and use the list modes here whenever you have the list.
Reading a percentile without over-reading it
A percentile is a position, not a score and not a quality. A child at the 25th weight percentile on a growth chart is lighter than three quarters of their peers, and that is a description rather than a diagnosis. A percent rank of 99 in a group of 40 people means one thing; in a group of 40,000 it means something else entirely, which is why this page prints the count next to the percentage. And near the top of any distribution percentiles compress badly: with 10,000 candidates a single extra correct answer can move you several percentile points, so treat differences of a point or two at the extremes as noise rather than signal.
Questions people ask
Why does Excel give me a different percentile than this page?
Almost certainly because of which function you used. PERCENTILE.INC uses the rank formula p(n-1)+1 and PERCENTILE.EXC uses p(n+1), and on 1, 2, 3, 4 at the 25th percentile those give 1.75 and 1.25 respectively. The bare legacy PERCENTILE is the inclusive one. This page leads with the inclusive answer to match that default, and prints the exclusive and nearest-rank answers beside it with their rank arithmetic, so you can see which formula produced which number. If you are comparing percent ranks rather than percentile values, PERCENTRANK.INC uses a further different rule again and will not match the mid-rank convention used here.
Is the 50th percentile the same as the median?
Yes, under both interpolation methods, and that is not an accident. Both put p = 0.5 at the exact centre of the ranks: inclusive gives 0.5(n-1)+1 and exclusive gives 0.5(n+1), and those are the same number for every n. So the methods that disagree at the quartiles agree exactly at the median, which is one practical reason to prefer the median when you need a summary that will survive being recomputed in someone else's software. Nearest rank differs slightly on even counts, because it returns a real data point rather than the midpoint of the two middle values.
Is the 50th percentile the same as the mean?
No, except by coincidence. The median is the value in the middle by position; the mean is the balance point by magnitude. They agree on symmetric data and part company on anything skewed, sometimes drastically. On income data the mean commonly sits somewhere around the 60th to 70th percentile, meaning most people earn less than the average. If you want the percent rank of the mean itself, put the mean into the rank mode and read the answer — it is often more revealing about the shape of your data than either statistic alone.
How many data points do I need before percentiles mean anything?
For the middle of the distribution, a few dozen is workable. For the tails, far more than people assume. A 99th percentile estimated from 100 observations is determined by essentially one data point, and the three methods on this page will not even agree closely on it. A rough working rule is that you want at least ten observations beyond the percentile you are quoting, so a 95th percentile wants 200 or more values behind it and a 99th wants a thousand. Below that, quote the maximum and the count instead; that is honest, where a precise-looking extreme percentile is not.