Percentile

On this page 7

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.

MethodHow it picks the valueTypical behavior
Nearest rankSmallest value with rank at or above p × nAlways returns an observed value
Linear interpolation (inclusive)Interpolates at position (n − 1) × p + 1Smooth, never outside the data range
Exclusive interpolationInterpolates at position (n + 1) × pUndefined for extreme p on small samples
Lower or higherTakes the value just below or above the positionConservative or generous bound
Approximate sketchesEstimates from compressed summariesSmall error, works on huge streams
Common percentile calculation methods

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.

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.

MeasureWhat it describesSensitivity to outliers
PercentileValue at a chosen position in the ordered dataLow, except at extreme percentiles
MedianMiddle value, the 50th percentileVery low
MeanArithmetic average of all valuesHigh
Interquartile range75th minus 25th percentileLow
Standard deviationTypical distance from the meanHigh
Percentile compared with neighboring statistics

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.

PercentileCommon nameTypical use
25th and 75thFirst and third quartilesBox plots, IQR, salary bands
50thMedian, p50Typical income, typical response time
90th and 95thp90, p95Service levels, capacity planning
99th and 99.9thp99, p999Tail latency in large systems
3rd to 97thReference rangesGrowth charts, clinical reference values
Common percentiles in practice

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.

MistakeWhy it is wrongBetter approach
Averaging percentilesPercentiles are not additiveRecompute from merged data or sketches
High percentile on tiny samplesResult depends on one or two pointsCollect more data or report the maximum
Mixing calculation methodsTools disagree on small samplesFix one definition across reports
Reading p95 as a guaranteeFive percent of cases still exceed itAlso inspect p99 and the maximum
Ignoring weightsUnequal groups distort the resultUse weighted percentiles
Common percentile mistakes

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.