Skip to main content
CalcMax

Outlier Calculator

Result

1

Number of outliers

Outliers
9
Lower fence (Q1 − 1.5 × IQR)
1.7500
Upper fence (Q3 + 1.5 × IQR)
7.7500
Far lower fence (Q1 − 3 × IQR)
-0.5000
Far upper fence (Q3 + 3 × IQR)
10.0000
First quartile (Q1)
4.0000
Third quartile (Q3)
5.5000
Interquartile range (IQR)
1.5000

An outlier is an observation that sits far enough from the rest of the sample to be worth a second look. This outlier calculator applies the usual rule for flagging them: a value more than 1.5 × IQR below the first quartile, or more than 1.5 × IQR above the third, is marked. It prints the fences it used, and the quartiles those fences came from, so the verdict is something you can check rather than take on trust. It tells you which values are flagged and how many. It does not tell you to delete them.

Formula

lower fence = Q1 − 1.5 × IQR · upper fence = Q3 + 1.5 × IQR

Q1
The first quartile — the 25th percentile, the value a quarter of the data lies at or below. It anchors the lower fence
Q3
The third quartile — the 75th percentile. With Q1 it bounds the middle half of the data, and it anchors the upper fence
IQR
The interquartile range, Q3 − Q1: the width of the middle half of the data. Multiplying it by 1.5 sets how far outside that middle half a value has to sit before it is flagged
lower fence
Q1 − 1.5 × IQR. A value strictly below this line is flagged; a value exactly on it is not, which is why a list of identical values flags nothing
upper fence
Q3 + 1.5 × IQR. A value strictly above this line is flagged. The two fences are usually written L1 and U1 in the source this rule comes from
n
How many values went in, up to 200 here. The fences are built from quartiles, so a longer list moves the quartiles and can change which values are flagged

Use it when you need to know whether a value is unusual relative to the rest of the sample, before deciding what to do about it: a monthly return that is ten times the others, a sensor reading that is off the scale of its neighbours, a test score far below the rest of a class. The 1.5 × IQR rule, sometimes called Tukey's rule after the person who popularised it, is the standard first pass because it makes no assumption about the shape of the data — unlike a rule based on the mean and standard deviation, which is itself distorted by the extreme values it is meant to find. What this page cannot do is tell you whether a flagged value is an error or a real extreme value. Those are different things: an outlier may indicate bad data, and it may equally be the most interesting measurement in the set. The interquartile range deliberately ignores the tails, so it is not pulled around by the very values being tested.

Worked examples

  1. Eight values, one flagged

    1. Q1 = 4 and Q3 = 5.5, so IQR = 5.5 − 4 = 1.5
    2. 1.5 × IQR = 2.25, giving a lower fence of 4 − 2.25 = 1.75 and an upper fence of 5.5 + 2.25 = 7.75
    3. 9 is above 7.75, so it is flagged; every other value is inside the fences

    The far fences are −0.5 and 10, and 9 sits inside those, so this is a value flagged by the inner rule only — mildly unusual rather than extreme. Reporting the far fences separately is what makes that distinction visible instead of leaving it as a yes or no.

  2. Two flagged, one outside each fence pair

    1. Q1 = 3.75 and Q3 = 9.25, so IQR = 5.5 and 1.5 × IQR = 8.25
    2. The fences are 3.75 − 8.25 = −4.5 and 9.25 + 8.25 = 17.5; the far fences are 3.75 − 16.5 = −12.75 and 9.25 + 16.5 = 25.75
    3. 20 is above 17.5 but inside 25.75; 30 is above 25.75. Both count as flagged, so the total is 2

    The two flagged values are not equally extreme, and the count alone hides that. 20 clears the inner fence, 30 clears the far fence, and the printed list keeps them in ascending order so you can see which is which. The far fence is not a second threshold that values have to clear to count — a value between the two fences is already flagged.

  3. When every value is the same but one

    1. Q1 = 1 and Q3 = 1, so IQR = 0 and 1.5 × IQR = 0
    2. Both fences collapse onto 1: the lower fence is 1 − 0 = 1 and the upper fence is 1 + 0 = 1
    3. 2 is strictly above 1, so it is flagged — despite the interquartile range being zero

    An interquartile range of 0 looks like it should switch the rule off, and it does not. When almost every value is identical, the one that differs is by definition the only point that deviates markedly, and the rule says so. To get the opposite result — nothing flagged — every value has to be the same, in which case the fences land exactly on that value and the comparison is strict.

