IQR Calculator
Calculate the lower quartile (Q1), median (Q2), upper quartile (Q3), interquartile range (IQR), and 1.5xIQR outlier fences with an interactive box plot.
Quartiles, IQR & 1.5x Outlier Finder
Tukey exclusive (AP Stats) and Excel inclusive quartiles
How to Use This IQR & Quartile Calculator
- Paste Comma or Space-Separated Numerical Data: Enter any unsorted numeric observations from homework problems, lab tables, or CSV exports.
- Select Exclusive (TI-84/AP) or Inclusive (Excel) Quartiles: Choose Exclusive for textbook/AP Statistics or Inclusive to match Excel QUARTILE.INC.
- Inspect Five-Number Summary & IQR Spread: Read sorted Minimum, Lower Quartile (Q1), Median (Q2), Upper Quartile (Q3), Maximum, and IQR = Q3 - Q1.
- Check Tukey 1.5xIQR Outlier Fences & Box Plot: See exact lower and upper fence cutoffs and every observation automatically flagged as a statistical outlier.
IQR Formula, Worked Scenarios & Outlier Fences
Scenario 1 (Even Sample With Outlier [12, 15, 18, 22, 24, 25, 29, 31, 35, 68]): Under AP/TI-84 Exclusive quartiles, lower half median is Q1 = 18 and upper half median is Q3 = 31. Thus IQR = 13, and the upper Tukey fence 31 + 1.5(13) = 50.5 cleanly flags 68 as an outlier.
Scenario 2 (Odd Sample Dataset [4, 7, 9, 11, 14, 18, 21]): Under Exclusive quartiles, median Q2 = 11 is excluded from both halves: Q1 = 7, Q3 = 18, giving IQR = 11 (whereas Excel QUARTILE.INC interpolates to Q1 = 8, Q3 = 16, IQR = 8).
| Measure | Formula | What It Shows |
|---|---|---|
| Q1 (Lower Quartile) | 25th percentile | 25% of observations fall below Q1 |
| Q2 (Median) | 50th percentile | Middle value robust against skewness |
| Q3 (Upper Quartile) | 75th percentile | 75% of observations fall below Q3 |
| IQR | Q3 - Q1 | Spread of the middle 50% of values |
Quartile Conventions, Small Samples & Common Mistakes
- Mismatched Software Quartile Methods: R and SciPy default to interpolated quantiles (`QUARTILE.INC` / Type 7 linear interpolation), whereas AP Statistics, Minitab, and TI-84 use exclusive Tukey hinges (`QUARTILE.EXC`); always specify which rule your instructor or statistical journal requires before submitting assignments.
- Deleting Outliers Without Investigation: Tukey's 1.5xIQR fence flags unusual measurements for closer inspection, so never automatically delete genuine right-skewed observations (such as emergency room billing spikes, housing prices, or startup revenue outliers) unless they are verified instrument or data-entry errors.
- Sorting Unsorted Inputs & Small Samples: Quartile partitions require strictly ascending sorted order before splitting lower and upper halves, and samples smaller than n = 4 yield unstable hinge spreads compared to full five-number summaries.
Aligned with NIST/SEMATECH and AP Statistics standards. Reviewed by our Math Review Team.
Related Statistics & Data Calculators
Frequently Asked Questions
How do you calculate the interquartile range (IQR)?
Sort your numbers in ascending order, find the first quartile Q1 (median of the lower half) and third quartile Q3 (median of the upper half), then subtract: IQR = Q3 - Q1.
What is the 1.5 x IQR rule for outliers?
Any observation below Q1 - 1.5 x IQR (the lower fence) or above Q3 + 1.5 x IQR (the upper fence) is classified as a statistical outlier on a standard Tukey box plot.
Why do AP Statistics and Excel sometimes give slightly different Q1 and Q3?
AP Statistics and TI-84 calculators use the exclusive method (splitting odd datasets strictly below and above the median), while Excel QUARTILE.INC uses inclusive linear interpolation. This calculator supports both methods.
When should you use IQR instead of standard deviation?
IQR is resistant to extreme outliers and skewed distributions, making it ideal for salaries, housing prices, or skewed lab measurements where standard deviation gets distorted.
How is semi-interquartile range defined?
Semi-interquartile range (quartile deviation) equals half of the interquartile range: (Q3 - Q1) / 2, measuring the average distance from the median to Q1 and Q3 in symmetric datasets.