📊 IQR Calculator – Measure Spread with the Interquartile Range
The Interquartile Range (IQR) is one of the most robust measures of statistical spread. Unlike the standard deviation or variance, it is resistant to extreme values, making it the preferred summary statistic for skewed distributions, exam scores, salary data, and any dataset where outliers could distort the picture.
What Is the IQR?
The IQR equals the difference between the third quartile (Q3) and the first quartile (Q1):
IQR = Q3 − Q1Q1 (the 25th percentile) marks the point below which 25% of observations fall. Q3 (the 75th percentile) marks the point below which 75% of observations fall. The IQR therefore captures the middle 50% of the data, stripping away the influence of both the lowest and highest quarters.
Three Input Modes
Raw Dataset Mode
Paste or type your values — separated by commas, spaces, or newlines — and the tool sorts them, computes Q1, median, Q3, and IQR, identifies outliers, and draws an interactive box-and-whisker plot. Minimum 3 values required.
Frequency Table Mode
When observations repeat, enter each unique value once alongside its count. The tool expands the table to a full dataset internally, so calculations are exact rather than estimated. Ideal for classroom statistics problems with repeated observations.
Grouped Class-Interval Mode
For data summarised in frequency distribution tables, enter each class interval with its frequency (e.g., 10–20: 6). Quartiles are estimated using the standard interpolation formula:
Qp = L + ((p·N − CF_prev) / f) × hwhere L is the lower class boundary, N is the total frequency, CF_prev is the cumulative frequency before the quartile class, f is the class frequency, and h is the class width.
Outlier Detection with IQR Fences
John Tukey's classic fence rule uses the IQR to flag unusual observations:
| Fence Type | Lower Bound | Upper Bound |
|---|---|---|
| Inner (mild outliers) | Q1 − 1.5 × IQR | Q3 + 1.5 × IQR |
| Outer (extreme outliers) | Q1 − 3 × IQR | Q3 + 3 × IQR |
The fence multiplier defaults to 1.5 but can be changed. Values beyond the inner fences are mild outliers; values beyond the outer fences are extreme outliers.
Quartile Method Comparison
Different software packages compute Q1 and Q3 differently. This tool supports three widely used conventions:
- Tukey Hinges — Splits sorted data around the median and takes the median of each half. Used by R's
boxplot()and the classic five-number summary. - Inclusive (QUARTILE.INC) — Linearly interpolates across all
nvalues using 0-based indexing (Hyndman-Fan Type 7). Matches Excel, Python'snumpy.percentile, and most textbooks. - Exclusive (QUARTILE.EXC) — Scales positions by
(n+1), avoiding anchoring at the minimum and maximum. Matches Excel'sQUARTILE.EXC.
The Method Comparison panel shows Q1, Q2, Q3, and IQR for all three conventions side by side so you can see exactly how the choice affects your results — particularly for small samples.
Box-and-Whisker Plot
The interactive box plot visualises the five-number summary: minimum whisker, Q1 box edge, median line, Q3 box edge, and maximum whisker. Mild outliers appear as filled circles; extreme outliers asdiamond markers. When Compare Mode is active, two box plots are drawn side by side for instant visual comparison of spread and centre.
Example: Exam Scores
Data: 45, 52, 58, 60, 63, 65, 68, 70, 72, 75, 80, 88, 95
Method: Tukey Hinges
─────────────────────────────
Q1 = 60
Q2 = 68
Q3 = 75
IQR = 15
Lower fence (1.5×IQR) = 37.5
Upper fence (1.5×IQR) = 97.5
Outliers: nonePractical Use Cases
- Education — Summarise test or assignment scores to identify students who may need support (below Q1) or extension (above Q3).
- Finance — Analyse salary, revenue, or expense distributions without letting extreme values dominate the summary.
- Research — Report spread in skewed or non-normal datasets where standard deviation is misleading.
- Quality control — Flag process measurements that fall outside the expected mid-50% range.
All calculations run entirely in your browser — no data is sent to any server.