Interquartile Range Calculator
Calculate IQR, the spread of the middle 50%.
Enter at least 4 values to calculate IQR
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):
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 or above
- Extreme outliers: Values below or above
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 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
- Sort the data in ascending order
- Find Q1 (25th percentile)βthe median of the lower half
- Find Q3 (75th percentile)βthe median of the upper half
- 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:
| Aspect | IQR | Standard Deviation |
|---|---|---|
| Uses | Only Q1 and Q3 | All data points |
| Affected by outliers | No | Yes |
| For normal data | IQR β 1.35Ο | Full information |
| For skewed data | More representative | Can be inflated |
| Inference | Limited | Extensive theory |
The 1.35 Relationship
For perfectly normal distributions:
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:
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:
- Upper:
Outer fences (extreme outliers):
- Lower:
- Upper:
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:
- Resample data with replacement
- Calculate IQR for each resample
- Use percentiles of bootstrap IQRs as confidence limits
When to Prefer IQR
Choose IQR over standard deviation when:
- Data contains outliers or you suspect it might
- Distribution is skewed (income, real estate, wait times)
- Robust description is more important than parametric inference
- Quick exploratory analysis is the goal
- Comparing groups with different outlier patterns
Choose standard deviation when:
- Formal inference (hypothesis tests, confidence intervals) is needed
- Data is approximately normal and outlier-free
- Efficiency matters (SD uses all information; IQR discards 50%)
- Combining with other statistics that assume normality
Related Calculations
After calculating IQR, explore:
- Quartile Calculator β Get Q1, Q2, Q3 directly
- Five-Number Summary Calculator β IQR in context of full summary
- Outlier Calculator β Use IQR-based fences
- Range Calculator β Non-robust comparison
- Standard Deviation Calculator β Non-robust alternative
- Percentile Calculator β Generalize beyond quartiles
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.