Outlier Detection Calculator
IQR · Z-score · modified Z · scatter plot
Result
Enter data and click Detect Outliers
Identify outliers using IQR, Z-score, or Modified Z-score methods.
Scatter Plot
Python Compiler
What Is an Outlier?
An outlier is a data point that differs significantly from other observations. Outliers can arise from measurement errors, data entry mistakes, or genuine extreme values. Detecting them is critical for data quality and accurate statistical analysis.
Data Quality
Outliers can skew means, inflate standard deviations, and distort regression models. Identifying them improves the reliability of your analysis.
Error Detection
Many outliers result from typos, sensor malfunctions, or recording errors. Flagging them helps catch mistakes before they propagate.
Genuine Extremes
Some outliers are real — record temperatures, viral posts, or rare events. These may be the most interesting data points to study.
IQR Method (Tukey’s Fences)
Lower Fence = 4.5 − 1.5 × 6 = −4.5
Upper Fence = 10.5 + 1.5 × 6 = 19.5
Outlier: 50 (above upper fence of 19.5)
Advantages: Distribution-free (no normality assumption), robust to extreme values, widely used in exploratory data analysis and box plots.
Z-Score Method
The Z-score measures how many standard deviations a data point is from the mean. A common threshold is |Z| > 3, meaning the value is more than 3 standard deviations away from the average.
Pros: Simple, intuitive, works well for normally distributed data. Easy to interpret — Z = 2.5 means 2.5 standard deviations from the mean.
Cons: Sensitive to outliers themselves (masking effect). The mean and SD are pulled toward outliers, making them harder to detect.
Modified Z-Score (MAD)
Why 0.6745? This constant is the 0.75th quantile of the standard normal distribution. It scales the MAD so that it is a consistent estimator of the standard deviation for normally distributed data, making the modified Z-score comparable to the regular Z-score.
Advantages: Very robust — the median and MAD are not affected by outliers (unlike mean and SD). Works well with small samples, skewed distributions, and datasets with many outliers. Recommended threshold: 3.5 (Iglewicz & Hoaglin).
Which Method to Choose?
| Scenario | Recommended Method |
|---|---|
| General purpose | IQR (k = 1.5) |
| Normal distribution assumed | Z-Score (threshold = 3) |
| Skewed data | IQR or Modified Z-Score |
| Small sample size | Modified Z-Score (MAD) |
| Many outliers suspected | Modified Z-Score (MAD) |
| Conservative detection | IQR (k = 3.0) |
What to Do with Outliers
- Investigate: Determine why the value is extreme before taking action
- Correct: Fix data entry or measurement errors
- Remove: Delete only if clearly erroneous
- Transform: Apply log or winsorization to reduce impact
- Keep: Retain genuine extreme values and use robust methods
- Separate Analysis: Analyze with and without outliers to assess their influence