View all services
Talk to QA Advisor
Free tool · Performance and metrics

Percentile calculator with p95 and p99

Paste a list of numbers, or open a JMeter or k6 results file, and get any percentile by the three standard methods side by side, the percentile rank of a value, a distribution chart and the arithmetic behind each answer.

Percentile calculator

Paste numbers or open a results file to get percentiles by three standard methods, with the working shown.

Examples

Read 30 values.

Values are in

Values with a unit, such as 120ms or 1.2s, are converted to the unit chosen here.

Method

Same as Excel PERCENTILE.INC, NumPy default ("linear"), R type 7.

Any numbers from 0 to 100, separated by commas, such as 50, 90, 95, 99, 99.9.

30 values

p50 77.5, p75 85.75, p90 91.2 by the linear (inclusive) method.

55

Minimum

77.5

Median

Mean of the two middle values

98

Maximum

77.133

Mean

11.536

Std deviation (sample)

Divides by n − 1

11.342

Std deviation (population)

Divides by n

Percentiles of 30 values by three methods. The selected method is Linear (inclusive).
PercentileLinear (inclusive) (selected)ExclusiveNearest rank
p2569.2568.569
p5077.577.577
p7585.7586.586
p9091.292.891

Type a percentile, such as 97.5.

73.33% of values are at or below 85 (22 of 30); 70% are strictly below.

Target check

p25 is 69.25: pass

Target: p25 at least 60. 10% of values are at or below 60.

Distribution

How many values fall in each range, with the percentiles marked by the linear (inclusive) method.

Distribution of 30 valuesHistogram with 5 bins from 50 to 100. The tallest bin holds 9 values. Markers: p50 at 77.5, p90 at 91.2.905060708090100p50p90
Chart data as a table
FromTo (below)Count
50602
60706
70809
80908
901005

How the 90th percentile is calculated

Linear (inclusive): rank = (n − 1) × p + 1, then interpolate between the values either side.

  1. Sort. Put the 30 values in ascending order and number them 1 to 30.

  2. Rank. (30 − 1) × 0.9 + 1 = 27.1

  3. Neighbours. Value 27 is 91 and value 28 is 93.

  4. Interpolate. 91 + 0.1 × (93 − 91) = 91.2

Export

Summary statistics and percentiles by the linear (inclusive) method, for a spreadsheet or report.

Ready
How to use

How to use the Percentile calculator

  1. 1Paste your numbers, one per line or separated by commas or spaces, or open a CSV or JMeter .jtl file and pick the column. Units such as 120ms or 1.2s are converted for you.
  2. 2Choose the method. Linear matches Excel PERCENTILE.INC and NumPy, exclusive matches Excel PERCENTILE.EXC, and nearest rank always returns one of your own values.
  3. 3Read the percentiles you listed, look up any other percentile, or type a value to find its percentile rank. The worked example shows exactly how one result was reached.
  4. 4For response times, set a target such as p95 under 500 ms to get a pass or fail, then export the results as CSV or Markdown for a test report.

What a percentile is

The p-th percentile is the value below which about p% of the data falls. In a set of exam scores, a 90th percentile of 93 means about 90% of students scored 93 or less. The 50th percentile is the median, and the 25th and 75th percentiles are the lower and upper quartiles.

A percentile is always a value in the units of the data: a score, a price, a number of milliseconds. That is what separates it from a percentage, and from a percentile rank, which goes the other way.

Why calculators give different answers

There is no single definition of a percentile. Hyndman and Fan (1996) compared nine in common use. They agree on large data sets and can disagree sharply on small ones, because they place the rank differently and either interpolate between neighbouring values or do not.

Take the ten values 2, 4, 4, 5, 7, 9, 10, 12, 15 and 40 and ask for the 90th percentile. The linear method gives 17.5, the exclusive method gives 37.5, and nearest rank gives 15. None of them is wrong. Always state which method a reported percentile used, and use the same one when you compare two results.

  • Linear (inclusive)

    rank = (n − 1) × p + 1

    Interpolates between the values either side of the rank. The same as Excel PERCENTILE.INC and the default "linear" method in NumPy, and type 7 in Hyndman and Fan. Defined for every percentile from 0 to 100.

  • Exclusive

    rank = (n + 1) × p

    Interpolates in the same way, but the rank is spread further towards the ends, so the extremes are not reachable with small samples. The same as Excel PERCENTILE.EXC, NumPy "weibull" and Hyndman and Fan type 6. When the rank falls below 1 or above n there is no answer, and Excel returns #NUM!.

  • Nearest rank

    rank = ⌈p × n⌉

    Rounds the rank up and returns that value, with no interpolation, so the answer is always one of your data points. The same as NumPy "inverted_cdf" and Hyndman and Fan type 1. NumPy also has a method called "nearest", which rounds the linear rank instead and is not the same thing.

Percentile versus percentile rank

A percentile answers "what value has p% of the data at or below it?". A percentile rank answers the reverse question, "what percentage of the data is at or below this value?". If 24 of 30 students scored 85 or less, a score of 85 has a percentile rank of 80%.

