How to Calculate Interquartile Range- Step-by-Step Guide

What Is the Interquartile Range?

The interquartile range (IQR) measures the spread of the middle half of your data. It tells you where most of your values actually sit, without getting skewed by outliers or extreme scores.

You get it by subtracting the 25th percentile (Q1) from the 75th percentile (Q3). That's it. Simple in concept, annoying in practice if you don't know the steps.

Why Bother With IQR?

Range (max minus min) lies. One crazy outlier makes it useless. Standard deviation gets wrecked by extreme values too.

IQR ignores the top 25% and bottom 25% of your data. It shows you the core spread — where the real action happens.

You see IQR used in:

The Step-by-Step Calculation

Step 1: Sort Your Data

Arrange all values from smallest to largest. This is not optional. Mess this up and everything else fails.

Step 2: Find the Median (Q2)

The median splits your data in half — 50% below, 50% above.

Step 3: Find Q1 (25th Percentile)

Q1 is the median of the lower half — the data below your overall median.

Step 4: Find Q3 (75th Percentile)

Q3 is the median of the upper half — the data above your overall median.

Step 5: Subtract

IQR = Q3 - Q1

Real Example With Numbers

Dataset: 3, 7, 8, 12, 14, 18, 22, 25, 30

Step 1: Already sorted. Nine values.

Step 2: Median = 14 (the 5th value)

Step 3: Lower half = 3, 7, 8, 12. Q1 = median of these = (7 + 8) / 2 = 7.5

Step 4: Upper half = 18, 22, 25, 30. Q3 = median of these = (22 + 25) / 2 = 23.5

Step 5: IQR = 23.5 - 7.5 = 16

The middle 50% of your data spans 16 units.

Even Number of Values? Here's the Catch

With an even dataset, you split exactly in half for Q1 and Q3. No special averaging needed — you just take the two halves and find their medians separately.

Dataset: 2, 4, 6, 8, 10, 12

IQR vs Other Spread Measures

MeasureWhat It DoesOutlier Sensitive?
RangeMax minus minYes — wrecked by one outlier
Variance/Std DevAverage squared deviation from meanYes — pulled by extremes
IQRSpread of middle 50%No — ignores extremes
Interquartile RangeQ3 minus Q1No — the point

How to Detect Outliers With IQR

This is where IQR earns its keep.

Anything outside these bounds gets flagged as a potential outlier.

Using our earlier example (Q1=7.5, Q3=23.5, IQR=16):

So values below -16.5 or above 47.5 would be outliers. In our dataset of 3-30, nothing qualifies.

Getting Started: Quick Checklist

Common Mistakes That Wreck Your Calculation

When IQR Doesn't Help

IQR shows spread, not typical values. A dataset of 1, 2, 100, 101 has the same IQR as 1, 50, 51, 101 — but the second one is way more "normal."

For small datasets, IQR can be unstable. With 5 values, you're basing everything on two medians of two-value halves. Not reliable.

For skewed distributions, IQR is your friend. For symmetric, roughly normal data, standard deviation often tells a clearer story.