Interquartile Range Calculator

Calculate IQR, the spread of the middle 50%.

Enter at least 4 values to calculate IQR

Examples:

Enter your data to see results

What Is the Interquartile Range?

The Interquartile Range (IQR) measures the spread of the middle 50% of your data. It's the difference between the third quartile (Q3) and first quartile (Q1):

IQR=Q3βˆ’Q1IQR = Q_3 - Q_1

Where Q1 is the 25th percentile and Q3 is the 75th percentile.

Unlike range, which spans from minimum to maximum, IQR ignores the extreme 25% on each endβ€”making it resistant to outliers.

Why IQR Matters

Robust Dispersion

Consider two datasets:

  • Dataset A: {20, 25, 30, 35, 40, 45, 50}
  • Dataset B: {20, 25, 30, 35, 40, 45, 500}

For Dataset A: Range = 30, IQR = 20 For Dataset B: Range = 480, IQR = 20

The outlier (500) exploded the range but left IQR unchanged. When your data might contain outliers, IQR tells the true spread story.

Outlier Detection

The Tukey method uses IQR to define outlier boundaries:

  • Mild outliers: Values below Q1βˆ’1.5Γ—IQRQ_1 - 1.5 \times IQR or above Q3+1.5Γ—IQRQ_3 + 1.5 \times IQR
  • Extreme outliers: Values below Q1βˆ’3Γ—IQRQ_1 - 3 \times IQR or above Q3+3Γ—IQRQ_3 + 3 \times IQR

This IQR-based rule is implemented in the Outlier Calculator.

Box Plot Construction

IQR is the height of the box in a box plot:

  • Bottom of box: Q1
  • Top of box: Q3
  • Box height: IQR
  • Whiskers extend to 1.5Γ—IQR (or to data extremes if less)

Skewness Assessment

Comparing distances within IQR reveals asymmetry:

  • If (Q3 βˆ’ Q2) > (Q2 βˆ’ Q1): Right-skewed
  • If (Q3 βˆ’ Q2) < (Q2 βˆ’ Q1): Left-skewed
  • If approximately equal: Symmetric

Practical Applications

Medical Reference Ranges

Clinical labs often report reference ranges as interquartile ranges rather than min-max ranges, preventing rare extreme values from distorting normal bounds.

Real Estate Analysis

Housing prices typically have outliers (mansions, distressed sales). IQR captures the typical market spread:

"Home prices: Median 350K,IQR350K, IQR 280K-$450K"

This tells you where most buyers are shopping, unaffected by the occasional $5M mansion.

Educational Assessment

