Home / 🧮 Distributions & Plots/ Outlier Calculator
Enter Data Set
Please enter at least 4 valid numbers.
IQR Method (Tukey Fences)
Q1 (25th)
Q2 Median
Q3 (75th)
IQR
1.5 × IQR
Count (n)
Lower Fence
Upper Fence
All Values — Outliers in red

Z-Score Method (|z| > 3)
Mean
Std Dev (σ)
Threshold
|z| > 3
Z-Score Outliers

An Outlier Calculator (also known as an Anomaly Detection Utility, Tukey IQR Fences Calculator, Data Cleansing Analyzer, or Modified Z-Score Generator) identifies extreme numerical anomalies in a dataset that deviate significantly from other observations. It computes outliers using John Tukey’s Interquartile Range (IQR) fence boundaries (Lower Fence = Q1 - 1.5·IQR), Standard Z-Scores (Z = (x - μ) ÷ σ), and robust Modified Z-Scores (Mi = [ 0.6745 · (xi - x̃) ] ÷ MADmed).

In medical clinical trials (filtering faulty biometric sensor spikes), financial trading (flagging flash crashes), quality control manufacturing (rejecting defective components), and machine learning data preprocessing, **outliers** can severely corrupt statistical models like the arithmetic mean and standard deviation. Identifying and isolating these anomalies is the foundational step of rigorous data analysis.

Our free online Outlier Calculator provides instant anomaly detection across all major statistical methodologies:

  • Tukey’s IQR Mild Fences (Box Plots): Flags values below Q1 - 1.5·IQR or above Q3 + 1.5·IQR as Mild Outliers.
  • Tukey’s IQR Extreme Fences: Flags values below Q1 - 3.0·IQR or above Q3 + 3.0·IQR as Extreme Outliers.
  • Standard Z-Score Method: Flags values where |Z| > 3.0 (More than 3 standard deviations from the mean).
  • Robust Modified Z-Score (Iglewicz & Hoaglin): Flags values where |Mi| > 3.5 using Median Absolute Deviation (MADmed) for datasets where outliers corrupt the mean.

Master IQR Outlier Reference Table (Clinical Trial Resting Heart Rate: n = 10 Patients)

The table below displays resting heart rates (in BPM), computed quartile boundaries, IQR fences, and final anomaly classifications for 10 clinical trial patients (n = 10 Readings: 62, 65, 66, 68, 70, 72, 75, 78, 80, 185 BPM):

Statistical Parameter / Patient Mathematical Derivation Formula Calculated Value (BPM) Clinical & Statistical Interpretation
First Quartile (Q1) 25th Percentile Location 66.00 BPM Lower 25% Patient Boundary
Median (Q2) 50th Percentile Middle 71.00 BPM Typical Resting Patient Rate
Third Quartile (Q3) 75th Percentile Location 78.00 BPM Upper 75% Patient Boundary
Interquartile Range (IQR) Q3 – Q1 (78 – 66) 12.00 BPM Middle 50% Spread Core
Tukey Lower Mild Fence Q1 – (1.5 · IQR) 48.00 BPM (66 – 18) Lower Acceptable Tolerance Limit
Tukey Upper Mild Fence Q3 + (1.5 · IQR) 96.00 BPM (78 + 18) Upper Acceptable Tolerance Limit
Tukey Upper Extreme Fence Q3 + (3.0 · IQR) 114.00 BPM (78 + 36) Severe Anomaly Boundary Cutoff
Patient 10 (185 BPM Tachycardia) Evaluation vs Fences 185.00 BPM >> 114.00 BPM FLAGGED: EXTREME UPPER OUTLIER

Step-by-Step Tukey IQR Fence Outlier Calculation

To calculate the outliers for 10 patient heart rates (62, 65, 66, 68, 70, 72, 75, 78, 80, 185 BPM):

Step 1 (Find Quartiles): Q_1 = 66 BPM, Median = 71 BPM, Q_3 = 78 BPM

Step 2 (Calculate Interquartile Range IQR): IQR = Q_3 - Q_1 = 78 - 66 = 12 BPM

Step 3 (Calculate Mild Fence Modifier): 1.5 · IQR = 1.5 · 12 = 18 BPM

Step 4 (Calculate Upper Mild Fence): Upper Fence = Q_3 + 18 = 78 + 18 = 96 BPM

Step 5 (Calculate Extreme Fence Modifier): 3.0 · IQR = 3.0 · 12 = 36 BPM

Step 6 (Calculate Upper Extreme Fence): Extreme Upper Fence = Q_3 + 36 = 78 + 36 = 114 BPM

Step 7 (Evaluate Dataset): The value 185 BPM is greater than 114 BPM.

Thus, the 185 BPM heart rate is classified as an Extreme Outlier and should be flagged for medical review or removed from the statistical control group.


Outlier Detection Methods Comparison: IQR Fences vs. Z-Score vs. Modified Z-Score

Below is a comparative reference chart detailing when to use specific outlier detection methodologies:

Anomaly Detection Method Mathematical Threshold Formula Resistance to Corrupted Data Primary Practical Application
Tukey IQR Fences < Q1 – 1.5(IQR) or > Q3 + 1.5(IQR) HIGH (Uses percentiles, ignores extremes) Standard Box Plot generation, general skewed data cleansing.
Standard Z-Score |Z| = |(x – μ) ÷ σ| > 3.0 LOW (Mean & SD get pulled by the outlier) Perfectly normal bell-curve distributions (empirical 99.7% rule).
Modified Z-Score (Iglewicz) |Mi| = |0.6745(x – x̃) ÷ MADmed| > 3.5 MAXIMUM (Uses Median & MAD) Small datasets (n < 20) where standard Z-score masking occurs.

History & Mathematics: 1977 John W. Tukey

1977 John W. Tukey & Exploratory Data Analysis (EDA)

In 1977, American statistician John W. Tukey revolutionized modern statistics with his book Exploratory Data Analysis. He introduced the “Box-and-Whisker Plot” and formally defined the 1.5 IQR fence rule for detecting outliers. Tukey chose the 1.5 multiplier because it corresponds closely to 2.7 standard deviations in a normal distribution (covering 99.3% of expected data), perfectly balancing sensitivity without triggering false anomaly alarms.


Popular direct tools:


Frequently Asked Questions (FAQ)

What is the IQR Fence formula for outliers?

An observation is a mild outlier if it falls below Q1 - 1.5·IQR or above Q3 + 1.5·IQR. It is an extreme outlier if it exceeds the 3.0·IQR boundaries.

Why does the Z-Score method fail on small datasets with huge outliers?

Standard Z-Scores use the Mean (μ) and Standard Deviation (σ). A massive outlier heavily inflates both metrics, effectively “hiding” itself by expanding the standard deviation boundary (Outlier Masking). Modified Z-Scores solve this by using the robust Median and MADmed.

What should I do if my dataset has an outlier?

Never blindly delete outliers. First, investigate if it’s a data entry error or faulty sensor reading (remove or correct it). If it represents a genuine rare event (like a billionaire in a salary survey), consider using robust statistics (Median) instead of non-robust statistics (Mean).