IQR Calculator
Free IQR calculator. Enter data to find interquartile range, Q1, Q3, five-number summary, and outliers. Step-by-step solution with box plot visualization.
Supports commas, spaces, tabs, or new lines. Paste from spreadsheets works too.
Five-Number Summary
Min, Q1, Median, Q3, Max with IQR metrics
Box & Whisker Plot
Visual distribution with outlier markers
Outliers Detected (2)
Values outside Tukey fences (1.5×IQR from Q1/Q3)
Extreme Outliers (beyond 3×IQR)
Mild Outliers (1.5×IQR – 3×IQR)
Lower fence (mild): 36 − 1.5 × 7 = 25.50
Upper fence (mild): 43 + 1.5 × 7 = 53.50
Lower fence (extreme): 36 − 3 × 7 = 15
Upper fence (extreme): 43 + 3 × 7 = 64
Step-by-Step Solution
How the IQR is calculated using the Exclusive (Tukey) method
Step 1: Sort the data in ascending order
n = 10 values
Step 2: Find Q1 (first quartile)
Q1 = 36
Lower half = first 5 values. Q1 = median of lower half = 36
Step 3: Find Q3 (third quartile)
Q3 = 43
Upper half = last 5 values. Q3 = median of upper half = 43
Step 4: Calculate IQR = Q3 − Q1
IQR = 43 − 36 = 7
The interquartile range is 7. This means the middle 50% of your data spans 7 units.
Step 5: Outlier fences (Tukey method)
Fences: [25.50, 53.50]
Lower fence = Q1 − 1.5 × IQR = 36 − 10.50 = 25.50
Upper fence = Q3 + 1.5 × IQR = 43 + 10.50 = 53.50
2 values fall outside the fences: 7, 15
What Is the Interquartile Range (IQR)?
A robust measure of statistical spread
The Interquartile Range (IQR) measures the spread of the middle 50% of a dataset. It is calculated as the difference between the third quartile (Q3, 75th percentile) and the first quartile (Q1, 25th percentile): IQR = Q3 − Q1.
Example
Dataset: 3, 7, 8, 12, 13, 18, 21
Q1 = 7 | Median = 12 | Q3 = 18 | IQR = 18 − 7 = 11
Unlike the range (max − min), the IQR is not affected by extreme values, making it a resistant measure of spread. This is why it is used alongside the median rather than with the mean.
How to Calculate IQR Step by Step
The complete IQR calculation process
- Sort the data in ascending order.
- Find the median (Q2) — the middle value that divides the data into two halves.
- Find Q1 — the median of the lower half (values below the overall median).
- Find Q3 — the median of the upper half (values above the overall median).
- Calculate IQR = Q3 − Q1.
Exclusive (Tukey)
Splits data at the median, excluding it for odd n. Most common in textbooks.
Inclusive (Excel INC)
Uses linear interpolation at p×(n−1). Default in Excel QUARTILE.INC and NumPy.
Interpolation (Excel EXC)
Interpolation at p×(n+1). Excludes endpoints. Used by Excel QUARTILE.EXC.
Using IQR to Detect Outliers
The Tukey fence method for identifying unusual values
The IQR is the standard tool for outlier detection using Tukey fences (also called the 1.5×IQR rule). Values outside the fences are flagged as potential outliers.
Tukey Fence Formulas
Mild outlier fences
Lower = Q1 − 1.5 × IQR
Upper = Q3 + 1.5 × IQR
Extreme outlier fences
Lower = Q1 − 3 × IQR
Upper = Q3 + 3 × IQR
Mild outliers fall between 1.5×IQR and 3×IQR from Q1 or Q3. Extreme outliers fall beyond 3×IQR. In box plots, mild outliers appear as individual points beyond the whiskers.
IQR vs Range vs Standard Deviation
Choosing the right measure of spread
| Measure | Formula | Resistant? | Best for |
|---|---|---|---|
| IQR | Q3 − Q1 | Yes | Skewed data, outlier detection |
| Range | Max − Min | No | Quick spread overview |
| Std Dev | √(Σ(x−x̄)²/n) | No | Normal distributions |
When to use IQR
- • Income, salary, or price data (skewed)
- • Quality control (finding defects)
- • Identifying outliers in any dataset
- • Medical data with extreme values
When to use Std Dev
- • Normally distributed data
- • Inferential statistics (confidence intervals)
- • When all data points matter equally
- • Comparing variation between groups
Frequently Asked Questions
Common questions about IQR, quartiles, outlier detection, and box plots
Embed IQR Calculator
Add this calculator to your website or blog for free.
You Might Also Like
Related calculators from other categories
Last updated Apr 12, 2026