Quartile IQR Calculator

Calculate Q1, Q2, Q3, the interquartile range (IQR), Tukey fences, and identify outliers in a dataset.

Share this calculator

7

Q1 (25th)

12

Q2 median

14

Q3 (75th)

7

IQR

Q1 (25th percentile)7
Q2 — median (50th percentile)12
Q3 (75th percentile)14
IQR (Q3 − Q1)7
Lower fence (Q1 − 1.5 × IQR)-3.5
Upper fence (Q3 + 1.5 × IQR)24.5
OutliersNone
Count9

Also in Statistics

Descriptive Statistics

Quartile & IQR calculator — Q1, Q2, Q3, and outlier detection

Quartiles divide a dataset into four equal parts. Q1 (25th percentile), Q2 (median, 50th percentile), and Q3 (75th percentile) together describe the spread of the middle half of your data. The interquartile range (IQR = Q3 − Q1) is a robust measure of spread used in box plots and outlier detection.

Quartiles and the IQR

The interquartile range (IQR) measures how spread out the middle 50% of your data is. A small IQR means the data clusters tightly around the median; a large IQR indicates more variability. Because it uses only the middle values, the IQR is resistant to outliers — unlike the range (max − min) or the standard deviation, which are heavily influenced by extreme values.

The IQR is the foundation of box-and-whisker plots. The box spans Q1 to Q3, the line inside the box marks Q2 (median), and the whiskers extend to the Tukey fences.

Tukey fences and outlier detection

The Tukey method defines outlier fences as: 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 an outlier. For more extreme outliers, some analysts use inner fences (1.5 × IQR) and outer fences (3 × IQR).

The 1.5 × IQR rule is not a strict statistical test; it is a heuristic for identifying values that deserve closer inspection. Whether a flagged value is truly erroneous depends on domain knowledge.

Interpolation method

This calculator uses linear interpolation (Excel QUARTILE.INC method): Q1 = value at the 25th percentile by linear interpolation, Q2 = median (50th percentile), Q3 = value at the 75th percentile. For a dataset of n values sorted in ascending order, the index for the kth quartile is k/4 × (n − 1).

Frequently asked questions

What is the difference between the IQR and the standard deviation?

Both measure spread, but the IQR is robust to outliers while the standard deviation is not. The IQR measures the spread of the middle 50% of data. The standard deviation measures average distance from the mean, giving heavy weight to extreme values. For skewed distributions or data with outliers, the IQR is usually a better measure of typical spread.

Why does my quartile result differ from Excel?

This calculator uses QUARTILE.INC (linear interpolation). Excel also has QUARTILE.EXC, which excludes the endpoints and produces different results for small datasets. R's default quartile function offers five different methods. Results will agree for large datasets but may differ for small ones.

How many values do I need for a meaningful quartile calculation?

This calculator requires at least 4 values to compute quartiles. Technically fewer are possible, but with fewer than 4–5 values, the quartile estimates are not stable or meaningful. For reliable outlier detection, at least 20–30 values are recommended.

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.