Bell Statistics

What is a percentile?

A percentile is the value below which a given share of observations falls: the 95th percentile is the point 95% of values sit under. Percentiles describe the shape of a distribution where an average collapses it into one misleading number.

Also called
quantile, p95, p99, percentile metric
Allon Korem

Written by Allon Korem

Chief Executive Officer

Last updated

In plain English

A percentile locates a point in a distribution rather than summarising it. The 50th is the median, the 95th is the value 95% of observations fall below, and the 99th is where the worst one per cent begins. For anything skewed — latency, revenue, session length — a handful of percentiles describes the shape far better than a mean, which compresses everything into one number that may correspond to no actual user.

Latency is the standard case and it makes the argument concretely. Mean page load time of 800ms sounds acceptable. If the 95th percentile is 4.2 seconds, then one visit in twenty is taking over four seconds, and those are the visits people abandon. The mean cannot distinguish a system that is uniformly slightly slow from one that is fast for most people and occasionally terrible, and only the second loses customers. That is why performance work is specified in percentiles and monitored in percentiles.

The property that trips people up is that percentiles do not average. The mean of yesterday's p95 and today's p95 is not the p95 of the two days combined, because a percentile depends on the whole ordered distribution rather than on a total that can be summed. Any system reporting a p95 per hour and then averaging those to produce a daily figure is producing a number that is not a percentile of anything, and the error can be substantial when traffic varies across the day.

The same property makes them awkward in experiments. There is no simple formula for the standard error of a difference in percentiles, so the bootstrap is the standard route — resample whole users, recompute the percentile difference, and read the interval off the resampling distribution. It is more computation than a t-test and it is usually the only honest option for a percentile metric.

They are also inherently less precise than means, because a percentile depends on the observations near it rather than on all of them. Estimating p99 from ten thousand observations rests on the hundred largest, so its confidence interval is wide, and extreme percentiles are noisy enough that p99.9 on a modest sample is barely a measurement. p95 is usually the practical limit for experiment-scale data.

The formula

The definition, the two things that follow from it, and the estimator used in practice.

The definition
P( X ≤ q_p ) = p

q_95 is the value 95% of observations fall below. The median is q_50.

Why they cannot be averaged
q_p( A ∪ B ) ≠ mean( q_p(A), q_p(B) )

A percentile depends on the whole ordered set. Averaging hourly p95s does not give a daily p95.

Precision
SE( q_p ) ∝ 1 / ( f(q_p) · √n )

f is the density at that point. In a sparse tail the density is low, so extreme percentiles are imprecise.

In an experiment
cluster bootstrap the difference in percentiles

No clean analytic standard error exists — see bootstrap.

Worked example

Two versions of a page are compared on load time across 180,000 sessions from 48,000 users. The means are nearly identical, and the team looks at the distribution rather than stopping there.

Mean load time: A / B
812ms / 798ms
Median (p50): A / B
640ms / 705ms
p95: A / B
4,210ms / 1,890ms
p99: A / B
9,800ms / 2,640ms
Sessions over 3 seconds: A / B
8.9% / 1.4%
p95 difference, clustered bootstrap CI
−2,320ms (−2,690 to −1,950)

The means differ by 14ms and say nothing. The 95th percentile differs by 2.3 seconds, and version B is dramatically better at the tail.

This is the case percentiles exist for. Version B is slightly slower for the typical user — the median rises from 640 to 705ms — and enormously better for the users having a bad time, cutting the share of sessions over three seconds from 8.9% to 1.4%. The mean averages those two effects into 14ms and reports nothing at all. Which version to ship depends on what you believe about the relationship between load time and abandonment, and the usual answer is that the tail matters more, since a 65ms difference is imperceptible and a four-second wait is where people leave. Two technical notes. The interval comes from a bootstrap clustered by user, because 180,000 sessions from 48,000 users are not independent, and treating them as such would have given an interval roughly half as wide. And p99 is reported here as descriptive context rather than as a tested quantity — at this sample size its interval would be wide enough that the difference, while clearly large, would not be tightly estimated.

Common misconceptions

The 95th percentile is the average of the worst 5%.
It is the boundary, not the average beyond it. p95 of 4.2 seconds means one visit in twenty exceeds 4.2 seconds — some of those may be far worse. The average of the values above p95 is a different quantity, sometimes called the conditional tail expectation, and it is the one worth reporting when the severity of the tail matters.
You can average percentiles across time periods or servers.
You cannot. A percentile depends on the whole ordered distribution rather than on a sum, so the mean of hourly p95 values is not the daily p95 and can be badly wrong when traffic varies. Computing a percentile over a period requires the underlying observations for that period, which is why monitoring systems store sketches rather than pre-aggregated percentiles.
Higher percentiles give a more precise view of the tail.
They describe the tail in more detail and estimate it less precisely, because they depend on fewer observations. p99 from ten thousand data points rests on the largest hundred, and p99.9 on the largest ten. Extreme percentiles have wide confidence intervals and move a great deal between samples; p95 is usually the practical limit at experiment scale.

Frequently asked questions

Which percentile should I monitor?
p50 and p95 as the standard pair: the median describes the typical experience and p95 describes the bad one, and the gap between them tells you whether the system is uniformly mediocre or usually fine with a bad tail. p99 is worth watching for infrastructure where the worst cases are expensive, accepting that it is noisier. Beyond p99 you generally need far more data than an experiment provides.
How do I test whether a percentile changed between two variants?
Bootstrap it. There is no simple analytic standard error for a difference in percentiles, so resample — clustering by user if one user contributes many observations — recompute the percentile difference on each resample, and read the interval from the resulting distribution. Ten thousand resamples is a sensible default, and the clustering matters more than the count.
When is a mean better than a percentile?
When the quantity is additive and totals are what matter — revenue, orders, sessions. The mean multiplied by the population gives the total, which no percentile does, and that makes it the right summary for anything with a budget attached. Percentiles win where the distribution's shape carries the meaning and extreme values represent a real experience rather than an arithmetic contribution.

Related terms

  • Outlier

    The extreme value that decides your result — and why the rule for handling it must precede the data.

  • Sampling distribution

    Not how your data is distributed — how your estimate would be, across repeats you never ran.

  • Skewness

    The asymmetry that pulls the mean away from the median, and quietly decides how much traffic your test needs.

  • Winsorization

    Pull the tail in rather than cutting it off — and choose the threshold before you see the results, or it is not a method.

Calculate it

  • Proportion confidence interval

    A defensible interval around one rate — Wilson, Agresti-Coull, Jeffreys and Clopper-Pearson, side by side.

  • Two-sample t-test

    Compare the average of two independent groups — plan the sample size, then test the result.

Knowing the term is the easy part

Applying it to a live measurement problem is the part that goes wrong. If you are designing an experiment, reading a result you do not trust, or trying to work out what your marketing actually caused, that is the work we do.