🏆 US-Registered Digital Marketing Agency
Advertisement
Advertisement
STATISTICS

Outlier Calculator — IQR fences and z-scores compared

Paste a data set and see which points each rule flags, where the rules disagree, and why that disagreement is the useful part.

Separate values with commas, spaces, tabs or line breaks. Anything that is not a number is skipped.
1.5 gives the standard inner fence; 3.0 marks extreme outliers.
3 is conventional. Use 2 on small samples only if you know why.
3.5 is the value recommended in the NIST handbook for the median-based rule.
Deciding this before you look at the data is what stops the choice being made to suit the answer.
Outliers flagged
0
 
0
Values in the set
0
Flagged by IQR fence
0
Flagged by z-score
0
Flagged by modified z
 
Tip: a flag is not a licence to delete. Decide what a point is — a typo, a different population, or a real extreme value — before deciding what to do with it.
Advertisement

An outlier is a value that sits an unusual distance from the rest of a sample. There is no single definition, which is why this outlier calculator runs three standard rules side by side: the 1.5×IQR fence used by box plots, the classic z-score cut-off, and the median-based modified z-score. It shows what each rule flags, and it shows the visual spread so you can see the shape the rules are arguing about.

The disagreement between the rules is not a defect to be resolved by picking a favourite — it is the informative part. Arb Digital added this page after too many reporting conversations where a single enormous day was deleted because "the z-score said it was fine to keep" or kept because "it was inside three standard deviations". Both statements come from the same rule, and that rule is the one most easily broken by the very outlier it is being asked about.

What This Outlier Calculator Does

It sorts your data, computes the quartiles, the mean, the sample standard deviation, the median and the median absolute deviation, then tests every individual value against all three rules at your chosen thresholds. It lists which points each rule flagged, marks any point where the rules disagree, and draws a bar for every value so the distance from the middle of the data is visible rather than inferred from numbers.

This is the point-by-point test that our interquartile range calculator does not perform: that page returns the IQR itself and the quartiles behind it, while this page uses those quartiles to build fences and judge each observation against them. If you want the whole five-number summary drawn instead, the box plot calculator is the visual companion to this one.

How to Use It

  1. Paste the raw values. Commas, spaces, tabs and line breaks all work, so a column copied straight out of a spreadsheet is fine.
  2. Choose your thresholds before looking. The defaults — 1.5 for the fence, 3 for the z-score, 3.5 for the modified z — are the conventional ones.
  3. Pick which rule drives the headline. Requiring all three to agree is the conservative option; flagging on any one is the sensitive option.
  4. Read the disagreement line. If the rules split, the split itself tells you something about the shape of the data.
  5. Investigate before you act. Look at what the flagged point actually is in your source data, then decide.

The Three Rules and How They're Calculated

The IQR fence comes from the quartiles. With Q1 the 25th percentile and Q3 the 75th, the interquartile range is Q3 − Q1, and the inner fences sit at Q1 − 1.5×IQR and Q3 + 1.5×IQR. Anything beyond them is a mild outlier; anything beyond 3×IQR is an extreme one. Because quartiles ignore how far away the extreme values are, this rule is resistant to being distorted by the points it is testing.

The z-score rule standardises each value: z = (x − mean) ÷ s, and flags anything with |z| above 3. The modified z-score replaces the mean with the median and the standard deviation with the median absolute deviation: 0.6745 × (x − median) ÷ MAD, where the constant makes the MAD comparable to a standard deviation for normal data. The recommended threshold of 3.5 for that statistic comes from the NIST/SEMATECH e-Handbook section on the detection of outliers.

Run the defaults through by hand and the three rules split apart. The sorted data is 12, 12, 13, 13, 14, 14, 15, 15, 16, 42. Q1 is 13 and Q3 is 15, so the IQR is 2 and the upper fence sits at 15 + 1.5×2 = 18. The value 42 is far past it, and past the extreme fence at 21 as well. But the mean is 16.6 and the sample standard deviation is 9.02, so the z-score of 42 is only (42 − 16.6) ÷ 9.02 = 2.82 — inside the threshold of 3, and therefore not flagged. The modified z-score uses the median of 14 and a MAD of 1, giving 0.6745 × 28 ÷ 1 = 18.9, which flags it emphatically.

Advertisement

Why the z-Score Rule Missed It

The z-score is computed using the mean and the standard deviation, and the outlier contributed to both. Adding 42 to that sample pulled the mean up from 13.8 to 16.6 and inflated the standard deviation from about 1.5 to 9.0. The point moved the goalposts before being measured against them. This is called masking, and it is the single most important thing to understand about outlier detection.

Masking gets worse as the sample gets smaller and as the number of outliers grows. Two extreme values in the same direction inflate the standard deviation so much that neither one is flagged, and with a sample of ten the maximum possible z-score is bounded at about 2.85 by arithmetic alone — no value in a sample that size can ever exceed 3, however extreme it is. That fact alone disqualifies the naive z-score rule for small samples, and it is why the median-based version exists.

Robust Statistics and Breakdown Point

The technical term for resistance to contamination is breakdown point: the proportion of a sample that can be replaced by arbitrary values before the statistic becomes arbitrary too. The mean has a breakdown point of 0 — one infinitely large value drags it anywhere. The standard deviation is the same. The median has a breakdown point of 0.5, the theoretical maximum: you can corrupt just under half the data and the median still sits somewhere sensible.

