Tukey's fence rule flags observations outside Q1 − k·IQR or Q3 + k·IQR — robust, distribution-free, and the rule behind the standard box plot.
Tukey's fence is the simplest robust outlier rule. With k = 1.5 (the default in box plots) it flags roughly the most extreme 0.7% of observations under a Normal model — a sensible balance between catching real outliers and avoiding false alarms. With k = 3 (the "far outlier" cut) it flags only the truly extreme values, useful for quality-control charts.
Because the rule depends only on quartiles, it tolerates a handful of outliers without inflating the fences themselves — unlike mean-and-SD rules where a single extreme value pulls both estimates and masks itself. This makes Tukey the safest screening rule on data of unknown shape.
One numeric column + multiplier k (default 1.5; 3 for far outliers).
Q1, median, Q3, IQR, lower fence (Q1 − k·IQR), upper fence (Q3 + k·IQR), and a list of flagged values.
A flag is not a death sentence — it's a prompt to investigate. Check whether the value is a recording error, a true tail observation from a heavy-tailed distribution, or a member of a different population. Delete only when you can defend the deletion; otherwise winsorize, log-transform, or switch to a robust method.
On heavily skewed data the fence is itself asymmetric (the upper fence sits farther from the median than the lower one), so the rule still works without modification. On highly multimodal data Tukey can flag entire clusters as outliers; in that case the issue is your model, not the data.