IQR Calculator - Interquartile Range, Q1, Q3 & Outliers
Calculate the interquartile range (IQR), quartiles Q1 and Q3, median, and identify outliers using the 1.5×IQR rule from any comma-separated dataset.
Enter your data as comma-separated numbers, then click Calculate to get the full five-number summary, IQR, fence values, and any outliers.
IQR Calculator - Interquartile Range, Q1, Q3 & Outliers
Calculate the interquartile range (IQR), quartiles Q1 and Q3, median, and identify outliers using the 1.5×IQR rule from any comma-separated dataset.
Enter numbers separated by commas or spaces, e.g. 2, 4, 4, 5, 6, 7, 8, 9
About the IQR Calculator
The interquartile range (IQR) is the range of the middle 50% of a dataset — the distance between the 25th percentile (Q1) and the 75th percentile (Q3). It is one of the most robust and widely used measures of statistical dispersion because, unlike the total range or standard deviation, it is completely unaffected by extreme values and outliers. Whether you are analysing exam scores, blood pressure readings, housing prices, manufacturing tolerances, or any other real-world dataset, the IQR provides a reliable picture of the central spread.
To compute the IQR, the calculator first sorts the data from smallest to largest, then locates Q1 and Q3 using linear interpolation on the order statistics. Q1 is the value at the 25th percentile — the point below which 25% of the data falls. Q3 is the value at the 75th percentile — the point below which 75% of the data falls. The IQR is simply Q3 − Q1. The median (Q2), minimum, and maximum are also reported to give you the complete five-number summary, which is the foundation of a box-and-whisker plot.
The 1.5×IQR rule, introduced by John Tukey, is the standard method for identifying potential outliers. Any data point below the lower fence (Q1 − 1.5×IQR) or above the upper fence (Q3 + 1.5×IQR) is considered a suspected outlier. These fences define the whiskers in a Tukey box plot. A point more than 3×IQR from the nearest quartile (the inner fence extended to an outer fence) is considered an extreme outlier. The calculator flags all values outside the 1.5×IQR fences.
It is important to note that the 1.5×IQR rule identifies statistical outliers — values that are unusually far from the central bulk of the data — but not necessarily data errors. A point flagged as an outlier might be a measurement error, a data entry mistake, a fraud signal, or simply a genuinely rare but legitimate observation. Domain knowledge is always needed to decide what to do with flagged points.
The IQR is the preferred dispersion measure when data is skewed or when outliers are expected, such as income distributions, reaction times, or house prices in mixed markets. For symmetric, normally distributed data without outliers, the standard deviation is slightly more efficient. But when robustness matters — in exploratory data analysis, in nonparametric statistics, or whenever you cannot assume normality — the IQR is the go-to tool for characterising how spread out the middle of your data is.
IQR Examples
Four datasets showing how IQR and outlier detection work in practice.
| Dataset | IQR | Notes |
|---|---|---|
| 2, 4, 4, 5, 6, 7, 8, 9 | IQR = 3.25 (Q1=4, Q3=7.25) | Even number of values. Q1=4, median=5.5, Q3=7.25. No outliers detected. |
| 10, 20, 30, 40, 50, 60, 70 | IQR = 30 (Q1=25, Q3=55) | Odd count: Q1=25, median=40, Q3=55, IQR=30. Lower fence=−20, upper fence=100. No outliers. |
| 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49, 78, 108 | IQR = 11 (Q1=36, Q3=47) | Lower fence=19.5, upper fence=63.5. Values 6, 7, 15, 78, and 108 are flagged as outliers. |
| 88, 92, 80, 78, 95, 84, 76, 90, 81, 85, 93 | IQR = 10.5 (Q1=80.5, Q3=91) | Test scores ranging from 76 to 95. No outliers — a tightly clustered class performance. |
How to Use the IQR Calculator
- Enter your dataset in the input field as comma-separated numbers. You can also use spaces as separators. The order of the values does not matter — the calculator sorts them automatically.
- Click Calculate IQR. The tool displays n (count), minimum, maximum, Q1, median, Q3, IQR, the lower and upper fences, and any outliers.
- Inspect the IQR to understand how spread out the middle 50% of your data is. A larger IQR means more variability in the central portion of the data.
- Check the fence values. Any data point below Q1 − 1.5×IQR or above Q3 + 1.5×IQR is listed as a potential outlier. Investigate each flagged point to determine whether it is a data error or a genuine extreme value.
- Use the example buttons to load pre-built datasets and see how the IQR and outlier detection behave for different data distributions.
IQR FAQ
What is the interquartile range (IQR)?
The interquartile range is the difference between the third quartile (Q3, 75th percentile) and the first quartile (Q1, 25th percentile): IQR = Q3 − Q1. It represents the spread of the middle 50% of the data. Because it ignores the top and bottom 25% of values, the IQR is not affected by extreme outliers, making it a more robust measure of spread than the total range or standard deviation when data is skewed or contains anomalies.
How are Q1 and Q3 calculated?
The calculator uses linear interpolation on the sorted data. For Q1, the position is 0.25 × (n−1) in a zero-indexed sorted array. If that position is not an integer, the value is interpolated between the two adjacent data points. The same method is used for Q3 at position 0.75 × (n−1). This is the same method used by statistical software like R (type 7) and Excel's QUARTILE.INC function.
How does the 1.5×IQR rule identify outliers?
John Tukey's 1.5×IQR rule defines lower fence = Q1 − 1.5×IQR and upper fence = Q3 + 1.5×IQR. Any data point outside these fences is a potential outlier. The multiplier 1.5 was chosen because for a perfectly normal distribution, only about 0.7% of values fall outside these fences, making them very unlikely to occur by chance. A stricter rule uses a multiplier of 3.0, flagging only the most extreme points as far outliers.
Is IQR better than standard deviation for measuring spread?
Each measure is suited to different situations. Standard deviation uses all data values and is optimal for symmetric, normally distributed data with no outliers. IQR uses only the middle 50% of values and is much more resistant to skewness and outliers. If your data is approximately normal, standard deviation gives more information. If your data is skewed (income, house prices, survival times) or contains outliers, IQR is the better measure of typical spread.
Can I use IQR for a dataset with just two or three values?
Technically yes, but the result is of limited usefulness. With very small samples (n < 4 or 5), quartile estimates are highly unstable and the IQR does not reliably represent the population spread. The 1.5×IQR outlier rule also behaves poorly with tiny samples — it may flag no outliers even when the data contains errors, or it may produce fences that exclude legitimate values. Meaningful IQR analysis generally requires at least 5–10 observations.