# Percentiles: What They Are and How to Calculate Them

A percentile is a measure of position. It tells you what percentage of the values in a dataset are less than or equal to a given data value. If your exam score is at the 90th percentile, then 90% of the scores in that group are the same as or lower than yours.

## Quick Answer

- A percentile indicates the relative standing of a value in a dataset sorted from smallest to largest [1].
- The $p$th percentile is the value below which roughly $p$% of the data falls [2].
- Percentiles divide ordered data into hundredths, while quartiles divide it into quarters [1].
- To find a percentile, sort the data, compute the rank position, and interpolate between the two nearest values if the rank is not a whole number.
- A percentile is not a percentage score. Scoring in the 90th percentile does not mean you got 90% correct [1].

## What Percentile Means

In plain terms, a percentile answers the question "where does this value sit compared with everything else?" It converts a raw number into a rank. A value at the 25th percentile is near the bottom of the group. A value at the 90th percentile is near the top.

The precise statistical definition is this: a data value $x$ is the $p$th percentile of a dataset if $p$% of the data values are less than or equal to $x$ [2]. The number $p$ is called the percentile rank of $x$. Low percentiles always correspond to lower data values, and high percentiles always correspond to higher data values [1].

Percentiles are useful for comparing values across different scales. Universities use them when interpreting SAT results, for example, by setting a minimum score tied to a percentile cutoff [1]. Doctors use them to track a child's growth against a reference population [2].

## How It Works

The core idea is to convert a percentile into a position in the sorted data. One common method, the linear interpolation method used by Excel's PERCENTILE.INC and by NumPy's default, works like this.

Sort the data from smallest to largest. Let $n$ be the number of values. Then compute the rank:

$$r = (n - 1) \times \frac{p}{100}$$

Here is what each symbol means:

- $n$ is the number of data values.
- $p$ is the percentile you want, such as 90 for the 90th percentile.
- $r$ is the rank position in the sorted list, counting from 0.

If $r$ is a whole number, the percentile is the value at that position. If $r$ falls between two positions, you interpolate. Let $i$ be the integer part of $r$ and let $f$ be the fractional part. Then:

$$\text{percentile} = Y_{[i]} + f \times \left(Y_{[i+1]} - Y_{[i]}\right)$$

where $Y_{[i]}$ is the $i$th value in the sorted list. This is the same "fraction" interpolation that SciPy's `scoreatpercentile` describes, where the result is $i + (j - i) \times \text{fraction}$ and fraction is the fractional part of the index [3].

Different software uses different definitions. The National Institute of Standards and Technology notes that an American Statistician article evaluated nine methods for computing percentiles, and most statistical and spreadsheet software uses one of the methods from Hyndman and Fan [4]. For most purposes, the differences between the common methods are small, especially for large samples [4].

## Worked Example

Suppose you have exam scores for 30 students in a class. You want the 90th percentile, the 25th percentile, and the 50th percentile.

| student_id | score | student_id | score | student_id | score |
|---|---|---|---|---|---|
| 1 | 42 | 11 | 72 | 21 | 82 |
| 2 | 55 | 12 | 73 | 22 | 83 |
| 3 | 58 | 13 | 74 | 23 | 84 |
| 4 | 61 | 14 | 75 | 24 | 85 |
| 5 | 63 | 15 | 76 | 25 | 86 |
| 6 | 65 | 16 | 77 | 26 | 88 |
| 7 | 67 | 17 | 78 | 27 | 90 |
| 8 | 68 | 18 | 79 | 28 | 92 |
| 9 | 70 | 19 | 80 | 29 | 95 |
| 10 | 71 | 20 | 81 | 30 | 98 |

The scores are already sorted in ascending order. The minimum is 42, the maximum is 98, and $n = 30$.

Step 1. Compute the rank for the 90th percentile:

$$r = (n - 1) \times 0.90 = (30 - 1) \times 0.90 = 26.10$$

