Interquartile Range (IQR) Calculator
Find the interquartile range (the spread of the middle 50% of data), plus the lower and upper fences used to detect outliers in boxplot analysis.
Advertisement
Calculator
See your Interquartile Range (IQR) Calculator results
Enter your email to unlock results — free forever.
No spam, ever. Unsubscribe at any time.
Advertisement
Formula
IQR = Q3 − Q1 | Fences = Q1 − 1.5×IQR, Q3 + 1.5×IQR
The IQR is simply Q3 minus Q1 — the range that contains the middle 50% of the data. The lower fence (Q1 − 1.5×IQR) and upper fence (Q3 + 1.5×IQR) define Tukey's outlier boundaries. Any data point below the lower fence or above the upper fence is classified as a mild outlier. Points beyond Q1 − 3×IQR or Q3 + 3×IQR are extreme outliers.
How to use the Interquartile Range (IQR) Calculator
- 1
Enter your first quartile (q1)
- 2
Enter your third quartile (q3)
- 3
Read your results instantly
Results update in real time as you type.
Advertisement
IQR as a robust measure of spread
The interquartile range measures how spread out the middle half of the data is. Unlike standard deviation, IQR is resistant to outliers — extreme values do not affect Q1 or Q3 at all. This makes IQR preferable to standard deviation when data is skewed or contains outliers.
For the default values Q1=25, Q3=75, the IQR is 50. The lower fence is 25 − 75 = −50 and the upper fence is 75 + 75 = 150. Any value below −50 or above 150 would be flagged as a potential outlier.
Using IQR for outlier detection
Tukey's fence rule uses 1.5×IQR on each side of the quartiles to define mild outliers. Any point outside these fences is shown as a separate dot (rather than a whisker) on a standard boxplot. The 1.5 multiplier is a convention — it works well for roughly normal data but may need adjustment for other distributions.
For a normal distribution, fewer than 1% of values fall outside the 1.5×IQR fences. If many values are flagged as outliers, the data may be heavy-tailed or multimodal rather than contaminated by errors.
Advertisement
IQR vs. standard deviation for skewed data
Income, house prices, and many biological measurements are right-skewed — most values are low but a few are very high. For such data, standard deviation is inflated by the high outliers and gives a misleading picture of typical spread. IQR is unaffected and better describes the typical range of values.
When reporting statistics on skewed data, median and IQR are the preferred summary measures (rather than mean and standard deviation). Box plots visualize these five-number summaries effectively.
Tips & Insights
Q1 is the 25th percentile, Q3 is the 75th
Q1 is the value below which 25% of data falls. Q3 is the value below which 75% of data falls. Different software uses slightly different interpolation methods, so Q1 and Q3 may vary slightly between tools.
IQR is the boxplot's box width
In a standard boxplot (box-and-whisker plot), the box spans from Q1 to Q3. Its width visually represents the IQR. The median is shown as a line inside the box.
Use the five-number summary for full context
IQR alone does not tell the full story. The five-number summary (minimum, Q1, median, Q3, maximum) gives a complete picture of the distribution's shape and spread.
Worked Examples
Salary distribution
IQR: $40,000. Lower fence: $-15,000 (not meaningful — no negative salaries). Upper fence: $145,000. Salaries above $145,000 are statistical outliers.
Test score distribution
IQR: 20. Lower fence: 30. Upper fence: 110 (capped at 100 for test scores). Scores below 30 would be outliers, but the upper fence is not binding.
Advertisement
Frequently Asked Questions
What is the interquartile range?
The interquartile range (IQR) is the difference between the third quartile (Q3) and the first quartile (Q1). It measures the spread of the middle 50% of the data.
How is IQR used to detect outliers?
Tukey's rule flags values below Q1 − 1.5×IQR or above Q3 + 1.5×IQR as potential outliers. These boundaries are the fences shown on standard boxplots.
Why is IQR more robust than standard deviation?
IQR is based on percentiles, so extreme values do not affect it. Standard deviation uses all values and squares the deviations, so even one extreme outlier can greatly inflate it.
What does a large IQR indicate?
A large IQR means the middle half of the data is widely spread. This could indicate genuine variability in the population or a multimodal distribution.
What is Q2 and why isn't it in the formula?
Q2 is the median (50th percentile). It is not needed to compute IQR, but it is part of the five-number summary along with the minimum, Q1, Q3, and maximum.
Advertisement