The interquartile range (IQR) is a measure of statistical dispersion defined as the difference between the third quartile and the first quartile:
The quartiles are the 75th and 25th percentiles, respectively. The IQR describes the width of the central portion of a dataset or probability distribution, rather than the spread between its most extreme values. In statistics, it is commonly reported alongside the median and displayed as the length of the box in a box plot.
Definition and interpretation
Quartiles are particular quantiles. For a distribution with cumulative distribution function , one standard definition is
The population interquartile range is therefore
For a continuous distribution, the interval from to contains 50% of the probability. With discrete distributions or tied observations, the interval can contain more than 50%; the description “spread of the middle 50%” is thus an interpretation rather than an exact counting rule in every dataset.
The IQR is nonnegative and has the same units as the observations. An IQR of 12 seconds means that the first and third quartiles are 12 seconds apart. It does not mean that observations typically lie 12 seconds from the median or from the sample mean.
The IQR can be zero even when the data are not all identical. This occurs when the first and third quartiles coincide, as can happen in datasets with many repeated values.
Calculation from a sample
To calculate a sample IQR, observations are sorted and the first and third quartiles are estimated. There is no single universally adopted rule for calculating sample quartiles.
Common conventions include:
- Median of halves: calculate the median of the lower half and the median of the upper half. For an odd number of observations, conventions differ on whether the overall median belongs to either half.
- Interpolated quantiles: locate each percentile at a fractional position among the sorted observations and use interpolation between adjacent values.
- Empirical quantiles: select an observed value using the inverse of the empirical cumulative distribution function.
These conventions can produce different IQRs, particularly in small samples.
Example
Consider the ordered dataset
Using medians of halves,
so
Under a common linear interpolation convention, the position of the -quantile is
For the same dataset, this gives and , producing an IQR of . Neither result is an arithmetic error: they reflect different definitions of sample quartiles. Reproducible reporting therefore identifies the quantile convention or software method when the distinction matters.
Robustness and mathematical properties
The IQR is a standard measure in robust statistics because it is much less sensitive to extreme observations than the full range, variance, or standard deviation.
In the example above, replacing 8 with a very large number leaves both median-of-halves quartiles unchanged. The full range, by contrast, increases directly with that replacement. Robustness does not imply complete insensitivity: changes near quartile positions, or changes affecting a sufficiently large fraction of the data, can substantially alter the IQR.
For a continuous population distribution with positive density at its quartiles, the sample IQR has an asymptotic replacement breakdown point of 25%. Roughly, contamination of about one quarter of the sample can drive one quartile arbitrarily far away; exact finite-sample thresholds depend on the quartile convention.
The IQR also has several useful properties:
- Translation invariance: adding the same constant to every observation leaves the IQR unchanged.
- Positive scale equivariance: multiplying every observation by multiplies the IQR by .
- No moment requirement: finite quartiles can exist even when a distribution has no finite mean or variance.
- Limited shape information: the IQR alone does not describe skewness, tail behavior, or the number of peaks.
For example, a Cauchy distribution with location and scale has quartiles and , giving
although its mean and variance are undefined.
Relationship to standard deviation
For a normal distribution with mean and standard deviation ,
where is the standard normal cumulative distribution function. By symmetry,
Consequently,
provides a normal-calibrated robust estimate of scale. This relationship is specific to the normal distribution; it is not a universal conversion between IQR and standard deviation.
The semi-interquartile range, also called the quartile deviation, is half the IQR:
It is distinct from the median absolute deviation, which is the median of the absolute distances from the median.
Box plots and potential outliers
In a conventional box plot, the box extends from to , with a line marking the median. A widely used rule defines inner fences at
Observations below or above are flagged as potential outliers. The whiskers commonly extend to the most extreme observations within these fences, rather than to the fences themselves. Box-plot conventions vary, so their definitions matter when comparing displays.
The multiplier is a descriptive convention, not a universal boundary between valid and invalid observations. Points outside the fences need not be measurement errors. Even for a normal population, approximately 0.7% of observations fall outside fences calculated from the population quartiles; skewed or heavy-tailed distributions may place substantially more observations outside them.
Applications and limitations
The IQR is used to compare variability across groups, summarize skewed data, and describe distributions whose extreme values would dominate other spread measures. Reporting the median together with and preserves more information than reporting the median and IQR alone, because it shows how the central interval is positioned around the median.
An IQR is not a confidence interval: it describes variation in a distribution rather than uncertainty about an estimated parameter. A sample IQR itself has sampling uncertainty, which can be assessed using methods such as bootstrap sampling.
Because the IQR depends only on two quantiles, datasets with the same IQR can have very different tails, ranges, and internal patterns. It is therefore a compact measure of central spread, not a complete description of a distribution.