Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path
Percentile Calculator
Drop in a list of latencies (or any numbers) and get p50, p90, p95 and p99 instantly, plus min, max and mean — with the sorted distribution drawn as a histogram and each percentile marked on it. See exactly why the average hides your worst requests and the tail is what users feel.
Bars show how many values fall in each range; the vertical lines mark p50, p90, p95 and p99. Notice how the tail percentiles sit far to the right of the median.
The average hides the requests your users complain about, and percentiles show them. Paste a list of numbers, typically latencies in milliseconds, and the tool returns the median and the tail, p50, p90, p95 and p99, with the mean, the minimum and the maximum. It also draws the distribution as a histogram with each percentile marked on it.
What it computes
Every number in the text is extracted, whatever separates them, and the list is sorted in ascending order. Percentiles use linear interpolation between closest ranks, known as Hyndman and Fan type 7, the default in NumPy, in R and in Excel’s PERCENTILE.INC.
sorted values x[0] ≤ x[1] ≤ … ≤ x[n − 1] positions from zero
rank h = p ÷ 100 × (n − 1)
neighbors lo = floor(h), hi = ceil(h)
percentile x[lo] + (h − lo) × (x[hi] − x[lo])
mean sum of all values ÷ n
Here p is the percentile wanted, 50, 90, 95 or 99, and n is the number of values. When h is a whole number the percentile is that exact value; otherwise it sits the fraction h − lo of the way from one sorted value to the next. Whole-number results show no decimals; others show two decimals below 100 and one decimal from 100 up. The histogram splits the range from minimum to maximum into 24 equal-width bins.
A worked example
The default sample holds 40 latencies: 34 between 19 and 55 ms, and six slow ones of 67, 88, 185, 210, 320 and 540 ms. With n = 40, each rank is p ÷ 100 × 39:
| Percentile | Rank h | x[lo], x[hi] | Interpolation | Shown |
|---|---|---|---|---|
| p50 | 19.5 | 36, 37 | 36 + 0.5 × 1 | 36.50 |
| p90 | 35.1 | 88, 185 | 88 + 0.1 × 97 | 97.70 |
| p95 | 37.05 | 210, 320 | 210 + 0.05 × 110 | 215.5 |
| p99 | 38.61 | 320, 540 | 320 + 0.61 × 220 | 454.2 |
The values sum to 2,593, so the mean is 2,593 ÷ 40 = 64.83, and the range is 19 to 540. The mean is nearly twice the median and higher than 34 of the 40 values: six slow requests pulled it to a place where almost no request lives. Meanwhile p95 is about six times the median and p99 about twelve. The histogram shows the same story, with 34 of the 40 values in the first two of its 24 bins and a long, sparse tail to the right.
Assumptions and limits
- Small samples make a jumpy tail. With 40 values, p99 is an interpolation between the two largest numbers, so one outlier moves it a lot. A tail percentile is only stable when several samples lie beyond it, which for p99 means several hundred values or more.
- Definitions differ on small samples. The nearest-rank method, which always returns an observed value, gives 88, 210 and 540 for p90, p95 and p99 on the default data.
- Simple parsing. Digits with an optional minus sign and decimal part are read, so
1,250becomes 1 and 250,1e3becomes 1 and 3, and the dash in10-20makes −20. Units such as120msare fine. - Unweighted and exact. Each number counts once and every value is sorted. Bucketed counts must be expanded first, and monitoring systems at scale use histograms or sketches that only approximate these figures.
How to use the result
- Set targets on percentiles. Use p50 for the typical experience and p95 or p99 for the tail, as in an SLO of p99 under 300 ms.
- Remember fan-out. If a page makes 10 parallel calls, the chance that at least one is at or beyond its p99 is
1 − 0.99^10 ≈ 9.6%, so roughly one page load in ten feels a backend’s tail. - Compare the mean with the median. A mean far above the median means a few slow requests dominate; investigate those first, such as timeouts, retries, cold starts or garbage-collection pauses.
- Never average percentiles. The mean of each server’s p99 is not the fleet p99. Merge raw samples or histograms, then compute.
- Split two humps. The Bimodal preset puts p50 at 15.50 in the fast cluster and p90 at 96.10 in the slow one, so neither number describes the other group. Separate populations such as cache hits and misses before setting a target.
When to use it, and when not
Use it on a few dozen to a few thousand raw values: a latency column from a log query, timings from a benchmark run, before-and-after samples from a change. It is ideal for seeing whether the tail moved, for explaining why a mean misleads, and for checking a figure someone quoted from a small test.
It is the wrong tool for production monitoring at scale. Millions of requests are summarized by histograms or sketches in the metrics system, and the right percentile there is computed by that system over its own window. It also cannot read pre-bucketed data without expanding it, and it should not be used to judge an SLO on a few values, where one sample decides the answer.
Trade-offs and limits
Percentiles are robust in the middle and fragile at the edge. Change only the slowest request in the default sample and watch which numbers move:
| Slowest value | p50 | p90 | p95 | p99 | Mean |
|---|---|---|---|---|---|
| 540 (default) | 36.50 | 97.70 | 215.5 | 454.2 | 64.83 |
| 5,400 | 36.50 | 97.70 | 215.5 | 3,418.8 | 186.3 |
| Removed (39 values) | 36 | 71.20 | 187.5 | 278.2 | 52.64 |
A tenfold outlier leaves p50 to p95 untouched and nearly triples the mean. Deleting one value moves every tail figure, because the ranks shift. How many samples sit beyond a percentile is roughly n × (1 − p/100): with 40 values only 0.4 lie beyond p99, with 1,000 values there are 10. Below about 10, a tail percentile describes a handful of requests, not a trend.
Common mistakes
- Leaving out failures. Timeouts and errors are often dropped from latency data because they have no clean duration. They are usually the slowest requests, so removing them makes the tail look better than users find it.
- Coordinated omission. A load tester that waits for each response before sending the next sends fewer requests while the system is slow, so the slow period is under-sampled. Test at a fixed request rate, or the measured p99 flatters the system.
- Adding stage percentiles. The p99 of a request is not the sum of its stages’ p99s, because the stages rarely hit their tail together. The sum usually overstates the end-to-end tail; measure end to end.
- Comparing runs of different sizes. A p99 from 50 samples and one from 50,000 are not the same measurement. The small run’s figure sits between its two slowest values and can swing by hundreds of milliseconds on one request.
Check yourself
With the Uniform preset, the numbers 1 to 100, what is p90?
h = 0.9 × 99 = 89.1. Counting from zero, x[89] = 90 and x[90] = 91, so p90 is 90 + 0.1 × 1 = 90.1. The nearest-rank method would say 90.
A page makes 20 parallel backend calls. What share of page loads wait on at least one call at or beyond its p99?
1 − 0.99²⁰ = 18.2%, nearly one load in five. At 100 calls it is 63.4%, so for a big fan-out the backend p99 is the typical page experience.
In the default sample, the 540 becomes 5,400. Which outputs change?
Only p99, the mean and the maximum. p99 becomes 320 + 0.61 × 5,080 = 3,418.8 and the mean rises to 186.3, while p50, p90 and p95 stay put because their ranks never reach the last value.
Roughly how many samples do you need for about 10 values to lie beyond p99?
About 1,000, because 1,000 × 0.01 = 10. For p99.9 the same rule needs about 10,000.
How it works
- Percentile rank = p/100 × (n − 1) in the sorted list, then interpolate.
- p50 is the median; p90 / p95 / p99 describe the tail your users feel.
- The mean is skewed by outliers; percentiles describe the real distribution.
- Paste any separator: spaces, commas, tabs or newlines all parse.
Frequently asked questions
How is a percentile calculated?
Sort the values, then compute the rank h = p/100 × (n − 1), counting positions from zero. If h is a whole number, the percentile is the value at that position; if it falls between two positions, interpolate linearly between their values. This is linear interpolation between closest ranks, known as Hyndman and Fan type 7, the default in NumPy, in R and in Excel PERCENTILE.INC, and it is what this calculator uses. For the numbers 1 to 100, p50 is 50.5, halfway between the 50th and 51st values.
What is p99 latency and why does it matter?
p99 is the value below which 99% of your measurements fall, so 1 request in 100 is slower. It matters because averages hide tail behavior: a service can post a healthy mean while 1 user in 100 waits seconds. And because a single page load often fans out to many backend calls, one service’s p99 becomes a common experience: with 10 parallel calls, about 1 page load in 10 waits on at least one call at or beyond its p99. That is why SLOs are written against p95, p99 or p99.9.
Why use percentiles instead of the average?
The mean is dragged around by outliers and hides the shape of the distribution. In the default sample here, six slow requests out of 40 lift the mean to 64.83 ms while the median is 36.50 ms, and the mean sits above 34 of the 40 values, so it describes almost no real request. Percentiles describe the distribution directly: p50 for the typical request, p90, p95 and p99 for how bad the bad cases get. The mean still has one job: multiplied by the count, it gives total work, which capacity planning needs.
What is the difference between p50 and the median?
They are the same thing. p50, the 50th percentile, is the median: the value that splits the sorted data in half. With an odd number of values it is the middle one, and with an even number it is the average of the two middle values, which is exactly what linear interpolation produces. The default sample has 40 values, so p50 lies halfway between the 20th and 21st sorted values, 36 and 37, giving 36.50. The tool labels it p50 to sit alongside p90, p95 and p99.
Why do different tools report different p99 values?
Because there are several standard definitions, and they disagree on small samples. This calculator interpolates between neighboring values. The nearest-rank method instead returns an observed value, the one at position ceiling(p/100 × n), so for the default 40 values it gives 88, 210 and 540 for p90, p95 and p99, where this tool shows 97.70, 215.5 and 454.2. Monitoring systems differ again, because they estimate percentiles from histogram buckets or sketches. With thousands of samples the methods converge, so check the definition before comparing small-sample numbers.
Can I average p99 latency across servers?
No. The average of several servers’ p99 values is not the p99 of all their requests combined, and it can be off in either direction, especially when the servers carry different traffic or have different tails. To get a fleet-wide percentile, merge the raw measurements, or merge histograms or sketches that preserve the distribution, and compute the percentile on the combined data. The same rule applies over time: averaging per-minute p99 values does not give the p99 for the hour.