Interquartile Range (IQR) Calculator

Calculate IQR, semi-IQR, quartile coefficient of dispersion, Tukey fences, and outlier detection. Includes box plot, quartile segments, and IQR vs SD comparison.

About the Interquartile Range (IQR) Calculator

The interquartile range (IQR) measures the spread of the middle 50% of a dataset, from Q1 (the 25th percentile) to Q3 (the 75th percentile). Because it ignores the most extreme values, it is one of the standard robust measures of variability for skewed or outlier-prone data.

This calculator reports IQR alongside semi-IQR, quartile coefficient of dispersion, Tukey fences for outlier detection, and a simple box-plot view. It also compares IQR with standard deviation so you can see whether the central spread and the full-spread picture are telling the same story.

That makes it useful when you want a measure of spread that stays stable even if a few unusually high or low values are present.

Why Use This Interquartile Range (IQR) Calculator?

IQR is often the right spread measure when the median matters more than the mean, or when a few extreme values would distort the standard deviation. It is widely used in box plots, outlier screening, and summary tables for skewed data.

Showing the quartiles, fences, and box plot together makes it easier to explain not just how wide the middle of the data is, but also why certain values are or are not being treated as outliers.

How to Use This Calculator

  1. Enter numbers separated by commas or spaces (minimum 4 values).
  2. Select exclusive (Tukey) or inclusive quartile method.
  3. Adjust the fence multiplier (1.5 for standard, 3 for extreme outliers only).
  4. Read IQR from the main output — it measures the middle 50% spread.
  5. Check the box plot to visualize quartiles and outliers.
  6. Compare IQR to standard deviation: IQR/SD ≈ 1.35 for normal data.
  7. Review the outlier table if any values fall beyond the Tukey fences.

Formula

IQR = Q3 − Q1. Semi-IQR = IQR / 2. QCD = (Q3 − Q1) / (Q3 + Q1) × 100%. Lower fence = Q1 − k × IQR. Upper fence = Q3 + k × IQR. For normal data: IQR ≈ 1.35 × σ.

Example Calculation

Result: IQR = 16, Q1 = 73, Q3 = 89

Sorted data: 68,70,72,74,76,81,84,85,88,90,92,95. Q1 = median(68,70,72,74,76,81) = 73, Q3 = median(84,85,88,90,92,95) = 89. IQR = 89 − 73 = 16. With k = 1.5, the Tukey fences are 49 to 113, so no outliers are detected.

Tips & Best Practices

IQR and the Box Plot

John Tukey introduced the box plot in 1970 specifically around the IQR as its core measurement. The box spans Q1 to Q3 (the IQR), the median line divides it, and whiskers extend to the farthest non-outlier values. Everything beyond the fences (Q1 − 1.5×IQR and Q3 + 1.5×IQR) is plotted individually as an outlier. This elegant design makes the box plot the standard tool for distribution comparison.

IQR in Statistical Testing

The IQR is used to normalize robust test statistics. The IQR-based measure of kurtosis, for example, replaces the fourth moment with quartile-based metrics that are less sensitive to extreme values. Some robust regression methods use IQR to scale residuals for outlier weights.

IQR for Different Distribution Shapes

For a normal distribution, IQR = 1.35σ. For a uniform distribution on [a,b], IQR = (b−a)/2. For an exponential distribution with rate λ, IQR = ln(3)/λ. Comparing the observed IQR/SD ratio to 1.35 provides a quick normality check.

Sources & Methodology

Last updated:

Frequently Asked Questions

What does IQR measure?

The IQR measures the spread of the middle 50% of data — from the 25th to the 75th percentile. It tells you how concentrated or dispersed the central bulk of your data is, completely ignoring the most extreme values. A small IQR means data is clustered tightly around the median.

Why is IQR better than range?

Range (max − min) uses only two extreme values, making it extremely sensitive to outliers. A single outlier can double the range while barely affecting IQR. IQR uses the middle 50%, so it's robust — it stays stable even when data has unusual extremes.

How is IQR used for outlier detection?

Tukey's method defines outliers as values beyond Q1 − 1.5×IQR or Q3 + 1.5×IQR. These "fences" work for any distribution shape. Mild outliers fall between 1.5× and 3× IQR from Q1/Q3; extreme outliers fall beyond 3× IQR. This method is used in box plots worldwide.

What is the quartile coefficient of dispersion?

QCD = (Q3 − Q1) / (Q3 + Q1) is a dimensionless measure of relative variability based on quartiles. Like the coefficient of variation (CV), it allows comparing spread across datasets with different scales. Unlike CV, it's robust to outliers.

When should I use IQR instead of standard deviation?

Use IQR when data is skewed, contains outliers, or isn't normally distributed. Income data, housing prices, medical lab values, and environmental measurements often require IQR-based reporting. Use SD when data is approximately normal and outliers have been verified as legitimate.

What is the semi-interquartile range?

The semi-IQR (also called quartile deviation) is simply IQR / 2. It's used in older statistical texts as a measure of typical deviation from the median. For normal data, semi-IQR ≈ 0.6745 × σ (the probable error).

Related Pages