To find the interquartile range (IQR), order your data from smallest to largest, find the first quartile (Q1, the 25th percentile) and the third quartile (Q3, the 75th percentile), then subtract: IQR = Q3 − Q1. The result tells you the spread of the middle 50% of your values, and because it ignores the highest and lowest quarter of the data, it is not distorted by extreme values.
When a data set contains unusually high or low values, simple measures like the range can give a distorted picture. This is why the interquartile range is such an important concept in statistics and one of the core measures of variability you will meet in any quantitative analysis. The IQR focuses on the values between the lower quartile (Q1) and the upper quartile (Q3), capturing where the bulk of a distribution actually sits.
“The interquartile range is the difference between the upper and lower quartiles and contains the middle 50% of the values. It is a useful measure of spread because it is not affected by extreme values.” — Office for National Statistics (ONS), Statistical literacy guidance
What Is The Interquartile Range?
The interquartile range is the difference between the third quartile (Q3, the 75th percentile) and the first quartile (Q1, the 25th percentile). It measures the spread of the middle 50% of your data, the portion that sits between the lower and upper quartiles.
Formula: IQR = Q3 − Q1
Unlike the range, which depends entirely on the single smallest and single largest observations, the IQR is built from the quartiles. This makes it a robust statistic: a measure that stays stable even when a data set contains errors, anomalies or genuine extreme values. For this reason, the IQR is the spread measure of choice whenever data is skewed or contains outliers, two situations that are extremely common in real-world research such as income, house prices, reaction times and waiting lists.
Struggling to calculate and interpret your spread statistics?
ResearchProspect to the rescue!
Our statisticians can compute your quartiles, IQR and box plots and explain them in plain English — explore our statistical analysis service.
Because it ignores the top 25% and bottom 25% of values, the IQR is almost completely unaffected by outliers. This is its key advantage over the range and the standard deviation, both of which can be inflated dramatically by a single extreme value.
The IQR is the natural companion of the median, just as the standard deviation is the natural companion of the mean. When you report the median as your measure of central tendency, you should almost always report the IQR alongside it.
Understanding Quartiles
To calculate the IQR, you first need to find the quartiles. Quartiles are the three values that divide an ordered data set into four equal parts, each containing 25% of the observations:
| Quartile | Position | What It Represents |
|---|---|---|
| Q1 (Lower Quartile) | 25th percentile | 25% of values fall below this point |
| Q2 (Median) | 50th percentile | The middle of the data set; 50% below, 50% above |
| Q3 (Upper Quartile) | 75th percentile | 75% of values fall below this point |
| IQR | Q3 − Q1 | The span of the middle 50% of the data |
A small note on terminology: the first quartile (Q1) is sometimes called the lower quartile, and the third quartile (Q3) the upper quartile. The second quartile (Q2) is simply another name for the median. So whenever you see “1st quartile” or “3rd quartile” in a question, those are just Q1 and Q3.
How To Find The IQR – Step By Step
Finding the interquartile range from a list of numbers takes five straightforward steps. The only part that needs care is splitting the data into a lower half and an upper half correctly.
- Step 1: Arrange all the data values in ascending order, from smallest to largest.
- Step 2: Find the median (Q2). This middle value divides the data set into two equal parts: a lower half and an upper half.
- Step 3: Find Q1 – the median of the lower half of the data. If the total number of values is odd, exclude the overall median from this half.
- Step 4: Find Q3 – the median of the upper half of the data (again excluding the overall median if the number of values is odd).
- Step 5: Subtract Q1 from Q3 using IQR = Q3 − Q1. The result is the spread of the middle 50% of the data.
Worked Example (even number of values): Waiting times (in days) for a GP appointment across 10 practices: 3, 5, 6, 7, 9, 11, 12, 15, 18, 28.
Step 1 – Order: already sorted (n = 10).
Step 2 – Median (Q2): the two middle values are 9 and 11, so Q2 = (9 + 11) ÷ 2 = 10.
Step 3 – Q1: lower half is 3, 5, 6, 7, 9 → the middle value is 6, so Q1 = 6.
Step 4 – Q3: upper half is 11, 12, 15, 18, 28 → the middle value is 15, so Q3 = 15.
Step 5 – IQR: IQR = Q3 − Q1 = 15 − 6 = 9 days.
By comparison, the range = 28 − 3 = 25 days. The IQR of 9 days gives a far more representative picture of typical variation than the range of 25 days, which is dragged upward by the single practice with a 28-day wait.
Worked Example (odd number of values): Twelve exam marks: 63, 65, 67, 69, 71, 73, 73, 75, 75, 77, 87, 91.
Here n = 12 (even), so the median is between the 6th and 7th values, 73 and 73, giving Q2 = 73. The lower half is 63, 65, 67, 69, 71, 73 → Q1 = (67 + 69) ÷ 2 = 68. The upper half is 73, 75, 75, 77, 87, 91 → Q3 = (75 + 77) ÷ 2 = 76. Therefore IQR = 76 − 68 = 8 marks. Note how the very high marks of 87 and 91 barely influence the IQR, even though they stretch the range out to 91 − 63 = 28.
A quick tip for ordering messy data sets, such as the mixed prices in many textbook problems: always sort the values from least to greatest first, before you even think about quartiles. Most calculation mistakes come from forgetting this step.
IQR & Outlier Detection (The 1.5×IQR Rule)
The IQR is also the basis for the most common method of formally identifying outliers – the 1.5 × IQR rule, also known as the Tukey fence method after the statistician John Tukey, who introduced it. You calculate two “fences” and flag any value that falls outside them:
- Lower fence: Q1 − (1.5 × IQR)
- Upper fence: Q3 + (1.5 × IQR)
- Any value below the lower fence or above the upper fence is flagged as a potential outlier.
Worked Example: Using the GP waiting-times data again, Q1 = 6, Q3 = 15 and IQR = 9.
Lower fence = 6 − (1.5 × 9) = 6 − 13.5 = −7.5.
Upper fence = 15 + (1.5 × 9) = 15 + 13.5 = 28.5.
The largest value, 28 days, is just inside the upper fence of 28.5, so it is an extreme value but not technically an outlier by this rule. Any practice with a wait longer than 28.5 days would be flagged as an outlier and worth investigating.
The 1.5 × IQR rule is the default method used to draw the whiskers on a box plot and to flag outliers in software such as SPSS, R and Excel. A stricter version uses 3 × IQR to identify “far” or extreme outliers. Whether a flagged point should be removed is a judgement call – it may be a data-entry error, or a genuine and important observation – so always investigate before deleting anything.
IQR & The Box Plot
The IQR is the core of the box plot (box-and-whisker plot), one of the most useful charts in statistics for showing spread at a glance. In a box plot:
- The box spans from Q1 to Q3 – its length is the IQR.
- The line inside the box marks the median (Q2).
- The whiskers extend to the smallest and largest values that lie within 1.5 × IQR of the box.
- Points beyond the whiskers are plotted individually as potential outliers.
Box plots are particularly useful for comparing distributions across groups – for example, comparing NHS waiting times across regions, or exam-score distributions across different schools. A wide box signals high variability in the middle 50%; a narrow box signals consistency. Box plots also sit naturally alongside other measures of variability when you summarise a data set.
When To Use IQR Vs Standard Deviation
Both the IQR and the standard deviation describe spread, but they suit different kinds of data. The IQR is robust and pairs with the median; the standard deviation is more efficient for clean, symmetric data and pairs with the mean. Use the table below to choose.
| Scenario | Use IQR or SD? | Why? |
|---|---|---|
| Skewed data (income, house prices, wait times) | IQR | Resistant to the outliers and skew that distort SD |
| Normally distributed data | SD | More statistically efficient; basis for parametric tests |
| Ordinal data (Likert items, degree classifications) | IQR | SD assumes equal intervals, which ordinal data lacks |
| Data with clear outliers | IQR | SD is heavily inflated by outliers; IQR is not |
| Reporting alongside the median | IQR | Natural pairing: median + IQR for non-normal data |
| Reporting alongside the mean | SD | Natural pairing: mean + SD for normal data |
If you are unsure which applies, check the shape of your distribution first. The type of variable you are working with also matters – see our guide to types of variables – because the level of measurement determines which summary statistics are valid in the first place.
Student Tip: In SPSS, you can get the IQR via Analyze > Descriptive Statistics > Explore. In the output, look at the ‘Percentiles’ table, which shows Q1 (25th percentile) and Q3 (75th percentile); subtract Q1 from Q3 to get the IQR. The Explore output also produces a box plot automatically. In Excel, use =QUARTILE.INC(range, 3) - QUARTILE.INC(range, 1).
Be aware that different software can return slightly different quartile values for the same data, because there are several accepted methods for interpolating quartiles. The hand-calculation method shown above (Tukey’s “median of each half”) is the one most often taught and is fine for coursework; SPSS and Excel’s QUARTILE.INC use a linear-interpolation method that can give marginally different Q1 and Q3 values. As long as you state which method you used, all are acceptable.