Step 2. Bracket the rank between the two nearest sorted values. Counting from 0, position 26 holds the value 90 and position 27 holds the value 92. The fractional part is 0.10.

Step 3. Interpolate:

$$90 + 0.10 \times (92 - 90) = 90 + 0.20 = 90.2000$$

So the 90th percentile is 90.2. The 25th percentile is 68.5 and the 50th percentile is 76.5.

Here is the same calculation in Python:

```python
import numpy as np
scores = [42, 55, 58, 61, 63, 65, 67, 68, 70, 71,
          72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
          82, 83, 84, 85, 86, 88, 90, 92, 95, 98]
p25 = np.percentile(scores, 25)
p50 = np.percentile(scores, 50)
p90 = np.percentile(scores, 90)
print(p25, p50, p90)  # 68.5 76.5 90.2
```

Output:

```text
68.5 76.5 90.2
```

## How to Interpret It

The 90th percentile of 90.2 means that 90% of the scores fall at or below 90.2. In this dataset, 27 of the 30 scores, or 90.00%, are strictly below that value.

Notice that the percentile value itself, 90.2, is not a percentage. It is a score on the same scale as the original data. The percentage is the rank, not the value.

Interpretation depends on context. A high percentile is not automatically good and a low percentile is not automatically bad [1]. In an exam, a high percentile is usually good. In a measure of recovery time after surgery, a low percentile is usually good. In many situations, no value judgment applies at all [1].

Percentiles are also useful for comparing a single value to a reference group. If you know a score sits at the 85th percentile, you know that 85% of the scores in that group were less than or equal to it [2].

## When to Use It (and when not to)

Use percentiles when you want to describe position rather than magnitude. They work well for continuous data, and they are recommended for reference interval estimation [5]. They are also the natural choice when you want to compare values from different distributions or different scales.

Use them when the shape of the data matters. Percentiles do not assume a normal distribution, so they describe skewed data honestly.

Avoid percentiles when you need to compare averages or totals. A percentile tells you about one point in the distribution, not the center. Avoid them when your sample is very small, because a percentile from a handful of values is a rough estimate at best [4]. Avoid them when the audience will confuse the percentile rank with a percentage score, which is a common source of misreading.

If you need to convert between standard scores and percentiles, see [z-scores and percentiles](/blog/data-analysis/z-scores-and-percentiles). If you want the full formula walkthrough, see [how to calculate percentile](/blog/data-analysis/how-to-calculate-percentile).

## Percentile vs Percentage

These two terms sound alike and mean different things. A percentage is a fraction of a whole, expressed out of 100. A percentile is a position in a ranked dataset.

| Feature | Percentile | Percentage |
|---|---|---|
| What it measures | Position in a sorted dataset | A proportion of a total |
| Units | Same units as the data | A number out of 100 |
| Example | A score of 90.2 is the 90th percentile | Scoring 90% on a test |
| Depends on other values | Yes | No |
| Typical use | Ranking, growth charts, test norms | Rates, shares, discounts |

A student who scores 90% on a test may or may not be at the 90th percentile. The two numbers are unrelated unless the class distribution happens to line up that way. For percentage math itself, see [how to calculate a percentage](/blog/data-analysis/how-to-calculate-a-percentage).

## Common Mistakes

- **Confusing the percentile rank with the value.** The 90th percentile is a data value, not the number 90. Fix: always report both the percentile and the value, such as "the 90th percentile is 90.2 points."
- **Forgetting to sort the data first.** Percentiles depend on order. Fix: sort from smallest to largest before doing any calculation [1].
- **Using the wrong rank formula.** Some people compute $p \times n$ instead of $(n-1) \times p$. Fix: check which method your software uses and stay consistent.
- **Assuming all software gives identical answers.** Different tools use different definitions, and results can differ for small samples [4]. Fix: state the method or the tool you used.
- **Treating a percentile as a grade.** Scoring in the 90th percentile does not mean you got 90% correct [1]. Fix: explain the rank in words.
- **Ignoring ties.** When several values are equal, the percentile rank depends on how ties are handled. SciPy, for example, offers 'rank', 'weak', 'strict', and 'mean' options that give different answers for the same data [6]. Fix: decide how ties should count and document it.

