Compute quartiles (Q1, median, Q3), interquartile range, detect outliers using Tukey’s fences, and visualize the distribution with an interactive box‑and‑whisker plot.
Quartiles divide a rank-ordered dataset into four equal parts, providing a powerful five‑number summary: minimum, first quartile (Q1), median (Q2), third quartile (Q3), and maximum. Unlike the mean, quartiles resist outliers and reveal the true shape of a distribution — skewness, spread, and central tendency. The interquartile range (IQR = Q3 − Q1) measures statistical dispersion and defines Tukey’s outlier boundaries: values below Q1 − 1.5×IQR or above Q3 + 1.5×IQR are flagged as potential anomalies.
Q1 position = 0.25 × (n+1) | Median = 0.5 × (n+1) | Q3 = 0.75 × (n+1) (using inclusive method, averaged when needed).
This calculator implements the standard median‑of‑both‑halves approach (Tukey’s hinges), widely adopted in textbooks and statistical software (R, Python’s quantile type 2, and many scientific calculators). The result is consistent, interpretable, and essential for exploratory data analysis.
Different textbooks use slightly different rules for quartiles, especially with small datasets. The table below summarizes common methods:
| Method | Description | Example (1,3,5,7,9,11) |
|---|---|---|
| Tukey’s hinges (this tool) | Median splits data; Q1 = median of lower half, Q3 = median of upper half. | Q1=3, Med=6, Q3=9 |
| Mendenhall & Sincich | Positions: Lp = (n+1)×p – linear interpolation. | Q1=3.5, Med=6, Q3=8.5 |
| Moore & McCabe (TI-84) | If position is integer, use that value; else interpolate. | Q1=3.5, Med=6, Q3=8.5 |
Tukey’s method is preferred for box plots because it guarantees the box always contains the median and the hinges are actual data points when n is odd. This tool follows Tukey’s robust approach.
Symmetric distribution: Median is centered in the box, and whiskers are roughly equal in length. Right‑skewed (positive skew): Right whisker longer and/or median closer to Q1 (left side of box). Left‑skewed (negative skew): Left whisker longer and/or median closer to Q3. Long whiskers or distant outliers indicate heavy tails. Use these clues to understand data shape before applying parametric tests.
A mid‑sized company collected monthly salaries (in USD): 3200, 3450, 3600, 3700, 3800, 4100, 4800, 5200, 12500 (executive bonus). Using the quartile calculator, Q1 = 3525, median = 3800, Q3 = 5000, IQR = 1475. The upper fence = 5000 + 1.5×1475 = 7212. The value 12500 exceeds the fence → outlier. This insight helps HR adjust compensation policy and detect atypical entries. The box plot visually confirms right‑skew and the executive outlier.