IQR Calculator
Enter up to 10 values to compute the first quartile (Q1), third quartile (Q3), and interquartile range (IQR = Q3 - Q1). The IQR measures the spread of the middle 50% of data.
The interquartile range (IQR) measures the spread of the middle 50% of data. It's the difference between the third quartile (Q3, 75th percentile) and first quartile (Q1, 25th percentile). Unlike standard deviation, which can be inflated by extreme values, the IQR is robust to outliers — making it the preferred spread measure for skewed distributions or data with extreme values.
This calculator returns Q1, Q3, and the IQR. The IQR is fundamental to box plots, outlier detection (1.5×IQR rule), and any analysis requiring a robust measure of variability. It's particularly useful for: - **Income data**: outliers (CEOs) don't dominate. - **Time-to-failure**: extreme values often present. - **Test scores**: middle students of interest. - **Manufacturing tolerances**: tracking process consistency.
IQR provides intuitive interpretation: half of all values fall between Q1 and Q3, covering the IQR width. A small IQR means tight clustering; a large IQR means wide variability. For comparing groups: similar medians but different IQRs reveals different consistency levels.
Inputs
Results
IQR
13.5
Q1 (25th Percentile)
9.25
Q2 (Median)
17.5
Q3 (75th Percentile)
22.75
Lower Fence
-11
Upper Fence
43
Min
4
Max
30
Formula
How to use this calculator
- Enter data values.
- Calculator returns Q1, Q3, and IQR.
- Use for outlier detection: Q1-1.5×IQR and Q3+1.5×IQR.
- Compare IQRs to assess group variability.
- IQR more robust than SD for skewed data.
- Use median + IQR for robust summary statistics.
Worked examples
Income analysis
**Scenario:** Annual salaries: $35K, $40K, $45K, $50K, $55K, $60K, $65K, $200K (CEO). **Calculation:** Median = $52.5K. Q1 = $42.5K. Q3 = $62.5K. IQR = $20K. Outlier check: $62.5K + 30 = $92.5K. $200K is outlier. **Result:** Middle 50% of employees earn $42.5K-$62.5K. CEO at $200K is statistical outlier. IQR provides robust spread; standard deviation would be inflated by CEO salary.
Manufacturing tolerance
**Scenario:** Part dimensions in mm: 49.8, 49.9, 50.0, 50.0, 50.1, 50.1, 50.2, 50.3. **Calculation:** Median = 50.05. Q1 = 49.95. Q3 = 50.15. IQR = 0.20. **Result:** Middle 50% of parts within 0.20mm range. Very tight tolerance. Process well-controlled. Specs allow ±0.50mm; current process exceeds requirements.
Comparing two groups
**Scenario:** Group A test scores: 70, 75, 80, 82, 85. Group B: 50, 70, 85, 95, 100. **Calculation:** A: Q1=72.5, Q3=83.5, IQR=11. B: Q1=60, Q3=97.5, IQR=37.5. **Result:** Group A more consistent (smaller IQR). Group B has wider spread despite similar medians. Educational implications: A more uniform performance; B has greater variability needing differentiated instruction.
When to use this calculator
**Use IQR for:**
- **Spread measurement** robust to outliers. - **Outlier detection** (1.5×IQR rule). - **Box plot construction**. - **Skewed distributions** where SD misleading. - **Comparing variability** across groups with outliers. - **Educational reporting** alongside median.
**IQR vs other spread measures:**
| Measure | Pros | Cons | |---|---|---| | IQR | Robust to outliers | Misses tail info | | SD | Standard, theoretical | Sensitive to outliers | | Range | Simple | Heavily affected by extremes | | Variance | Underlying SD | Same issues + units squared | | MAD | Very robust | Less familiar |
**Choose IQR when:**
- Data has outliers. - Distribution skewed. - Reporting alongside median. - Robust summary needed.
**Choose SD when:**
- Data approximately normal. - Theoretical work. - Confidence intervals. - Most statistical tests.
**Outlier identification rules:**
| Rule | Method | |---|---| | 1.5×IQR | Standard, Tukey | | 3×SD | Normal distribution | | 1% / 99% percentiles | Tail rule | | Modified z-score | More robust |
The 1.5×IQR is most common for general use.
**Common applications:**
- **Income / wealth data**: outliers common. - **Time data**: skewed distributions. - **Manufacturing**: process variation. - **Educational testing**: identifying extremes. - **Healthcare**: clinical measurements. - **Sports analytics**: performance ranges.
**Software:**
- **Excel**: QUARTILE.INC() for Q1, Q3. - **R**: quantile() function; IQR(). - **Python**: numpy.percentile(), scipy.stats.iqr(). - **SPSS**: Descriptive Statistics → Frequencies.
**Best practices:**
- Report median + IQR for skewed data. - Use mean + SD for normal data. - Always note sample size. - Investigate outliers before removing. - Compare with other measures.
**Limitations:**
- Doesn't use specific values (just ranks). - Ignores tail information. - Less efficient for normal data than SD. - Convention varies across software.
Common mistakes to avoid
- Confusing IQR with range (Max-Min).
- Using SD instead of IQR for skewed/outlier-rich data.
- Forgetting to sort data before calculating quartiles.
- Inconsistent quartile method across software.
- Ignoring outliers without investigation.
- Calculating IQR for too few data points.
- Confusing IQR with IQR-based outlier rule.