statcompute

Descriptive statistics

Percentile and Quartile Calculator

Find the value at any percentile, or the percentile of any value — with the method named, because the four common conventions genuinely disagree.

Also called percentile calculator, quartile calculator, interquartile range calculator.

Updated August 2026Runs in your browser — nothing is uploadedVerified against R
One value per line, or separated by commas, tabs or spaces. A header row is ignored.
One or more numbers between 0 and 100. Defaults to the quartiles.
These genuinely disagree on small samples, which is why the method is named on every result.

The calculation runs in your browser, so this box needs JavaScript. The formula, the worked example and the interpretation below do not.

01

How to read this result

A percentile is a value, a percentile rank is a position. The 90th percentile is the number below which 90% of the data fall. The percentile rank of 27 is the share of the data at or below 27. The calculator does both, in separate modes, because the two get conflated constantly.

Quartiles are just three particular percentiles — the 25th, 50th and 75th — and the distance between the first and third is the interquartile range, the spread of the middle half.

The method matters and is usually unstated. With ten values, the four conventions here can put the 25th percentile in noticeably different places. Excel alone ships two functions that disagree. The comparison table shows all four so that a mismatch with someone else's number is explainable rather than mysterious.

This is a statistical percentile, not a growth chart. A child's height percentile compares against a national reference population, not against the numbers you paste in. Same word, different calculation, different data.

02

The formula

h=(n1)p100+1Q=xh+(hh)(xhxh)
h
the position in the sorted data, usually fractional
n
the number of values
p
the percentile wanted, 0 to 100

The linear-interpolation method (R type 7, Excel PERCENTILE.INC). The exclusive method uses h = (n + 1)p/100 instead; nearest rank ignores h entirely and takes the value at rank ⌈np/100⌉ (R type 1); Tukey's hinges use the medians of the two halves.

03

Worked example

Quartiles of twenty daily customer counts

Twenty days of customer counts: 18, 22, 25, 19, 31, 28, 24, 21, 27, 33, 26, 23, 29, 20, 35, 30, 22, 26, 24, 28.

  1. Sort the twenty values.
    18 19 20 21 22 22 23 24 24 25 26 26 27 28 28 29 30 31 33 35
  2. For Q1, the position is h = (20 − 1) × 0.25 + 1 = 5.75.
    between the 5th (22) and 6th (22) values
  3. Interpolate: 22 + 0.75 × (22 − 22) = 22.
    Q1 = 22
  4. For Q3, h = (20 − 1) × 0.75 + 1 = 15.25.
    between the 15th (28) and 16th (29): 28 + 0.25 × 1 = 28.25
  5. The interquartile range is the gap between them.
    IQR = 28.25 − 22 = 6.25
  6. The 90th percentile: h = 19 × 0.9 + 1 = 18.1 → 31 + 0.1 × (33 − 31).
    P90 = 31.2
Q1 22median 25.5Q3 28.25IQR 6.25P90 31.2

Half the days fall between 22 and 28 customers. That range — rather than the mean — is the useful number for staffing.

Checked against R's quantile(x, type = 7).

The calculator above is loaded with these numbers by the Load the worked example button.

04

Assumptions, and when to use something else

Percentiles assume the data can be ordered, and nothing else. They work on skewed data, on ordinal scales, and in the presence of outliers, which is what makes them the robust alternative to the mean and standard deviation.

The one genuine limitation is small samples: with ten values, the 90th percentile is being estimated from essentially one observation, and it moves a lot from sample to sample. Extreme percentiles need substantial data before they mean much.

  • You want all five headline numbersFive-number summaryMinimum, Q1, median, Q3 and maximum — everything a box plot draws.
  • You want a pictureBox plot makerDraws the quartiles directly, with outliers marked.
  • You want to use the normal distribution insteadZ-score calculatorThe percentile of a value under a normal model rather than in your data.
  • You are looking for unusual valuesOutlier detectionThe IQR fences that come from Q1 and Q3.
05

Questions people ask

Why does Excel give a different quartile?

Because Excel ships two functions with different definitions — PERCENTILE.INC and PERCENTILE.EXC — and neither matches Tukey's hinges, which box plots use. On small samples the differences are real. The comparison table above shows all four so you can see which one your other tool used.

What is the difference between a percentile and a percentage?

A percentage is a proportion of a total. A percentile is a position in a distribution. Scoring 90% on a test says you got 90% of the marks; being in the 90th percentile says you beat 90% of the other candidates. They are frequently very different numbers.

How do I calculate the percentile rank of a value?

Count how many values fall below it, add half the ties, and divide by n. That mid-rank definition is the one most statistical software uses, and it is what the second mode above computes.

Is the 50th percentile always the median?

Yes, by definition — under every one of the four methods, though they can disagree about it by a hair when n is even and the two middle values differ.