## Limitations

A percentile describes one point in a distribution. It says nothing about the values above or below that point, so two datasets can share the same 90th percentile while looking completely different. It also gives no information about the center or the spread, which is why percentiles are usually reported alongside a mean, a median, or a standard deviation.

Percentiles computed from a sample are estimates of the population percentile, and their accuracy depends on sample size and on the method used [5]. For small samples, the estimate can be unstable, and different methods can produce noticeably different results [4]. Percentiles also cannot tell you whether a difference between two groups is meaningful. That requires a formal test.

## Frequently Asked Questions

### What does the 90th percentile mean?

The 90th percentile is the value below which 90% of the data falls. If your score is at the 90th percentile, then 90% of the scores in that group are the same as or lower than yours, and 10% are the same as or higher [1]. The percentile value is expressed in the same units as the data, not as a percentage.

### How do you calculate a percentile by hand?

Sort the data from smallest to largest. Compute the rank with $r = (n-1) \times p/100$, where $n$ is the number of values and $p$ is the percentile. If $r$ is a whole number, take the value at that position. If not, interpolate between the two nearest values using the fractional part of $r$.

### Is the 50th percentile the same as the median?

Yes. The 50th percentile is the median, and it is also the second quartile, $Q_2$ [2]. It splits the data so that about half the values fall at or below it. The 25th percentile is $Q_1$ and the 75th percentile is $Q_3$ [2]. For a full quartile walkthrough, see [how to find Q1 and Q3](/blog/data-analysis/how-to-find-q1-and-q3).

### Why do different tools give different percentile values?

There are multiple accepted definitions of a percentile. A well-known review evaluated nine methods and found that no single standard was adopted, though most software uses one of them [4]. The differences are usually small for large samples but can be visible for small ones. Always note which tool or method produced your number.

### Can a percentile be a value that is not in the dataset?

Yes. When the rank falls between two data points, interpolation produces a value that may not appear in the original data. In the worked example, the 90th percentile is 90.2, which is not one of the 30 exam scores. This is expected behavior for interpolation-based methods [3].

## References

1. [2.3 Measures of the Location of the Data - Introductory Statistics 2e | OpenStax](https://openstax.org/books/introductory-statistics-2e/pages/2-3-measures-of-the-location-of-the-data)
2. [5.6: Normal Distribution and Percentiles - Mathematics LibreTexts](https://math.libretexts.org/Courses/Florida_SouthWestern_State_College/Mathematical_Thinking_MGF_1130_(FSW)/05%3A_BASIC_OF_STATISTICS/5.06%3A_Normal_Distribution_and_Percentiles)
3. [scoreatpercentile, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.scoreatpercentile.html)
4. [7.2.6.2. Percentiles](https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm)
5. [Estimation of population percentiles - PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC3171208/)
6. [percentileofscore, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.percentileofscore.html)

## Related Articles

- [How Do You Calculate Percentile? Formula and Example](/blog/data-analysis/how-to-calculate-percentile)
- [Z-Scores and Percentiles: How They Relate and How to Convert](/blog/data-analysis/z-scores-and-percentiles)
- [How to Calculate a Percentage: Formula and Examples](/blog/data-analysis/how-to-calculate-a-percentage)
- [ANOVA Table Explained: Components, Formulas and Example](/blog/data-analysis/anova-table-explained)
- [How to Average Percentages Correctly (With Examples)](/blog/data-analysis/how-to-average-percentages)
- [Understanding the Z-Table: How to Use It for Probability and Percentiles](/blog/guides/understanding-the-z-table-how-to-use-it-for-probability-and-percentiles)