Limitations

This page reports values flagged by one rule, and that rule is a convention rather than a verdict. The 1.5 multiplier is a choice; the same source that gives it also gives 3.0 for a second, more extreme line, and other textbooks and software offer different tests based on z-scores or on the median absolute deviation. It is normal for two tools to disagree about a borderline value, and it does not mean either is wrong. A flagged value is also not automatically an error: a rule like this cannot distinguish a mistyped digit from a genuine extreme observation, and the second kind is often the most valuable measurement in a data set. Removing points on the strength of a flag alone is how analyses acquire conclusions they did not earn. The quartiles here are computed by linear interpolation between the two middle values, which is the most common convention but not the only one — a source that rounds to the nearest observed value can place a quartile half a step away and move the fences with it. The list is capped at 200 values, and a token such as 1,500 is refused rather than guessed at, because a comma between digits is a decimal point in some countries and a thousands separator in others.

Frequently asked questions

How do you find outliers in a data set?
Sort the values and find the first and third quartiles, Q1 and Q3. The interquartile range is Q3 − Q1. Any value below Q1 − 1.5 × IQR, or above Q3 + 1.5 × IQR, is flagged. For the list 2, 4, 4, 4, 5, 5, 7, 9 the quartiles are 4 and 5.5, so the interquartile range is 1.5, the fences are 1.75 and 7.75, and 9 is flagged. The calculator above prints the quartiles and all four fences so each step can be checked.
What is a fence, and why are there four of them?
Fences are the cut-off lines the rule compares values against — the term is common in software, while the textbook source writes them as L1, L2, U1 and U2. The two inner fences are Q1 − 1.5 × IQR and Q3 + 1.5 × IQR; the far fences use 3.0 instead of 1.5 and mark the values that are further out again. Only the inner pair decides what gets flagged. The far pair is printed because a value between the two lines is mildly unusual and a value beyond the far line is not, and a single count cannot show that difference.
Should I delete an outlier once it is flagged?
Not on the strength of the flag alone. The rule says a value deviates markedly from the others; it cannot say why. The same reference notes that an outlier may indicate bad data — a mistyped digit, a faulty sensor, a unit entered in the wrong column — and in those cases the point should be corrected or removed. It may equally be a real measurement, and often the most informative one in the set. Before removing anything, find the reason: check the original record, the instrument log or the conditions that produced it. Removing points because a rule flagged them is how a data set gets trimmed until it says what someone wanted.
Why does another tool flag a different value?
Because the 1.5 multiplier is a convention, not a law. The reference that gives 1.5 also gives 3.0 for the second line, and there are entirely different rules built on z-scores — one compares each value's distance from the mean against the standard deviation, another uses the median absolute deviation and a threshold of 3.5. Quartile conventions differ too: this page interpolates between the two middle values, while some sources round to the nearest observed value, which can move a fence just past a borderline point. Two tools disagreeing about a value sitting near a fence is expected, and it is a reason to look at that value rather than a reason to distrust one of the tools.
What if the interquartile range is zero?
The rule still runs, and it still flags values. If Q1 and Q3 are both 1, the interquartile range is 0, so 1.5 × IQR is 0 as well, both fences land exactly on 1, and any value strictly above 1 is flagged — for the list 1, 1, 1, 1, 1, 2, the 2 is flagged. That looks wrong at first, since a zero interquartile range appears to say the data has no spread. It is right: when nearly every value is identical, the single value that differs is precisely the one that deviates markedly. The comparison is strict, so a list of identical values flags nothing — the fences fall right on that value and nothing is strictly outside them.
Is this the same as a z-score test?
No, and the difference matters. A z-score divides each value's distance from the mean by the standard deviation — but the mean and the standard deviation are both computed from the whole sample, including the outlier, so a single extreme value inflates the standard deviation and can hide itself. The quartile-based rule has no such feedback: the quartiles are positional, and a value that is far out does not change where they fall. The reference gives a limit for the z-score approach for exactly this reason, and it also offers a variant built on the median absolute deviation so that the measure of spread is not dragged around by the point being tested.

References

Related calculators