Interquartile Range (IQR) Calculator

Enter a dataset — get Q1, Q2, Q3, IQR, Tukey outlier bounds, and a visual box plot with full step-by-step working.

SVG Box Plot Outlier Detection Tukey's Fences Step-by-Step Working
Share this tool

(minimum 4 required)

Quick Load:

Calculating...

Enter your dataset above and click Calculate IQR.

What Is the Interquartile Range (IQR)?

The interquartile range (IQR) measures the spread of the middle 50% of a dataset. It is the difference between the third quartile (Q3) and the first quartile (Q1): IQR = Q3 − Q1. Because it ignores the top and bottom 25% of values, the IQR is not distorted by extreme values or outliers, making it one of the most robust measures of statistical dispersion.

Statisticians, data scientists, and researchers rely on the IQR for box plots, outlier detection, and understanding whether data is tightly clustered or widely spread. It is a core tool in descriptive statistics alongside the mean, median, and standard deviation.

How to Calculate the IQR — Step by Step

This calculator uses the exclusive (Tukey's hinges) method, which is the standard used by most statistics courses, the TI-84 calculator, and statology.org. for odd-length datasets, the median is excluded from both halves before computing Q1 and Q3.

1

Sort the data

Arrange all values in ascending order

Q2 (median) = middle value for odd n, mean of two middle values for even n.

2

Find IQR

IQR = Q3 − Q1

Q1 = median of lower half; Q3 = median of upper half.

3

Lower outlier fence

Lower fence = Q1 − 1.5 × IQR

Any value below this threshold is a suspected low outlier.

4

Upper outlier fence

Upper fence = Q3 + 1.5 × IQR

Any value above this threshold is a suspected high outlier.

Worked Example

Dataset: 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 35

Sorted: [2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 35] (n = 11, odd)

Q2 = 6 (middle element, index 5)

Lower half: [2, 3, 4, 5, 5] → Q1 = 4

Upper half: [7, 8, 8, 9, 35] → Q3 = 8

IQR = 8 − 4 = 4

Lower fence = 4 − 1.5 × 4 = −2

Upper fence = 8 + 1.5 × 4 = 14

Outlier: 35 > 14 → flagged as outlier

Understanding the Box Plot

A box and whisker plot (box plot) is a compact visual summary of a distribution. It shows five key values at a glance: minimum non-outlier, Q1, median, Q3, and maximum non-outlier. Outliers appear as individual points beyond the whiskers.

The Box

Spans Q1 to Q3. Width equals the IQR. The vertical line inside the box is the median (Q2). A box positioned to the left indicates right-skewed data; a box to the right indicates left-skewed data.

The Whiskers

Extend from Q1 to the smallest non-outlier value, and from Q3 to the largest non-outlier value. They show the range of typical (non-extreme) data points.

Outlier Points

Plotted as individual symbols beyond the whisker ends. A value is an outlier if it falls below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR (Tukey's 1.5 × IQR rule).

Skewness

If the median line sits closer to Q1, the data is right-skewed (long right tail). If it sits closer to Q3, the data is left-skewed. A centred median suggests a roughly symmetric distribution.

How to Find Outliers with Tukey's Fences

The 1.5 × IQR rule (Tukey's fences) is the most widely taught outlier detection method in introductory statistics. It defines two boundaries:

Lower fence = Q1 − 1.5 × IQR

Upper fence = Q3 + 1.5 × IQR

Values outside these fences are classified as mild outliers. Some analyses use a stricter 3.0 × IQR rule to identify extreme outliers — values that are very unlikely to occur by chance in a normal distribution.

Important: the IQR method flags potential outliers — it does not prove they are errors. An outlier might be a legitimate extreme value (e.g. a record-breaking salary), a data entry mistake, or evidence that the dataset comes from a mixture of two different populations. Always investigate flagged values before removing them.

IQR vs Standard Deviation — When to Use Each

PropertyIQRStandard Deviation
MeasuresSpread of middle 50%Spread around the mean
Affected by outliersNoYes
Best for skewed data✓✗
Best for symmetric data–✓
Used in box plots✓✗
Used in Z-score outlier detection✗✓

Rule of thumb: use the IQR and median when your data might be skewed or contain outliers. Use standard deviation and mean when you have a roughly symmetric distribution with no extreme values.

IQR Calculator FAQ

What does the interquartile range tell you?

The IQR tells you how spread out the middle half of your data is. A small IQR means values cluster tightly around the median; a large IQR means they are spread across a wide range. Unlike the full range (max − min), the IQR is not distorted by a single extreme value, so it gives a reliable picture of typical data variability.

How do you find Q1, Q2, and Q3?

Sort the data ascending. Q2 (the median) is the middle value for an odd number of data points, or the average of the two middle values for an even count. Q1 is the median of the lower half of the data (excluding Q2 itself for odd n), and Q3 is the median of the upper half.

What is the IQR method for outliers?

Calculate the lower fence (Q1 − 1.5 × IQR) and the upper fence (Q3 + 1.5 × IQR). Any data point below the lower fence or above the upper fence is flagged as a potential outlier. This method was introduced by statistician John Tukey in 1977 and remains the most common outlier detection technique in introductory statistics.

What is a box and whisker plot?

A box plot is a five-number summary displayed visually. The box spans Q1 to Q3 (the IQR), with an interior line at the median (Q2). Whiskers extend from Q1 to the smallest non-outlier value and from Q3 to the largest non-outlier value. Outliers are shown as individual points. Box plots make it easy to compare distributions across multiple groups side by side.

Why is the IQR better than range for outlier detection?

The plain range (max − min) is entirely determined by two values — the very highest and lowest in the dataset. One extreme outlier can make the range appear enormous even if all other values are tightly clustered. The IQR uses only the middle 50% of the data, so it is inherently resistant to the distortion that extreme values cause.

How many values do you need to calculate an IQR?

You need at least 4 values — this allows the data to be split into a lower half and an upper half, each with at least 2 values, from which Q1 and Q3 can be computed as meaningful medians. With only 2 or 3 values, the quartile calculation is either undefined or trivially equal to the data values themselves. This calculator enforces a minimum of 4 values and supports up to 500.