Outlier Calculator

Paste your data to find outliers with Grubbs' test, IQR fences and z-scores.

An outlier is a value far from the rest of the data. Grubbs' test checks the most extreme value: G = max|xᵢ − x̄| / s is compared with a critical value from the t distribution and assumes the other values are roughly normal. The IQR rule flags values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR, and a modified z-score above 3.5 (based on the median and MAD) is a robust alternative that is not pulled by the outlier itself.

Free, runs in your browser. Nothing you enter is uploaded.

Formula

G = max|xᵢ − x̄| / s,   G_crit = [(n − 1)/√n] √[t² / (n − 2 + t²)],  t = t(α/(2n), n − 2);   fences = Q1 − 1.5·IQR, Q3 + 1.5·IQR;   Mᵢ = 0.6745 (xᵢ − median) / MAD

Grubbs' critical value comes from the t distribution with a Bonferroni-type split of α over the n values, so it rises with sample size. The iterative option removes a confirmed outlier and tests again, which suits one or two outliers but not large clusters. IQR fences use quartiles and do not assume normality. The modified z-score divides by the median absolute deviation, which a single extreme value cannot inflate.

Questions

How do you calculate outliers with the IQR method?

Find Q1 and Q3, then IQR = Q3 − Q1. Values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are outliers; values beyond 3 × IQR are extreme outliers. The calculator uses the same quartile method as Excel's QUARTILE.INC and NumPy.

What is Grubbs' test?

A test for a single outlier in normally distributed data. It compares the largest standardized distance from the mean with a critical value that depends on n and α. If G exceeds the critical value, the value is an outlier at that significance level.

Can I remove an outlier just because a test flags it?

No. Check first for data entry errors, instrument faults or a sample that does not belong to the population. Remove a value only with a documented reason and report the analysis with and without it.

Why does a z-score miss obvious outliers in small samples?

An outlier inflates the mean and SD it is judged against. In a sample of n values no z-score can exceed (n − 1)/√n, so with 10 values the maximum is 2.85 and the |z| > 3 rule can never fire. The modified z-score and Grubbs' test do not have this problem.

How many values do I need for Grubbs' test?

At least 3, but the test has little power below about 7. It also assumes the data without the outlier are approximately normal.

References

More Statistics

All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.