All guides

Outlier Detection Methods Compared: IQR, Z-Score, and MAD

IQR Tukey fences, Z-score, and median absolute deviation (MAD) compared — how each works, when each fails, and a worked numeric example.

There is no single definition of an outlier — there are detection rules, each with assumptions. This guide compares the three most common rules and shows where each one breaks.

1. IQR Method (Tukey Fences)

Flag any value below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. Because quartiles barely move when extreme values are added, the rule is robust: the outliers cannot hide themselves. It makes no normality assumption, which makes it the industry default and the method behind every box plot on this site.

2. Z-Score Method

Standardize each value: z = (x − mean) / SD, and flag |z| > 3. Intuitive — "more than three standard deviations out" — but the mean and SD are themselves inflated by outliers, an effect called masking. One enormous value can inflate the SD so much that its own z-score falls below 3. Use Z-scores only on roughly symmetric, approximately normal data.

3. MAD Method (Median Absolute Deviation)

Compute the median, then the median of |x − median| — that's the MAD. Flag values where |x − median| / MAD > 3.5 (some texts use a scaled MAD × 1.4826 to match the normal SD). Because both ingredients are medians, MAD is the most robust of the three and the best choice for heavily skewed or contaminated data. Its cost: less familiar to most audiences and slightly more computation.

Which One Should You Use?

  • Default: IQR — robust, assumption-free, universally understood.
  • Roughly normal data: Z-score is fine and connects to the 68-95-99.7 rule.
  • Heavy skew or suspected contamination: MAD.
  • High stakes: run two methods and investigate anything they disagree on — the outlier detector on this site runs IQR and Z-score together for exactly this reason.

The Most Important Rule

Detection is not deletion. An outlier is a prompt to investigate — typo, sensor artifact, or genuine extreme? — and each cause has a different correct response. Removing data without a written justification is how analyses go wrong.

Try it with your own data

Free, in your browser — no sign-up, no upload.

Open Outlier Detector