Interquartile Range (IQR) Calculator

Calculate IQR, quartiles, and outlier fences from a dataset. IQR = Q3 - Q1 measures the spread of the middle 50% of data. Identify potential outliers using the 1.5×IQR rule.

📊 Statistics📐 IQR = Q3 - Q1🔢 Math
Enter dataset (comma-separated)
Please enter valid values.

Formula & Reference

VariableSymbolFormulaUnits
Interquartile Range (IQR) CalculatorIQR = Q3 - Q1same as data units

Step-by-Step Examples

Example 1
Exam Scores

Dataset: 55,60,65,70,75,80,85,90,95,100.

  • n=10 sorted values
  • Q1 = 65 (25th percentile)
  • Q2 = 77.5 (median)
  • Q3 = 90 (75th percentile)
  • IQR = 90 - 65 = 25
  • Fences: 65-37.5=27.5 to 90+37.5=127.5: no outliers
✓ IQR = 25, no outliers
Example 2
Outlier Detection

Income data: 30,35,40,45,50,55,60,200 (thousands).

  • Q1 = 36.25, Q3 = 56.25, IQR = 20
  • Lower fence = 36.25 - 30 = 6.25
  • Upper fence = 56.25 + 30 = 86.25
  • 200 > 86.25: outlier detected
✓ 200 is an outlier
Example 3
Box Plot Summary

Data: 10,12,15,18,20,25,30. Summarize for box plot.

  • Min=10, Q1=12, Median=18, Q3=25, Max=30
  • IQR=13, Fences: -7.5 to 44.5
  • No outliers — all within fences
  • Box from 12 to 25, whiskers to 10 and 30
✓ Box plot: [12|18|25], whiskers 10-30

Real-World Applications

Common Mistakes to Avoid

⚠️
Treating IQR outliers as errors

Values beyond 1.5×IQR are potential outliers worth examining, but they may be real and important data. Always investigate before removing.

⚠️
Using IQR for small datasets

With n < 10, quartile estimates are unreliable. IQR-based outlier detection works best with n ≥ 20.

⚠️
Not sorting data first

Quartile calculation requires sorted data. Always sort before finding Q1 and Q3 positions.

Frequently Asked Questions

What is IQR?
The difference between the third quartile (Q3) and first quartile (Q1). Contains the middle 50% of data. Robust measure of spread: unaffected by outliers or extreme values.
How does the 1.5×IQR rule work?
Lower fence = Q1 - 1.5×IQR. Upper fence = Q3 + 1.5×IQR. Any data point beyond these fences is flagged as a potential outlier. This rule was proposed by John Tukey.
Why is IQR better than range for spread?
Range = max - min and is heavily influenced by one extreme value. IQR ignores the top and bottom 25% of data, making it much more robust to outliers.
What is the 3×IQR rule?
For severe/extreme outliers: values beyond Q1-3×IQR or Q3+3×IQR. The 1.5×IQR rule catches mild outliers; 3×IQR catches extreme ones. Both are commonly used.
How to calculate quartiles with different methods?
There are multiple conventions (R uses 7 methods!). The most common: Method 1 (textbook): median of lower/upper halves. Method 2 (linear interpolation): used by Excel and many software packages.

Related Math Calculators

Formula Explorer connections

Interpretation: This formula summarizes data, models uncertainty or supports inference about a population or random process. Assumption: The sampling design and distribution assumptions must match the data. Independence, sample size, outliers and measurement quality can materially affect interpretation.

Least-Squares Regression Calculator →Line of Best Fit Visualizer Calculator →Linear Regression Calculator →Math Formula Explorer →