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.

10 values parsed
Interquartile Range (IQR)
7.0000
10 values
Q3 − Q1 = 4336
2 outliers

Five-Number Summary

Min, Q1, Median, Q3, Max with IQR metrics

Min
7
Q1
25th %
36
Median
50th %
40.5
Q3
75th %
43
Max
49
IQR
7
Range
42
SIQR
3.5
Mean
35.9
Coefficient of Quartile Deviation: 8.86%(Q3−Q1)/(Q3+Q1)
10 values, sorted ascending
7153639404142434749
MedianQ1/Q3Outlier

Box & Whisker Plot

Visual distribution with outlier markers

Min
7
Q1
36
Median
40.5000
Q3
43
Max
49
IQR = 7 — the middle 50% of your data spans 7 units

Outliers Detected (2)

Values outside Tukey fences (1.5×IQR from Q1/Q3)

Extreme Outliers (beyond 3×IQR)

Extreme 17

Mild Outliers (1.5×IQR – 3×IQR)

Mild 115

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

7153639404142434749

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 = 3610.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

  1. Sort the data in ascending order.
  2. Find the median (Q2) — the middle value that divides the data into two halves.
  3. Find Q1 — the median of the lower half (values below the overall median).
  4. Find Q3 — the median of the upper half (values above the overall median).
  5. 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

MeasureFormulaResistant?Best for
IQRQ3 − Q1YesSkewed data, outlier detection
RangeMax − MinNoQuick spread overview
Std Dev√(Σ(x−x̄)²/n)NoNormal 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.