%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

Latency Percentiles Calculator (p50, p95, p99)

Results update as you type.

Your numbers

Understanding the latency percentiles calculator — concept and principle

Response-time data is almost never symmetric: most requests are fast and a few are very slow. Percentiles describe that shape far better than an average. This calculator takes a list of latency samples and reports the median (p50), the tail percentiles p95 and p99, the mean and the maximum. Engineers use these numbers to write service-level objectives (SLOs), compare releases and spot slow outliers.

Latency percentiles from 12 samplesSorted, the 12 samples have a median of 15.5 ms, but p95 is 146.75 ms and p99 197.35 ms because of the 95 and 210 ms outliers.Sort the samples, then read positions120131142143154155166177188229951021011↑ position (0–11)p50 = 15.5p95 = 146.75p99 = 197.35p95: 11 × 0.95 = 10.45 → between 95 and 21095 + 0.45 × (210 − 95) = 146.75 msMean 38.4 vs median 15.5ms · two slow requests drag the mean up
The median sits in the crowd; p95 and p99 land between the two slowest requests.

How it is calculated

The samples are sorted from smallest to largest: x₁ ≤ x₂ ≤ … ≤ xₙ. For a percentile p (as a fraction), the position is h = (n − 1) × p, counted from 0. If h falls between two samples, the value is interpolated linearly: Q = x₍⌊h⌋₎ + (h − ⌊h⌋) × (x₍⌊h⌋+1₎ − x₍⌊h⌋₎). This is the "type 7" definition of Hyndman and Fan, the default in R, NumPy and spreadsheet PERCENTILE functions. The mean is the sum divided by n; the max is the largest sample. Units are whatever you enter, usually milliseconds.

The principle

A percentile answers "what latency do p percent of requests stay at or below?". The median splits the data in half and ignores how extreme the slow requests are. The mean, by contrast, is pulled up by every slow outlier, so it can describe almost no real request. Tail percentiles matter because users and systems feel the slow cases: a page that makes many backend calls is likely to hit at least one p99 response, so the tail of each service becomes the typical experience of the whole page.

Worked example

  1. Sorted samples (n = 12): 12, 13, 14, 14, 15, 15, 16, 17, 18, 22, 95, 210.
  2. p50: h = 11 × 0.5 = 5.5, between 15 and 16 (positions 5 and 6), so 15 + 0.5 × 1 = 15.5 ms.
  3. p95: h = 11 × 0.95 = 10.45, between 95 and 210, so 95 + 0.45 × 115 = 146.75 ms.
  4. p99: h = 10.89, so 95 + 0.89 × 115 = 197.35 ms.
  5. Mean: 461 ÷ 12 = 38.42 ms; max = 210 ms.

How to read the result

Here the median is 15.5 ms, but the mean is more than twice that because of two slow requests. That gap is a sign of a heavy tail worth investigating (garbage collection, cold caches, lock contention, retries). SLOs are usually written on p95 or p99, for example "p99 under 300 ms over 30 days".

Common mistakes

Keep in mind: Percentiles from small samples carry wide uncertainty. Collect hundreds or thousands of samples per window before drawing conclusions about tail latency.

Frequently asked questions

Why not just use the average?

Latency distributions are skewed, so the average is moved by rare outliers and hides what typical and worst-case users see.

Is p50 the same as the median?

Yes, p50 is the median.

How many samples do I need for a reliable p99?

Enough that well over 100 samples lie beyond it; many teams want thousands of requests per window.

Sources: R. J. Hyndman and Y. Fan, "Sample Quantiles in Statistical Packages", The American Statistician 50(4), 1996 · J. Dean and L. A. Barroso, "The Tail at Scale", Communications of the ACM 56(2), 2013

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →