IQR Calculator — Interquartile Range

This interquartile range calculator finds the IQR of a dataset quickly. Enter a list of numbers to find Q1, median, Q3, and the IQR.

How to Calculate IQR

1. Sort the numbers

Arrange the dataset from smallest to largest.

2. Find the median

The median is the middle value (or the average of the two middle values, if the count is even).

3. Find Q1

Q1 is the median of the lower half of the data. If the dataset has an odd number of values, exclude the overall median before dividing the remaining values into lower and upper halves.

4. Find Q3

Q3 is the median of the upper half of the data, using the same method as Q1.

5. Subtract Q1 from Q3

The interquartile range is simply Q3 minus Q1.

IQR Formula

IQR = Q3 − Q1

Q1 is the first quartile, Q2 is the median, and Q3 is the third quartile. They correspond approximately to the 25th, 50th, and 75th percentiles, respectively.

Example

Dataset: 12, 15, 18, 21, 25, 30, 32, 40

Sorted dataset: 12, 15, 18, 21, 25, 30, 32, 40 (already sorted)

Median: (21 + 25) ÷ 2 = 23

Lower half: 12, 15, 18, 21 → Q1 = (15 + 18) ÷ 2 = 16.5

Upper half: 25, 30, 32, 40 → Q3 = (30 + 32) ÷ 2 = 31

IQR = 31 − 16.5 = 14.5

What Does IQR Tell You?

The interquartile range describes the spread of the middle 50% of a dataset, measured from the first quartile (Q1) to the third quartile (Q3). Because it focuses on the middle of the data, IQR is less affected by extreme values than the full range.

For other measures of central tendency, see our Average Calculator.

IQR and Outliers

IQR is commonly used to flag potential outliers with the 1.5 × IQR rule:

Lower fence
Q1 − 1.5 × IQR
Upper fence
Q3 + 1.5 × IQR

Any value below the lower fence or above the upper fence is flagged as a potential outlier. This is a supporting check, not part of the core IQR calculation — a flagged value is worth a closer look, not automatically wrong or invalid.

Frequently asked questions

How to find IQR by hand?

Sort your numbers, find the median, split the data into a lower half and an upper half (excluding the median itself if the count is odd), then find the median of each half to get Q1 and Q3. Subtract Q1 from Q3 to get the IQR.

What's the difference between the first quartile and third quartile?

Q1 is the first quartile and marks the point around which 25% of the data lies below it. Q3 is the third quartile and marks the point around which 75% of the data lies below it. The interquartile range is the difference between Q3 and Q1.

Do different methods give different IQR values for the same data?

Yes. Several accepted methods can be used to calculate quartiles, including the median-of-halves method and methods based on interpolation. They can produce different Q1, Q3, and IQR values for the same dataset. This calculator uses the median-of-halves method.