Ties make the reverse question ambiguous, so conventions differ: some count values at or below, some only values strictly below, and some count half of the tied values. This calculator shows both at-or-below and strictly-below, which bound every convention. For a response-time target, at or below is the useful one: it is the share of requests that met the target.

Percentiles for response times

Response times are skewed: most requests are quick and a few are very slow. The median describes a typical request, p95 and p99 describe the slow ones, and the slow ones are what users notice and complain about. That is why service level objectives and load test thresholds are usually written as percentiles, such as "p95 under 500 ms".

Load testing tools do not all calculate percentiles the same way, so the same run can report slightly different p95 values in different places. Large differences usually mean different data, such as a different time window or a filter on failed requests, rather than a different formula.

  • JMeter

    The Aggregate Report defines its 90% line as the time that 90% of samples took no more than. The JMeter documentation notes that the HTML dashboard uses a different formula, so its percentiles can differ from the Aggregate Report, and that setting backend_metrics_percentile_estimator=R_3 makes them match. Dashboard percentiles use a sliding window set by jmeter.reportgenerator.statistic_window, 20,000 samples by default.

  • k6

    The end-of-test summary shows avg, min, med, max, p(90) and p(95) by default, configurable with summaryTrendStats. In the k6 source code, trend percentiles are calculated from all recorded values with linear interpolation, the same method as the linear option here.

  • Gatling

    Reports show the 50th, 75th, 95th and 99th percentiles by default, configurable in gatling.conf. In the Gatling source code, report percentiles come from a t-digest, an approximation designed for large volumes of data, rounded to whole milliseconds.

  • Locust

    In the Locust source code, response times are rounded before they are stored: exact below 100 ms, then to about two significant figures, so 147 ms is kept as 150 ms. The live percentile chart in the web UI uses roughly the last 10 seconds, while the statistics table covers the whole run.

Why averages hide problems, and percentiles cannot be averaged

A mean of 180 ms can hide a slow 5% of requests taking two seconds each, because the fast majority pulls the average down. Two systems with the same mean can give users completely different experiences. Report the median and the tail percentiles alongside the mean, never the mean alone.

Percentiles also cannot be combined by averaging. Suppose one minute has 100 requests that all take 100 ms, and the next has 100 requests that all take 1,000 ms. The p95 of each minute is 100 ms and 1,000 ms, and their average is 550 ms. The p95 of all 200 requests is 1,000 ms. To combine results from several minutes, servers or test agents, merge the raw values, or histograms with identical buckets, and calculate the percentile once from the merged data.

Sample size and p99

A percentile is only as reliable as the number of values beyond it. With 100 response times, p99 rests on the one or two slowest requests, and a single outlier moves it. With 1,000 values, only 10 lie above p99. With fewer than 1,000, p99.9 is in effect the maximum.

As a working rule, collect enough requests that at least a few dozen fall beyond the percentile you care about: several thousand for p99, tens of thousands for p99.9. The exclusive method makes the limit explicit, since it cannot calculate p99 at all from fewer than 99 values.

QAble service

Performance testing

QAble plans and runs load, stress and soak tests against realistic workloads, and reports p95 and p99 response times against the targets your users actually depend on.

Explore the service
FAQ

Frequently asked questions

How do I calculate the 95th percentile?

Sort the values in ascending order and work out the rank. With the linear method, the rank is (n − 1) × 0.95 + 1. If the rank is a whole number, the 95th percentile is the value at that position. If not, take the two values either side and move between them by the fractional part of the rank. For 20 values the rank is 19.05, so the result is value 19 plus 0.05 of the gap to value 20.

Which method does Excel use?

Excel has two functions. PERCENTILE.INC uses the linear method and accepts any k from 0 to 1. PERCENTILE.EXC uses the exclusive method, accepts k strictly between 0 and 1, and returns #NUM! when it cannot interpolate, which happens at the extremes of small data sets. Choose the matching method here to get the same results.

Why is my p95 different from the one my load testing tool reports?

Check the data first: the same requests, the same time window, and failed requests treated the same way. Then check the method. k6 interpolates linearly, the JMeter dashboard uses a different estimator from the Aggregate Report unless configured otherwise, Gatling approximates with a t-digest, and Locust rounds response times before storing them. With thousands of requests the differences are usually small.

Is the median the same as the 50th percentile?

Yes with the linear and exclusive methods: both give the middle value, or the mean of the two middle values when there is an even number. Nearest rank gives the lower of the two middle values instead, so with an even count it can differ from the median.

What is the difference between a percentile and a percentage?

A percentage is a proportion, such as 80% of answers correct. A percentile is a position in a distribution, expressed as a value: the 80th percentile score is the score that 80% of people reached or fell below. A score of 80% can sit at any percentile, depending on how everyone else did.

Is my data uploaded anywhere?

No. Everything is calculated in your browser, including files you open, and nothing is sent to a server. Large JMeter or k6 results files are read locally.

Need your p99 measured under real load?

QAble performance testers model your peak traffic, run the load and find the bottleneck behind the slow tail before your users meet it.

Talk to QA Advisor