Skip to main content
CalcChef

Latency Percentile Calculator

Paste latency samples in milliseconds for p50 to p99.9 by interpolation or nearest rank, plus mean, standard deviation and median-based outliers. How it works

Use the Latency Percentile Calculator

Optional: for example 90 or 99.9.

20 valid samples parsed

p95 latency
310.25 ms
p50 170 ms · p99 390.05 ms

Percentile estimates

p50 (median)
170ms
p75
201.75ms
p90
255.5ms
p95
310.25ms
p99
390.05ms
p99.9
408.005ms

Summary statistics

Count
20
Min (ms)
95
Max (ms)
410
Mean (ms)
186.8
Median (ms)
170
Std Dev, population (ms)
69.328638

Outliers

2 found (> median + 2.5 × 1.4826 × MAD)
305 ms410 ms

A sample is an outlier when it is above median + 2.5 × 1.4826 × MAD = 275.63525 ms. Only slow samples are flagged.

With 20 samples, p95 and p99 are interpolated between the two largest samples, so they say little more than the maximum. At least 101 samples are needed before p99 is anything but a blend of the top two.

Samples are sorted ascending and percentiles use linear interpolation at rank (p / 100) × (n − 1) of the sorted samples (the same method as Excel PERCENTILE.INC). The "p95" value is read 95% of the way up the sorted list, so it can lie between two samples and be a latency no request had: for the samples 1 to 10 it is 9.55. Outliers are samples above median + 2.5 × 1.4826 × MAD, where MAD is the median absolute deviation: it is computed from the median, so one large spike cannot raise its own threshold. When MAD is 0 the rule is not applied. Std Dev is the population value (divides by n). Samples must be plain non-negative decimals up to 1000000000 ms.

About the Latency Percentile Calculator

p95 latency is the response time that 95% of requests were at or below; p99 covers 99%, and p50 is the median. This latency percentile calculator sorts the samples you paste and reads each percentile by linear interpolation at rank (p / 100) × (n − 1), the same method as Excel PERCENTILE.INC, so the 20 example samples give p95 310.25 ms. A nearest-rank option returns an observed sample instead (305 ms), and it also flags slow outliers with a median-based rule.

Statistics for the 20 sample latencies on the page

StatisticValue
Count20
Min95 ms
Max410 ms
Mean186.8 ms
Median (p50)170 ms
p95310.25 ms
p99390.05 ms
Standard deviation (population)69.328638 ms
MAD28.5 ms
Outlier threshold275.63525 ms
Outliers305 ms, 410 ms

Samples: 120, 145, 132, 178, 210, 95, 188, 165, 142, 250, 305, 138, 156, 199, 230, 175, 410, 162, 148, 188 ms. Computed with the tool’s own functions.

When p95 and p99 stop being a blend of the two largest samples

Samplesp95 is a blend of the top twop99 is a blend of the top two
5YesYes
10YesYes
20YesYes
21NoYes
50NoYes
100NoYes
101NoNo
1000NoNo

A percentile between the two largest samples says little more than the maximum. The page shows a note when this applies.

The 20 sample latencies by each percentile method

PercentileLinear interpolationNearest rank
p50170 ms165 ms
p75201.75 ms199 ms
p90255.5 ms250 ms
p95310.25 ms305 ms
p99390.05 ms410 ms
p99.9408.005 ms410 ms

Nearest rank returns the sample at rank ceil(p / 100 × n), so every value is a latency in the list. Computed with the tool’s own functions.

How to use this tool

  1. Paste latency samples in milliseconds, separated by spaces, new lines, semicolons or commas. The 20-sample example is there when you first open the page.
  2. Pick a percentile method (linear interpolation or nearest rank) and, if you need one more, type a custom percentile such as 99.5.
  3. Read the p50, p75, p90, p95, p99 and p99.9 cards, your custom percentile, then the count, min, max, mean, median, standard deviation and MAD.
  4. Read the outlier threshold and the list of samples above it. If the MAD is 0 the page says the rule cannot be applied.
  5. Press Copy Results for a text report. Example loads the 20 sample latencies again; Clear Saved Values deletes the samples saved in this browser.

Frequently asked questions

How do you calculate p95 and p99 latency?
Sort the samples, then find the value at zero-based rank (p / 100) × (n − 1), interpolating between neighbors. For 1, 2, 3, 4, 5 the p95 rank is 0.95 × 4 = 3.8, so p95 is 4 + 0.8 × (5 − 4) = 4.8. Use the raw per-request times, not averages per minute: a percentile of averages hides the slow requests.
How many samples do I need for a reliable p99?
More than 100. With 100 samples or fewer, p99 is interpolated between the two largest and says little more than the maximum; the table shows the change at 101. p95 has the same problem up to 20 samples. The page shows a note while this applies.
Why does my p95 differ from another calculator?
Percentile methods differ. This tool uses linear interpolation at rank (p / 100) × (n − 1) by default. The NIST handbook sets p(N+1) = k + d and takes the maximum at or beyond the rank N/(N+1), so for 1, 2, 3, 4, 5 it gives p95 = 5, not 4.8. Switch the method to nearest rank to get an observed sample instead, the sample at rank ceil(p / 100 × n): for 1 to 10, p95 is 9.55 by interpolation and 10 by nearest rank.
How does the tool decide which samples are outliers?
A sample is an outlier when it is above the median + 2.5 × 1.4826 × MAD, where MAD is the median absolute deviation. Only slow samples are flagged. For 100, 100, 100, 100, 1000 the MAD is 0, so no rule applies and nothing is flagged, though the maximum and p99 still show the 1000.
What input does it accept?
Plain non-negative decimals such as 120, 12.5 or 1e3, separated by whitespace, semicolons or commas. A word, a negative number, +5 or 0x10 is counted as invalid and ignored. 12,5 with no space is not read as a decimal and is not used; write 12.5, or 12, 5 for two samples. Each sample can be up to 1,000,000,000 ms and up to 100,000 are used.
Is the standard deviation for a sample or a population?
Population: the sum of squared differences from the mean is divided by n, not n − 1. For the 20 samples on the page it is 69.328638 ms.

Related Tools

View all tools