SCIENCE & MATHS

Outlier Detection

Flag outliers in a list of numbers three ways at once — Tukey IQR fences, z-scores and the MAD-based modified z-score — with the thresholds you set.

Quartiles, fences, mean, SD, median and MAD, the values each rule flags and a per-value table of z and modified z — thresholds yours, the masking effect explained.

Example: For 1, 2, …, 9, 100 the IQR fences are [−3.5, 14.5] and the modified z of 100 is 25.5, so both flag it — but its z-score is only 2.84 because the outlier inflates the SD.

v0.1.0 · last reviewed 20 September 2026
Loading the workspace…
BUILT TO BE UNDERSTOOD

Three rules,
shown side by side.

What each rule measures, where the usual thresholds come from, and why they can disagree.

IQR fences

Tukey (1977) called a value an outlier if it lies more than 1.5 × IQR below the first quartile or above the third, and "far out" beyond 3 × IQR. Quartiles here use linear interpolation between order statistics (the R type 7 / Excel QUARTILE.INC rule); other quartile definitions move the fences slightly on small samples.

z-score and modified z

The z-score divides each deviation from the mean by the sample standard deviation; |z| above 3 is the common convention. It has a weakness: a large outlier inflates the SD and hides itself (masking), which is why 100 among 1 … 9 scores only z = 2.84. The modified z-score of Iglewicz and Hoaglin uses the median and the median absolute deviation instead — 0.6745 (x − median)/MAD, flagged above 3.5 — and resists that effect.

Thresholds and judgement

All three thresholds are fields; the prefilled values are the ones the sources use, not rules of this page. A flagged value is unusual under a rule, not wrong: the decision to keep, correct or drop it depends on how it was collected. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.

SOURCES

  • Tukey, Exploratory Data Analysis (1977): 1.5 × IQR fences
  • Iglewicz & Hoaglin, How to Detect and Handle Outliers (ASQC 1993): modified z-score 0.6745 (x − median)/MAD > 3.5
  • Quartiles by linear interpolation (Hyndman & Fan type 7, Excel QUARTILE.INC)

Last reviewed 20 September 2026. How results are checked: How we verify.