Outlier Detection Calculator

IQR & Z-Score Modified Z (MAD) Compare All Free · No Signup

Free online outlier detection calculator using IQR, Z-score, and Modified Z-score (MAD). Compare all methods, identify consensus outliers, visualize with interactive scatter plot, and export Python numpy code.

Outlier Detection
Enter numbers separated by commas, spaces, or newlines

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 = Q1 − k × IQR     Upper Fence = Q3 + k × IQR
IQR = Q3 − Q1   (Interquartile Range)
Worked Example: Data: 2, 4, 5, 7, 8, 9, 10, 12, 50 with k = 1.5
Q1 = 4.5, Q3 = 10.5, IQR = 6.0
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.

Min Q1 Q2 Q3 Max Outliers Lower Fence Upper Fence

Z-Score Method

Z-Score:  Z = (x − μ) / σ     Outlier if |Z| > threshold

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)

Modified Z-Score:  M = 0.6745 × (x − median) / MAD
MAD = median(|xi − median(x)|)   (Median Absolute Deviation)

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?

ScenarioRecommended Method
General purposeIQR (k = 1.5)
Normal distribution assumedZ-Score (threshold = 3)
Skewed dataIQR or Modified Z-Score
Small sample sizeModified Z-Score (MAD)
Many outliers suspectedModified Z-Score (MAD)
Conservative detectionIQR (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

Frequently Asked Questions

Use IQR with k = 1.5 for general-purpose robust detection. Use Z-score for normally distributed data. Use Modified Z-score (MAD) for small samples or when you suspect many outliers. Use Compare All to see consensus across all three methods.
The IQR method uses Tukey fences. Values below Q1 − k × IQR or above Q3 + k × IQR are classified as outliers. With k = 1.5, these are mild outliers; with k = 3.0, only extreme outliers are flagged.
No. First investigate whether outliers are data entry errors, measurement errors, or genuine extreme values. Only remove if they are clearly erroneous. For genuine outliers, consider robust statistical methods or analyze with and without them.
The Modified Z-score uses the median and MAD instead of the mean and standard deviation. The formula is 0.6745 × (x − median) / MAD. It is more robust because outliers do not affect the median or MAD the way they affect the mean and SD.
For the IQR method, k = 1.5 is standard for mild outliers and k = 3.0 for extreme. For Z-score, |Z| > 3 is typical. For Modified Z-score, the recommended threshold is 3.5 (Iglewicz & Hoaglin).
Compare All runs IQR, Z-score, and Modified Z-score simultaneously with their default thresholds. Consensus outliers are values flagged by all three methods, making them strong candidates for investigation or removal.

Support This Free Tool

Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.

500K+ users
200+ tools
100% private
Privacy Guarantee: Private keys you enter or generate are never stored on our servers. All tools are served over HTTPS.