Interquartile Range Calculator

Statistics

IQR Calculator

Calculate quartiles, interquartile range, and identify outliers using the 1.5×IQR rule.

Input Data

Results

Interquartile Range (IQR)
7.5000
n
11
Min
7.00
Q1 (25th %ile)
37.5000
Median (Q2)
41.0000
Q3 (75th %ile)
45.0000
Max
55.00
Range
48.00
Semi-IQR
3.7500
Outlier Fences
Lower: 26.2500 | Upper: 56.2500
Outliers: 7, 15

What is the Interquartile Range?

The Interquartile Range (IQR) is a measure of statistical dispersion that represents the spread of the middle 50% of a dataset. It's calculated as the difference between the third quartile (Q3) and the first quartile (Q1):

IQR = Q3 − Q1

Key Properties:

  • Robust to outliers: Unlike range or standard deviation, IQR ignores the extreme 25% of data on each end.
  • Quartile-based: Divides data into four equal parts (0%, 25%, 50%, 75%, 100%).
  • Outlier detection: The 1.5×IQR rule identifies points beyond the lower fence (Q1 − 1.5×IQR) or upper fence (Q3 + 1.5×IQR).
  • Box plot foundation: IQR defines the width of the box in box-and-whisker plots.

When to use IQR: Prefer IQR for skewed distributions, small samples, or datasets with potential outliers. Use standard deviation for symmetric, normally-distributed data.

How to Calculate IQR

1

Sort your data

Arrange all values in ascending order from smallest to largest.

2

Find the median (Q2)

The middle value divides data into lower and upper halves.

3

Calculate Q1 (25th percentile)

The median of the lower half separates the lowest 25% from the rest.

4

Calculate Q3 (75th percentile)

The median of the upper half separates the highest 25% from the rest.

5

Compute IQR

Subtract: IQR = Q3 − Q1. This represents the spread of the middle 50%.

6

Identify outliers (optional)

Any value below Q1 − 1.5×IQR or above Q3 + 1.5×IQR is flagged as an outlier.

Example Calculation

Dataset: 7, 15, 36, 39, 40, 41, 42, 43, 47, 49, 55 (n=11) Sorted: 7, 15, 36, 39, 40, 41, 42, 43, 47, 49, 55 Positions (0-indexed): Q1 position: 0.25 × (11-1) = 2.5 → between index 2 and 3 Q2 position: 0.50 × (11-1) = 5.0 → exactly at index 5 Q3 position: 0.75 × (11-1) = 7.5 → between index 7 and 8 Linear interpolation: Q1 = data[2] + 0.5 × (data[3] - data[2]) = 36 + 0.5 × 3 = 37.5 Median (Q2) = data[5] = 41 Q3 = data[7] + 0.5 × (data[8] - data[7]) = 43 + 0.5 × 4 = 45.0 IQR = Q3 − Q1 = 45.0 − 37.5 = 7.5 Outlier Detection (1.5×IQR rule): Lower fence = Q1 − 1.5×IQR = 37.5 − 1.5×7.5 = 37.5 − 11.25 = 26.25 Upper fence = Q3 + 1.5×IQR = 45.0 + 1.5×7.5 = 45.0 + 11.25 = 56.25 All values between 26.25 and 56.25, so no outliers detected.

The IQR of 7.5 tells us the middle 50% of data spans 7.5 units. With all values within the fences (26.25–56.25), this dataset has no extreme outliers.

Frequently Asked Questions

Related Tools