Test score distributions often have outliers (students who didn't try, or exceptional performers). IQR describes the typical student performance spread.

Income Analysis

Income distributions are notoriously right-skewed with extreme outliers. IQR describes middle-class spread without billionaire distortion.

Process Control

When manufacturing data contains occasional equipment malfunctions, IQR-based monitoring is more reliable than range-based monitoring.

Historical Development

The quartile concept traces to Francis Galton (1822-1911), who developed percentile-based analysis for studying human characteristics. Galton recognized that extreme values could distort impressions of typical variation.

John Tukey (1915-2000) championed IQR as a cornerstone of exploratory data analysis. His 1977 book "Exploratory Data Analysis" established IQR as the preferred robust measure of spread, alongside the median as the preferred robust measure of center.

Tukey's philosophy: Look at the data before imposing assumptions. IQR embodies this approachβ€”it describes what's there without being fooled by extremes.

Computing the IQR

Step-by-Step Process

  1. Sort the data in ascending order
  2. Find Q1 (25th percentile)β€”the median of the lower half
  3. Find Q3 (75th percentile)β€”the median of the upper half
  4. Calculate IQR = Q3 βˆ’ Q1

Quartile Calculation Methods

Different software uses different conventions for quartile calculation (there are several valid methods). The Quartile Calculator explains these variations. Differences are usually small unless sample size is very small.

Example Calculation

Data: {12, 15, 18, 22, 25, 28, 32, 35, 40}

Sorted: Already sorted (n = 9)

Lower half: {12, 15, 18, 22} β†’ Q1 = (15 + 18)/2 = 16.5 Upper half: {28, 32, 35, 40} β†’ Q3 = (32 + 35)/2 = 33.5

IQR = 33.5 βˆ’ 16.5 = 17

IQR vs. Standard Deviation

Both measure spread, but differently:

AspectIQRStandard Deviation
UsesOnly Q1 and Q3All data points
Affected by outliersNoYes
For normal dataIQR β‰ˆ 1.35ΟƒFull information
For skewed dataMore representativeCan be inflated
InferenceLimitedExtensive theory

The 1.35 Relationship

For perfectly normal distributions:

IQRβ‰ˆ1.35Γ—ΟƒIQR \approx 1.35 \times \sigma

This allows rough conversion between measures. If IQR >> 1.35 Γ— SD or IQR << 1.35 Γ— SD, the distribution likely deviates from normality.

Semi-Interquartile Range

The semi-interquartile range (SIQR) is half the IQR:

SIQR=IQR2=Q3βˆ’Q12SIQR = \frac{IQR}{2} = \frac{Q_3 - Q_1}{2}

This is sometimes called the quartile deviation. It approximates the average distance from the median to the quartiles.

IQR in Different Distributions

Symmetric Distributions

For symmetric data, Q1 and Q3 are equidistant from the median:

  • Distance from median to Q1 = Distance from median to Q3 = IQR/2

Right-Skewed Distributions

The upper "arm" of IQR is longer:

  • (Q3 βˆ’ Median) > (Median βˆ’ Q1)
  • Mean > Median

Left-Skewed Distributions

The lower "arm" is longer:

  • (Median βˆ’ Q1) > (Q3 βˆ’ Median)
  • Mean < Median

The Fence Method for Outliers

Tukey's fence method sets boundaries based on IQR:

Inner fences (mild outliers):

  • Lower: Q1βˆ’1.5Γ—IQRQ_1 - 1.5 \times IQR
  • Upper: Q3+1.5Γ—IQRQ_3 + 1.5 \times IQR

Outer fences (extreme outliers):

  • Lower: Q1βˆ’3Γ—IQRQ_1 - 3 \times IQR
  • Upper: Q3+3Γ—IQRQ_3 + 3 \times IQR

For normal distributions:

  • About 0.7% of data falls outside inner fences
  • About 0.0002% falls outside outer fences

Confidence Intervals for IQR

Unlike standard deviation, IQR lacks simple formulas for confidence intervals. Bootstrap methods provide the standard approach:

  1. Resample data with replacement
  2. Calculate IQR for each resample
  3. Use percentiles of bootstrap IQRs as confidence limits

When to Prefer IQR

Choose IQR over standard deviation when:

  1. Data contains outliers or you suspect it might
  2. Distribution is skewed (income, real estate, wait times)
  3. Robust description is more important than parametric inference
  4. Quick exploratory analysis is the goal
  5. Comparing groups with different outlier patterns

Choose standard deviation when:

  1. Formal inference (hypothesis tests, confidence intervals) is needed
  2. Data is approximately normal and outlier-free
  3. Efficiency matters (SD uses all information; IQR discards 50%)
  4. Combining with other statistics that assume normality

Related Calculations

After calculating IQR, explore:

Summary

The Interquartile Range measures the spread of the middle half of your data, providing a robust alternative to range and standard deviation. By ignoring the extreme 25% on each end, IQR resists distortion from outliers. This makes it ideal for skewed distributions, exploratory analysis, and data containing anomalies. The IQR also forms the foundation for box plots and the widely-used Tukey fence method for outlier detection. When your data might contain outliersβ€”or when you don't yet knowβ€”IQR is the safer choice for understanding spread.