Introduction
The IQR Calculator finds the interquartile range of any data set you enter. The IQR is the difference between the third quartile (Q3) and the first quartile (Q1) of your data. It tells you how spread out the middle 50% of your values are.1 It is a steady way to measure spread when your data has extreme values, also called outliers, because it only uses the middle of the data.4 Scientists, students, and analysts use the IQR every day to better understand their data. Simply enter your numbers into the calculator above, and it will give you Q1, Q3, and the IQR right away.
How to use our IQR Calculator
Enter a set of numbers and this calculator will find the interquartile range (IQR), quartiles (Q1, Q2, Q3), five-number summary, outliers, and a box plot for your data.
Enter Your Data: Type or paste your numbers into the text box. You can separate values with commas, spaces, semicolons, or newlines. Fractions like 1/2 or 3/4 also work. You need at least 4 numbers for the calculator to find the quartiles.
Quartile Method: Pick how you want the quartiles calculated. "Inclusive (Type-7)" is the default method in R and is also used by Excel.2 "Exclusive" matches Excel's QUARTILE.EXC function. "Tukey's Hinges" splits the data at the median and finds the median of each half, counting the median in both halves when the count is odd.8
Decimal Places: Choose how many decimal places to show in your results: 0, 2, 3, 4 or 6. The default is 2.
Outlier Detection: Select which outlier fences to use. "1.5×IQR" lists every value outside the 1.5×IQR fences, "3×IQR" lists only the extreme outliers outside the 3×IQR fences, and "Show Both" splits them into mild and extreme outliers.
Box Plot: Choose "Show" to display a box-and-whisker plot of your data, or "Hide" to turn it off.
Click Calculate to see your results, including the five-number summary, IQR value, outlier fences, detected outliers, a box plot, sorted data with color-coded highlights, and a step-by-step breakdown of how each value was calculated. Click Reset to return all settings and data to their defaults.
What Is the Interquartile Range (IQR)?
The interquartile range (IQR) is a measure of how spread out the middle 50% of a data set is. You find it by subtracting the first quartile (Q1) from the third quartile (Q3). In simple terms, it tells you the range of values where the central half of your data falls. Because the IQR ignores the highest and lowest extremes, it gives a more reliable picture of spread than the full range, especially when your data contains outliers.
How to Calculate the IQR
To calculate the interquartile range by hand, follow these steps:
- Sort your data from smallest to largest.
- Find Q1 (the 25th percentile). This is the median of the lower half of your data.1
- Find Q3 (the 75th percentile). This is the median of the upper half of your data.1
- Subtract: IQR = Q3 − Q1.
For example, take the data set 7, 15, 36, 39, 40, 41, 42, 43, 47, 49, 55, 70, 92. It has 13 values, so the median is the 7th value, 42. If you count the median in both halves, the lower half is 7 to 42 and the upper half is 42 to 92, so Q1 is 39 and Q3 is 49. The IQR is 49 − 39 = 10, which means the middle half of the values spans a width of 10 units. Tukey's Hinges and the Inclusive (Type-7) method give this result. Many textbooks leave the median out of both halves instead.8 Then the lower half is 7 to 41 and the upper half is 43 to 92, so Q1 is (36 + 39) ÷ 2 = 37.5, Q3 is (49 + 55) ÷ 2 = 52 and the IQR is 52 − 37.5 = 14.5. The Exclusive method gives the same 14.5 here.
Quartile Methods
There is more than one way to calculate quartiles, and different methods can give slightly different results.2 This calculator offers three of them:
- Inclusive (Type-7): The default method in R, also used by Excel. It uses the formula h = 1 + (n − 1) × p and interpolates between data points when needed.2
- Exclusive (QUARTILE.EXC): The method used by Excel's
QUARTILE.EXCfunction. It uses h = (n + 1) × p, which positions the quartiles slightly differently.2 - Tukey's Hinges: This method splits the sorted data at the median, then finds the median of each half, counting the median in both halves when the count is odd.8 It is commonly used when drawing box-and-whisker plots. Tukey's own box plot uses these hinges as the ends of the box.8
The Inclusive and Exclusive methods give fairly similar results, but not exactly the same, and they differ most for small data sets.2 On the example data above, Inclusive and Tukey's Hinges give an IQR of 10, while Exclusive gives 14.5.
Using the IQR to Detect Outliers
One of the most useful things about the IQR is that it helps you find outliers: values that are unusually far from the rest of your data. You do this by calculating fences:
- Mild outlier fences (1.5 × IQR): Lower fence = Q1 − 1.5 × IQR, Upper fence = Q3 + 1.5 × IQR. Any value outside these fences is considered a mild outlier.3
- Extreme outlier fences (3 × IQR): Lower fence = Q1 − 3 × IQR, Upper fence = Q3 + 3 × IQR. Values beyond these fences are considered extreme outliers.3
This fence method, sometimes called Tukey's rule, is how box plots flag outliers.5 It comes from the box plot that J. W. Tukey introduced in 1977.
Why the IQR Matters
The IQR is widely used in statistics because it is resistant to outliers. Unlike the standard deviation or full range, a single extreme value does not heavily change the IQR.4 This makes it especially helpful when working with skewed data or data sets that contain errors. You will see the IQR in box plots, where the box covers the middle half of the data.5 It is also used in data cleaning, quality control, and research across fields like science, business, and education.