Outlier Calculator

Outlier Calculator

Find outliers in a dataset with Tukey's 1.5 × IQR fences, z-scores or robust modified z-scores, and see how the choice of rule changes what gets flagged.

Outlier if below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR

At least 4 values, separated by commas, spaces or new lines.

Enter at least 4 values to check for outliers

What is an Outlier?

An outlier is a value that sits unusually far from the rest of the data. There's no single definition. Instead there are rules of thumb, each drawing the line at a different distance and measuring that distance a different way.

Outliers can be mistakes (a typo, a faulty sensor, a units mix-up) or genuine extremes (a record-breaking day, a rare patient). A rule only flags a value for attention. Whether to keep, correct or remove it depends on how it got there.

The rules differ most in how they deal with the outlier's own influence. Rules built on the mean and standard deviation can be fooled, because the outlier inflates the yardstick used to judge it. Rules built on quartiles or medians aren't.

Outlier Formulas: IQR, Z-Score and Modified Z

Fences from Tukey (1977); modified z-score from Iglewicz and Hoaglin (1993), as given in the NIST/SEMATECH e-Handbook. See Sources.

1. Tukey's IQR fences

Outlier if x < Q1 − 1.5 × IQR or x > Q3 + 1.5 × IQR

2. z-score

z = (x − x̄) ÷ s, outlier if |z| > 2, 2.5 or 3
Largest possible |z| in a sample of n = (n − 1) ÷ √n

3. Modified z-score

M = 0.6745 × (x − median) ÷ MAD, outlier if |M| > 3.5

MAD is the median absolute deviation. Like the IQR rule, it uses only medians, so a single extreme value can't hide by inflating the spread.

Worked Example: One Suspicious Reading

Given:
Ten readings 2, 4, 5, 7, 8, 9, 10, 12, 15, 50. Is 50 an outlier?
Step 1:
IQR fences:
Q1 5, Q3 12, IQR 7 → fences −5.5 and 22.5 → 50 flagged
Step 2:
z-score:
mean 12.2, s 13.82 → z = 37.8 ÷ 13.82 = 2.73 → flagged at 2, not at 3
Step 3:
Modified z-score:
median 8.5, MAD 3.5 → 0.6745 × 41.5 ÷ 3.5 = 8.0 → flagged
Result:
50 is flagged by 2 of 3 rules

Its z-score is held down because 50 itself more than doubles the standard deviation. With 10 values, no point can reach z = 3 at all, so the strict z rule was never going to catch it.

Why z > 3 Can't Find Outliers in Small Samples

The largest z-score any single value can have, however extreme. The |z| > 3 rule needs at least 11 values before it can flag anything.

Maximum possible z-score by sample size
ValuesLargest |z|Can |z| > 3 flag?
51.789No
82.475No
102.846No
113.015Yes
204.249Yes
506.93Yes

Common Outlier Mistakes

  • Deleting outliers automatically. A flagged value needs a reason to be removed. Dropping genuine extremes makes the data look tidier than reality.
  • Using z > 3 on small samples. With 10 or fewer values it can never flag anything. Use the IQR or modified z rule.
  • Re-running the rule after removing an outlier. Each round tightens the limits and flags more values, and repeated trimming eats into perfectly good data.
  • Applying a symmetric rule to skewed data. In right-skewed data such as incomes, many legitimate high values get flagged. Consider a log scale first.

Outlier FAQs

Which rule should I use?

For general use, the IQR rule is simple and robust. The modified z-score is also robust and suits roughly symmetric data. Plain z-scores only make sense for large samples from bell-shaped data.

Should I remove outliers before analysis?

Only with a reason, such as a recording error. Otherwise report results with and without them, or use methods such as medians or robust regression that aren’t thrown off by them.

Are there formal outlier tests?

Yes. Grubbs’ test and Dixon’s Q test give a p-value for a single suspected outlier, assuming the rest of the data is normal.

Why does the IQR rule flag so much in big datasets?

For normal data about 0.7% of values fall outside the fences by chance, so 10,000 values will usually include around 70 “outliers”.

Why does the quartile method change the result?

Different methods give slightly different Q1 and Q3, which moves the fences. Values close to a fence can switch between flagged and not flagged.

What is the difference between an outlier and an extreme value?

Tukey called values beyond 1.5 × IQR outside the quartiles “outside” and those beyond 3 × IQR “far out”. The fence calculator shows both sets of fences.

Can a dataset have outliers on both sides?

Yes. Every rule here checks both directions, with a lower and an upper limit.

Why is the modified z-score multiplied by 0.6745?

0.6745 is the 75th percentile of the standard normal. It scales the MAD so that, for normal data, modified z-scores are on roughly the same scale as ordinary z-scores.

Sources

  • NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5.17: detection of outliers.
  • J. W. Tukey, Exploratory Data Analysis (Addison-Wesley, 1977).
  • B. Iglewicz and D. C. Hoaglin, How to Detect and Handle Outliers (ASQC Quality Press, 1993).
  • R. E. Shiffler, "Maximum Z scores and outliers", The American Statistician 42 (1988) 79–80.

Related Tools