That is why the quartile fence and the modified z-score behave so much better on contaminated data. Both are built from order statistics that never look at the size of the extremes, only at their position. The practical rule follows: use the mean and standard deviation to describe data you have already cleaned, and use median-based methods to decide what needs cleaning. Comparing the mean against the median is a fast first read on whether extremes are pulling your summary around.

When a Flag Is Not an Error

Three quite different things produce an outlier, and they call for three different responses. A data error — a typo, a unit mix-up, a sensor dropout recorded as zero — should be corrected or removed, and this is the only case where deletion is straightforwardly right. A point from a different population, such as a bot session in human traffic or a wholesale order in retail data, should be separated out and analysed on its own rather than thrown away.

The third case is a genuine extreme value from the same process, and here deletion is a serious mistake. In heavy-tailed data — revenue per customer, session duration, campaign response — the extremes are not noise around the typical value, they are where most of the total sits. Deleting them makes the summary tidier and the conclusion wrong. The NIST/SEMATECH e-Handbook section on what outliers are makes the same point: an outlier may carry valuable information about the process, and should be investigated before it is dismissed.

Skew Breaks the Symmetric Assumption

Both the fence rule and the z-score rule assume a roughly symmetric distribution. On strongly right-skewed data — which describes most business metrics, since nothing can be less than zero but plenty can be enormous — the upper fence is crossed constantly by perfectly ordinary values, and a rule applied mechanically will flag five per cent of a normal week as anomalies.

There are two honest fixes. Transform first: taking logs makes multiplicative data roughly symmetric, and outliers found on the log scale are the ones that are genuinely unusual in proportional terms. Or widen the multiplier deliberately and say that you have, rather than presenting a 1.5 fence as if it were a law of nature. Checking the shape first with a histogram calculator takes ten seconds and prevents the whole class of error.

What to Do With the Flagged Points

Report both ways. Run the analysis with the outliers in and again with them out, and state both results. If the conclusion holds either way, the outliers were never the issue and nobody needs to argue about them. If the conclusion flips, that is the single most important finding in the analysis, and it should be reported as such rather than settled quietly by deleting the inconvenient rows.

Whatever you do, record it. An analysis that says "three values above the upper fence were excluded, listed here, because they were duplicate submissions from one account" can be audited. One that silently drops them cannot, and neither can the person reading it tell the difference between careful cleaning and a result that was engineered. Recomputing the spread afterwards with our standard deviation calculator shows exactly how much the exclusion changed the picture.

Anomalies in your campaign data?

Arb Digital separates broken tracking from genuine spikes before either one turns into a decision you have to reverse later.

Browse All Free Tools Talk To Our Team

Common Mistakes to Avoid

  • Trusting the z-score on a small sample — with ten observations no value can reach a z of 3, so the rule cannot flag anything however extreme it is.
  • Deleting flagged points automatically — a flag is a prompt to investigate, and in heavy-tailed data the extremes often carry most of the total.
  • Applying a symmetric rule to skewed data — right-skewed metrics cross the upper fence routinely, and mechanical flagging produces a stream of false alarms.
  • Choosing the rule after seeing which points it flags — that is picking the answer, not testing for it. Fix the rule and the threshold first.
  • Removing outliers without saying so — an unrecorded exclusion is indistinguishable from a result that was shaped to suit, and cannot be audited later.

Related Free Tools From Arb Digital

Get the quartiles behind the fences from the quartile calculator, standardise a single value with the z-score calculator, draw the five-number summary with the box plot calculator, or measure the spread with the standard deviation calculator. The full free online tools hub lists every statistics tool we publish.

Frequently Asked Questions

What counts as an outlier?

There is no universal definition. The common rules flag a value beyond 1.5 times the interquartile range from the nearest quartile, or more than three standard deviations from the mean. Different rules disagree, which is why this page runs three at once.

Why do the IQR and z-score rules disagree?

Because the z-score is built from the mean and standard deviation, both of which are moved by the outlier itself. The quartile fence uses positions rather than distances, so the extreme value cannot inflate the threshold it is being tested against.

What is the modified z-score?

It replaces the mean with the median and the standard deviation with the median absolute deviation, scaled by 0.6745. It resists contamination far better than the ordinary z-score, and 3.5 is the usual threshold.

Should I delete outliers from my data?

Only when you know what caused them. Correct or remove genuine data errors, separate points that belong to a different population, and keep genuine extreme values — deleting those biases the result and hides the most interesting part of the data.

Why is 1.5 used as the fence multiplier?

It is a convention chosen to flag roughly the most extreme half a percent of a normal distribution, which is rare enough to be worth a look without producing constant false alarms. It is a useful default, not a law.

Can a small sample even have outliers?

The fence rule works on samples as small as five, but the z-score rule cannot: its maximum possible value is limited by the sample size, so on ten observations nothing can exceed a z of about 2.85.

What if my data is heavily skewed?

Symmetric rules will over-flag the long tail. Either transform the data first, for example by taking logs, or widen the multiplier deliberately and state that you have done so.

This page explains a statistical method for study and for checking your own working. It is not a substitute for showing your method, and it is not medical, legal, or financial advice.

Advertisement
Advertisement

Take it further