Quantiles and Percentiles

Cut a distribution into equal-sized groups. The box plot is what you get when you draw the cuts.

Quantiles and Percentiles

This module needs JavaScript: the numbers are computed in the page rather than recorded.

Worth knowing

The q-th quantile is the value below which a fraction q of the data falls. The median is q = 0.5.
Percentiles are the same thing on a 0-100 scale. Quartiles cut at 25, 50 and 75.
The IQR is Q3 − Q1: the range covering the middle half, and a spread measure that ignores outliers entirely.
Whiskers reach the furthest points within 1.5 IQR of the box. Anything beyond is drawn individually — a convention, not a test.

Overview

Read a quantile

The p-quantile is a value with roughly proportion p of observations at or below it. The median is the 0.5 quantile; the 25th and 75th percentiles are the first and third quartiles. For 1, 2, 4, 7, 9, the median is 4.5 under the common “average the two middle values” convention.

Q(p): approximately p of the distribution lies at or below Q(p)

There are several accepted sample-quantile conventions, especially for small datasets. Software may interpolate between adjacent observations differently, so name the convention when exact reproducibility matters.

In this guide
  1. Why quantiles are useful
  2. Pair a centre with a spread measure
  3. Try this above
  4. Sources and next steps

Quantiles and Percentiles

A quantile marks a position in an ordered distribution; a percentile expresses that position on a 0–100 scale.

Why quantiles are useful

Quantiles describe location without assuming a symmetric distribution and are less affected by extreme observations than the mean. The interquartile range, Q(0.75) − Q(0.25), measures the middle half of the data. A percentile rank is not the same as a percentage of correct answers; it describes relative position in a reference distribution.

Use quantiles to report skewed measurements, thresholds, and prediction intervals. See mean, median, and mode and confidence intervals.

Pair a centre with a spread measure

The median is the 50th percentile; Q₁ and Q₃ are commonly the 25th and 75th percentiles. Their difference, IQR=Q₃−Q₁, describes the width of the middle half of the data. For sorted values 1, 2, 4, 7, 9, the median is 4. Quartiles for a sample this small depend on convention; some methods include the median when splitting halves, while others interpolate. Software documentation should be checked when exact values must match.

The IQR is less sensitive to extreme observations than the full range. If the largest value changes from 9 to 900, the upper quartile may move little while the maximum changes dramatically. This is useful for skewed data, but quantiles do not show every feature: separated clusters can have identical quartiles, and a percentile threshold does not explain why observations differ. A percentile *value* has the data's unit; a percentile *rank* describes where an observation sits relative to a reference group. For context, pair median and IQR or show a boxplot, and compare with mean and standard deviation.

Try this above

Change the requested percentile and inspect which observations fall below it. Try a small sample to see where software conventions can differ.

Quantiles also provide thresholds for decisions: a service may monitor its 95th-percentile response time because the slowest tail matters more than the average. That threshold should be estimated from enough relevant observations and reported with a time window and population. A sample percentile has uncertainty, especially in small datasets or the tail. It is not a guarantee that exactly 5% of future cases will exceed the observed 95th percentile; that depends on whether future data follow the same distribution.

For integer-valued data, a quantile threshold can equal an observed value and there may be a jump in the cumulative distribution. For continuous models, the cumulative distribution may be inverted to define a quantile. Ties, rounding, and interpolation conventions affect sample results. When comparing percentiles across groups, ensure the reference population and time period are comparable; the same percentile rank can correspond to very different measured values.

Sources and next steps

Check yourself

0 of 3

Answer without scrolling back up.

  1. Why is the median unaffected by adding one enormous value?

  2. What do the whiskers on a box plot reach?

  3. Why can you not average the p99 of two servers?

Cheat sheet

Quantiles and Percentiles

Compute quantiles, percentiles and the interquartile range. See why rank-based summaries describe skewed data better than the mean.

MATHS · vizlearn.in/maths/quantiles_and_percentiles.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.

Teaching a course with this? Individual teachers can use it freely; for a whole department or programme, see institutional licences.