What Is Interquartile Range? IQR Definition and Uses

The interquartile range (IQR) is a measure of how spread out a set of numbers is, based on the middle 50% of the data. You calculate it by subtracting the value at the 25th percentile from the value at the 75th percentile: IQR = Q3 − Q1. It’s one of the most common ways to describe variability in a dataset, especially when extreme values might skew the picture.

How Quartiles Divide Your Data

To understand the interquartile range, you first need to understand quartiles. Quartiles split a dataset into four roughly equal parts. The first quartile (Q1) is the 25th percentile, meaning 25% of all data points fall below it. The third quartile (Q3) is the 75th percentile, meaning 75% of data points fall below it. The second quartile is simply the median, the midpoint of the entire dataset.

The interquartile range captures the distance between Q1 and Q3. That distance represents the spread of the middle half of your data, ignoring the highest 25% and lowest 25%. This makes it naturally resistant to extreme values that can distort other measures of spread like the range.

How to Calculate the IQR Step by Step

The process is straightforward once you know the steps:

  • Order the data from smallest to largest.
  • Find the median of the full dataset. If you have an odd number of values, it’s the middle one. If you have an even number, it’s the average of the two middle values.
  • Find Q1 by taking the median of just the lower half of the data (everything below the overall median).
  • Find Q3 by taking the median of just the upper half of the data (everything above the overall median).
  • Subtract: IQR = Q3 − Q1.

One detail worth noting: when you have an odd number of data points, the overall median is not included in either the lower or upper half when you calculate Q1 and Q3. With an even number, you simply split the data into two equal halves.

Say you have test scores: 62, 67, 71, 74, 76, 81, 85, 89, 93. The median is 76 (the fifth value out of nine). The lower half is 62, 67, 71, 74, so Q1 is the average of 67 and 71, which is 69. The upper half is 81, 85, 89, 93, so Q3 is the average of 85 and 89, which is 87. The IQR is 87 − 69 = 18. That tells you the middle half of scores spans an 18-point range.

Why Different Calculators Give Slightly Different Results

If you’ve ever plugged the same dataset into two different tools and gotten slightly different IQR values, you’re not going crazy. There are at least ten recognized methods for calculating quartiles, and they differ in how they handle the rounding of positions when data points don’t divide evenly into four groups. Some methods average neighboring values, others round up or down, and one popular approach (sometimes called the hinge method) includes the median in both halves of the data. For most practical purposes the differences are small, but they explain why your textbook answer might not match Excel or a statistics app exactly.

Using the IQR to Spot Outliers

One of the most practical uses of the interquartile range is detecting outliers. The standard rule, widely taught in statistics courses, works like this: any data point that falls more than 1.5 times the IQR below Q1 or above Q3 is flagged as an outlier.

The two boundary lines are called fences:

  • Lower fence: Q1 − (1.5 × IQR)
  • Upper fence: Q3 + (1.5 × IQR)

Anything outside those fences is considered unusually far from the bulk of the data. Using the test score example above, Q1 is 69, Q3 is 87, and the IQR is 18. The lower fence would be 69 − 27 = 42, and the upper fence would be 87 + 27 = 114. Any score below 42 or above 114 would be flagged. Because all the scores in that dataset fall within those boundaries, none are outliers.

How the IQR Shows Up in Box Plots

If you’ve seen a box-and-whisker plot, you’ve already seen the IQR visualized. The box itself represents the interquartile range: its left (or bottom) edge sits at Q1, its right (or top) edge sits at Q3, and the width of the box is the IQR. A line inside the box marks the median. The “whiskers” extend outward to show the rest of the data, and individual dots beyond the whiskers represent outliers identified by the 1.5 × IQR rule.

A tall or wide box means the middle half of the data is spread out. A narrow box means those values cluster tightly together. Comparing box plots side by side gives you an instant visual sense of how the spread differs between groups.

IQR vs. Standard Deviation

Both the IQR and the standard deviation measure how spread out data is, but they do it in fundamentally different ways. The standard deviation factors in every single data point and measures how far each one sits from the average. That makes it a more comprehensive measure, but it also makes it sensitive to extreme values. A single very high or very low number can inflate the standard deviation significantly.

The IQR, by contrast, only looks at where the 25th and 75th percentiles fall. It completely ignores extreme values, which makes it a better choice when your data is skewed or contains outliers. The CDC’s epidemiology guidelines recommend pairing the median with the IQR (or the range) when data is asymmetrical, while reserving the mean and standard deviation for data that follows a normal, bell-shaped distribution.

The tradeoff is that the IQR is based on just two values from the dataset, so it doesn’t capture the full picture of variability. In practice, many analysts report both measures to give a complete view.

Where the IQR Is Used in Practice

The interquartile range appears across fields wherever analysts need a reliable measure of spread that won’t be thrown off by unusual values. In finance, volatility measures based on quantile ranges are used to model and forecast uncertainty in markets like the S&P 500. In healthcare and epidemiology, researchers routinely report medians and IQRs when summarizing patient data like hospital stay lengths or infection rates, because these distributions are rarely symmetrical. In education, IQRs help describe the spread of test scores without letting a handful of unusually high or low performers distort the summary. Any time a dataset has a long tail in one direction, the IQR gives a more honest picture of where most values actually fall.