A percentile is the value in a distribution below which a stated percentage of observations falls. In statistics, the 90th percentile of a dataset is the value that about 90 percent of observations are at or below, so percentiles describe both the position of a single value and the shape of a whole distribution.
Percentiles belong to the family of quantiles, which divide ordered data into equal-probability parts. The median is the 50th percentile, the quartiles are the 25th, 50th and 75th percentiles, and deciles split the data into tenths. Because they depend only on order, percentiles are robust to outliers in a way that the mean and standard deviation are not.
How a percentile is calculated
Calculating a percentile starts by sorting the observations in ascending order. For a sample of n values and a target proportion p between 0 and 1, the method computes a rank position in the sorted list and reads, or interpolates, the value at that position.
A widely used definition, the default in many spreadsheet and numerical libraries, sets the position to h = (n − 1) × p + 1 and linearly interpolates between the two neighboring values when h is not a whole number. With 11 sorted values and p = 0.9, h equals 10, so the 90th percentile is exactly the tenth value. With 10 values, h equals 9.1, so the result lies one tenth of the way from the ninth value to the tenth.
Several definitions exist, and they give different answers on small samples. The table below shows the main families.
| Method | How it picks the value | Typical behavior |
|---|---|---|
| Nearest rank | Smallest value with rank at or above p × n | Always returns an observed value |
| Linear interpolation (inclusive) | Interpolates at position (n − 1) × p + 1 | Smooth, never outside the data range |
| Exclusive interpolation | Interpolates at position (n + 1) × p | Undefined for extreme p on small samples |
| Lower or higher | Takes the value just below or above the position | Conservative or generous bound |
| Approximate sketches | Estimates from compressed summaries | Small error, works on huge streams |
On large datasets the methods converge, but with fewer than about 100 observations the choice can noticeably change high percentiles, so reports should state which definition was used.
Percentile, percentile rank and related measures
A percentile and a percentile rank answer opposite questions. The percentile starts from a percentage and returns a value, while the percentile rank starts from a value and returns the share of observations at or below it. A test score of 82 may be the 75th percentile, and the score of 82 therefore has a percentile rank of 75.
| Measure | What it describes | Sensitivity to outliers |
|---|---|---|
| Percentile | Value at a chosen position in the ordered data | Low, except at extreme percentiles |
| Median | Middle value, the 50th percentile | Very low |
| Mean | Arithmetic average of all values | High |
| Interquartile range | 75th minus 25th percentile | Low |
| Standard deviation | Typical distance from the mean | High |
Percentile-based spread measures complement the variance. The interquartile range (IQR) covers the middle half of the data and underlies the box plot, where points beyond 1.5 × IQR from the quartiles are commonly flagged as potential outliers.
Typical percentiles and what they are used for
Different fields focus on different parts of the distribution. Central percentiles summarize typical behavior, while upper percentiles describe the tail, where rare but costly events live.
| Percentile | Common name | Typical use |
|---|---|---|
| 25th and 75th | First and third quartiles | Box plots, IQR, salary bands |
| 50th | Median, p50 | Typical income, typical response time |
| 90th and 95th | p90, p95 | Service levels, capacity planning |
| 99th and 99.9th | p99, p999 | Tail latency in large systems |
| 3rd to 97th | Reference ranges | Growth charts, clinical reference values |
In performance engineering, p99 latency matters because a single user request often fans out to many backend calls. When a page depends on dozens of services, the slowest call dominates, so a rare delay at the service level becomes a common delay at the user level.
Working with percentiles correctly
Percentiles are easy to compute but easy to misuse in aggregation. The most important rule is that percentiles cannot be averaged: the mean of hourly p95 values is not the daily p95, and percentiles from separate servers cannot be combined into a fleet percentile by simple arithmetic.
- Combine data, not results: merge raw values or mergeable histograms and sketches, then compute the percentile.
- Report the sample size with high percentiles, because a p99 from 50 observations rests on one or two points.
- Use weighted percentiles when observations represent different population sizes, as in survey data.
- Check ties and discrete data, where several percentiles may share one value.
The table below lists frequent errors, their cause and a reliable fix.
| Mistake | Why it is wrong | Better approach |
|---|---|---|
| Averaging percentiles | Percentiles are not additive | Recompute from merged data or sketches |
| High percentile on tiny samples | Result depends on one or two points | Collect more data or report the maximum |
| Mixing calculation methods | Tools disagree on small samples | Fix one definition across reports |
| Reading p95 as a guarantee | Five percent of cases still exceed it | Also inspect p99 and the maximum |
| Ignoring weights | Unequal groups distort the result | Use weighted percentiles |
Limitations of percentiles
A percentile describes one point of a distribution and says nothing about the rest. Two datasets can share the same median and quartiles while having very different tails, so a small set of percentiles is a summary, not a full description. Plotting a histogram or a cumulative distribution often reveals what the numbers hide.
Extreme percentiles also carry large sampling uncertainty. Estimating a p99.9 reliably requires many thousands of observations, and confidence intervals obtained by bootstrapping or order-statistic methods are often surprisingly wide.
The idea in brief
Imagine lining up 100 people from shortest to tallest. The person standing at position 90 marks the 90th percentile of height: about 90 people are shorter or the same height, and about 10 are taller.
A percentile simply tells you where a value stands within a group. The main idea is position, not average, which is why a percentile is not pulled around by one unusually tall person the way an average would be.
A practical scenario
An engineering team runs an online checkout service that handles about two million requests per day. The average response time is 180 milliseconds, which looks healthy, yet customers still complain about slow payments.
The team records every request duration in a mergeable histogram per server and computes percentiles over the combined data. The p50 is 140 milliseconds, the p95 is 420 milliseconds and the p99 is 2.1 seconds, revealing that roughly 20,000 requests a day are painfully slow. Tracing those requests shows a lock contention problem in the inventory check. After the fix, the p99 drops to 600 milliseconds while the average barely changes, and the team sets its service objective on p99 rather than the mean so the tail stays visible.