How to calculate lower and upper outlier fences
Sort the observations and find the first quartile Q1 and third quartile Q3. The interquartile range, or IQR, is Q3 minus Q1. The inner fences are the usual thresholds for IQR screening.
Lower inner fence = Q1 − 1.5 × IQR.
Upper inner fence = Q3 + 1.5 × IQR.
Outer fences use 3 × IQR in place of 1.5 × IQR. The calculator flags a value only when it is strictly beyond a fence. A value exactly on an inner fence is within the inner fences. A value exactly on an outer fence may be beyond an inner fence, but is within the outer fences.
Why the same values can give different results
For the sorted list 0, 1, 2, 3, 4, 8, linear interpolation using R type 7 gives Q1 = 1.25 and Q3 = 3.75. The IQR is 2.5 and the upper inner fence is 7.5, so the value 8 is flagged. The median of halves gives Q1 = 1 and Q3 = 4. Its upper inner fence is 8.5, so the same value stays within the inner fences.
R type 7 interpolates between observations at equally spaced percentile positions. The median-of-halves method takes the median of each half. For an odd number of observations, this calculator leaves the overall middle observation out of both halves. Choose the method used by your class or workflow, and use the other column to see where the result depends on that choice.
Find fences from known Q1 and Q3
Switch to the quartile mode if you already have Q1 and Q3. Enter those two values to get the IQR and all four fences. A flag count requires the original observations, so this mode shows thresholds only.
How to interpret the results
Whiskers end at actual observations that lie within the inner fences. The fences themselves are calculated thresholds and may fall between observations. When Q1 and Q3 are equal, the IQR is zero and all four fences coincide. A different observation can still cross those fences. For a short list, the flags describe the entered sample.
A flagged observation can be an entry error, a real extreme value or an important event. Check its context before deciding what to do. IQR screening does not report a p-value or test whether a point came from a normal distribution. The calculator retains the input order and shows duplicate values at their own positions.
The NIST engineering handbook gives the four fence formulas. The R documentation for sample quantiles describes type 7 and several other definitions. For general summaries, use the Statistics Calculator.