Quick Answer
With the 1.5 × IQR rule, a value is an outlier if it’s below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. In the example, Q1 = 199.86 and Q3 = 202.065, so the fences are 196.5525 and 205.3725, and 245.57 is flagged. Grubbs’ test agrees: G = 2.4688, above the critical value of 2.032 for a one-sided test at α = 0.05.
Embed this calculator
Adjust the size if needed, then copy the code below into your page or blog. The calculator will load in an iframe and stay updated automatically.
Table of Contents
- Outlier Calculator
- Quick Answer
- Related Calculators
- How This Outlier Calculator Works
- How to Use the Outlier Calculator
- Core Formulas
- Key Terms
- Worked Example
- Real-Life Examples
- IQR Rule vs Z-Score
- Largest Possible Z-Score by Sample Size
- Which Method Should I Use?
- What to Do With an Outlier
- Common Mistakes to Avoid
- Frequently Asked Questions
- References & Sources
How This Outlier Calculator Works
Paste your numbers and choose a method. The calculator lists the values it flags, shows the cutoffs it used, writes out the working, and gives your data with the flagged values removed in case you need it. A second table shows what all four methods find in the same data, so you can see whether they agree.
There’s no single definition of an outlier. NIST describes it as a value that lies an abnormal distance from the other values, which leaves the choice of method and cutoff to you. The IQR rule makes no assumption about the shape of the data. The z-score, modified z-score and Grubbs’ test assume the data are roughly normal apart from the possible outliers.
Quick explanation:
- IQR fences: the box plot rule. Good for any shape of data.
- Z-score: distance from the mean in standard deviations.
- Modified z-score: uses the median and MAD, so the outliers themselves don’t hide the problem.
- Grubbs’ test: a formal test for one outlier in normal data.
How to Use the Outlier Calculator
- Paste or type your numbers.
- Choose a method.
- Change the multiplier, cutoff or significance level if you need to.
- Press Calculate or Enter.
- Read the flagged values and steps, and compare methods in the second table.
Core Formulas
- IQR fences: Q1 − k × IQR and Q3 + k × IQR, with k = 1.5 for mild and 3 for extreme outliers
- Z-score: z = (x − x̄) ÷ s
- Modified z-score: M = 0.6745 × (x − median) ÷ MAD, where MAD is the median of |x − median|. Iglewicz and Hoaglin suggest flagging |M| > 3.5.
- Grubbs’ statistic: G = max |x − x̄| ÷ s, or (max − x̄) ÷ s, or (x̄ − min) ÷ s for one side
- Grubbs’ critical value: ((N − 1) ÷ √N) × √(t² ÷ (N − 2 + t²)), where t is the t value with N − 2 degrees of freedom and upper-tail area α ÷ (2N) for two sides, or α ÷ N for one side
Key Terms
- Outlier: a value that lies an abnormal distance from the others.
- Fence: a cutoff based on the quartiles and IQR.
- MAD: median absolute deviation, the median distance from the median.
- Grubbs’ test: a test for one outlier in roughly normal data.
- Significance level: the chance of flagging a value when there’s really no outlier.
Worked Example
NIST’s handbook tests these 8 measurements: 199.31, 199.53, 200.19, 200.82, 201.92, 201.95, 202.18, 245.57.
- The mean is 206.4338 and the sample standard deviation is 15.8526.
- For the largest value, G = (245.57 − 206.4338) ÷ 15.8526 = 2.4688. NIST rounds it down to 2.4687.
- For a one-sided test at α = 0.05 with N = 8, the critical value is 2.0317, which NIST rounds to 2.032.
- 2.4688 > 2.032, so 245.57 is an outlier.
- The modified z-score agrees. The median is 201.37 and the MAD is 0.995, so M for 245.57 is 30.0, far above 3.5.
The ordinary z-score for 245.57 is the same as G, about 2.47. That’s below the common cutoff of 3, so the z-score method misses it. NIST explains why: with n values, no z-score can be larger than (n − 1) ÷ √n, which for 8 values is 2.475. The outlier also raises the standard deviation, which makes its own z-score smaller.
Real-Life Examples
- Homework: find outliers with the 1.5 × IQR rule and show the working.
- Lab data: test a suspect reading with Grubbs’ test.
- Cleaning data: find values to check before working out averages.
- Quality control: flag unusual measurements from a batch.
IQR Rule vs Z-Score
- IQR rule: uses quartiles, so outliers barely move the cutoffs. It works for skewed data too.
- Z-score: uses the mean and standard deviation, which an outlier pulls toward itself.
- Small samples: z-scores can’t go beyond (n − 1) ÷ √n, so a cutoff of 3 can never be passed with 10 or fewer values.
Largest Possible Z-Score by Sample Size
This limit is from the NIST handbook. It’s why z-scores often miss outliers in small data sets.
| Values (n) | Largest |z| = (n − 1) ÷ √n | Can pass 3? |
|---|---|---|
| 5 | 1.789 | No |
| 8 | 2.475 | No |
| 10 | 2.846 | No |
| 11 | 3.015 | Yes |
| 15 | 3.615 | Yes |
| 20 | 4.249 | Yes |
| 30 | 5.295 | Yes |
| 50 | 6.930 | Yes |
Which Method Should I Use?
- Homework on box plots or the IQR: use IQR fences with 1.5.
- Small data sets: avoid plain z-scores. Use the IQR rule, the modified z-score or Grubbs’ test.
- Normal data and one suspect value: Grubbs’ test gives a yes or no answer at a chosen significance level.
- Several suspect values: NIST recommends tests built for more than one outlier, such as the generalized extreme studentized deviate test, rather than running Grubbs’ test again and again.
- Skewed data: a long tail can look like outliers. Consider a log scale or a method that doesn’t assume normal data.
What to Do With an Outlier
First, check whether it’s an error, such as a typing slip, a wrong unit or a broken instrument. If it is, correct it or remove it and say so. If it’s a real value, keep it. NIST notes that outliers can tell you something important about the process. You can report results with and without the outlier, or use methods such as the median and IQR that aren’t strongly affected by it.
Common Mistakes to Avoid
- Deleting every flagged value. Check it first. It may be real.
- Using z-scores on tiny data sets. The largest possible z-score may be below your cutoff.
- Running Grubbs’ test again after removing a value. It’s built to find one outlier.
- Testing skewed data with normal-based methods. The long tail may be flagged even when nothing is wrong.
- Changing the cutoff until you get the answer you want. Choose it before you look.
Frequently Asked Questions
Use the 1.5 × IQR rule: find Q1 and Q3, then flag values more than 1.5 × IQR below Q1 or above Q3.
Values outside Q1 − 1.5 × IQR and Q3 + 1.5 × IQR are possible outliers. Using 3 instead of 1.5 finds extreme outliers.
A common cutoff is 3, but z-scores are unreliable for small data sets. NIST notes that the largest possible z-score is (n − 1) ÷ √n.
0.6745 × (x − median) ÷ MAD. Values above 3.5 are flagged as possible outliers.
A test for one outlier in roughly normal data. It compares G, the largest distance from the mean in standard deviations, with a critical value.
No. It’s for one outlier. Use a test designed for several, rather than repeating Grubbs’ test.
Only if you know they’re errors. Otherwise keep them, or report results with and without them.
They use different centers, spreads and cutoffs. Agreement between several methods gives you more confidence.
The outlier raises the standard deviation, and small samples limit how large a z-score can be.
At least half the values are the same, so modified z-scores can’t be used. Try the IQR method.
It can move the fences slightly in small data sets. Use the method you were taught.
At least 3, and at least 4 for the IQR method. Outlier tests are weak with very small samples.
Yes. Save each set by name in this browser.
Yes. Use Compare: keep as A.
Yes. Use Share link or Print.
References & Sources
| Source | Used For | Link |
|---|---|---|
| NIST/SEMATECH e-Handbook of Statistical Methods, 7.1.6 What are outliers in the data? | Inner fences at 1.5 × IQR and outer fences at 3 × IQR, with a worked example. | https://www.itl.nist.gov/div898/handbook/prc/section1/prc16.htm |
| NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.17 Detection of Outliers | Z-scores, the modified z-score with the 3.5 limit, and why single-outlier tests shouldn’t be repeated. | https://www.itl.nist.gov/div898/handbook/eda/section3/eda35h.htm |
| NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.17.1 Grubbs’ Test for Outliers | The test statistic, critical values for two-sided and one-sided tests, and a worked example. | https://www.itl.nist.gov/div898/handbook/eda/section3/eda35h1.htm |
| Wikipedia, Quartile | Methods 1 and 2: split the data at the median and leave the median out or keep it in (Tukey’s hinges). | https://en.wikipedia.org/wiki/Quartile |
| Python documentation, statistics | Used to check this calculator’s means, standard deviations, medians and quartiles. | https://docs.python.org/3/library/statistics.html |