CalcWorldHub
Statistics · CalcWorldHub

Tukey Outlier Fences from Quartiles and IQR

Tukey outlier fences give a consistent way to flag unusually low or high values relative to the middle half of a sample. The calculator finds the first and third quartiles, forms the interquartile range, and extends each quartile by 1.5 times that range. A point outside a fence deserves investigation; the calculation alone does not prove that the point is an error.

Open calculator
An ordered dot plot shows a central interquartile box, lower and upper Tukey fences, and one point beyond the upper fence.

Share this article

Q1 and Q3 are extended outward by 1.5 times the IQR to form lower and upper fences.
Build the two fences

Start with a comparable numeric sample

Enter the observations that belong to one measurement process and one meaningful comparison. A list that mixes different units, populations, seasons, or collection methods can produce valid quartiles but unhelpful fences. Check that values are numeric and that the sample contains enough observations for the quartiles to be informative.

Keep the original measurement scale. Tukey fences are calculated in the same units as the data, so a fence of 18.5 could mean dollars, millimetres, seconds, or another quantity. The result is not a probability, a percentile rank, or a standardized score. State the variable and the population whenever you report a flag.

Find the quartiles and spread

Sort the values from smallest to largest. The calculator uses a linearly interpolated sample percentile convention: for probability p, it locates position (n − 1) × p on the zero-based ordered list and interpolates between adjacent observations when that position is fractional. This matters in small samples because another quartile convention may give different Q1 and Q3.

The interquartile range is IQR = Q3 − Q1. It describes the width of the middle half under the selected quartile method and is less affected by a single extreme value than the full range. A narrow IQR does not mean every observation should be close to the median; it only describes the central spread.

Calculate the two Tukey fences

Lower fence = Q1 − 1.5 × IQR. Upper fence = Q3 + 1.5 × IQR. The factor 1.5 is a conventional screening rule associated with Tukey box plots. It is applied to the IQR in the data’s original units, then subtracted from the lower quartile or added to the upper quartile.

A value is flagged when it is below the lower fence or above the upper fence. A value exactly on a fence is not outside it. Fences can lie beyond the observed minimum or maximum, and a sample can have no flagged values. These boundaries do not estimate a confidence interval and should not be confused with a hypothesis test.

Investigate a flag before changing data

An unusual observation can be a transcription mistake, a sensor fault, a special operating condition, or a genuine rare event. Check the source record, unit, timestamp, instrument, and collection procedure before deciding how to handle it. Keep a valid extreme value when it represents the process you intend to describe.

NIST’s discussion of box plots treats fence points as a way to identify observations that stand out for examination. It does not make the fence a universal deletion rule. If the distribution is strongly skewed, has distinct subgroups, or has very few observations, a symmetric 1.5-IQR screen may flag values for structural reasons rather than because they are bad data.

Report the method with the result

When comparing groups, calculate fences within the group only if that is the question. Applying one pooled fence can hide differences between groups; applying separate fences can make each group’s outlier count look similar even when their scales differ. Choose the comparison rule before inspecting which values are flagged.

Record the sample definition, quartile convention, Q1, Q3, IQR, both fences, and the flagged observations. The calculator summarizes one entered list and does not label rows or recommend exclusions. Use the flags as an audit trail for follow-up, then document any decision made using subject-matter knowledge.

Worked examples

A high value beyond the upper fence

Inputs: Values = 2, 4, 5, 7, 9, 10, 12, 15, 25.

Calculation: Q1 = 5; Q3 = 12; IQR = 12 − 5 = 7. Lower fence = 5 − 1.5 × 7 = −5.5. Upper fence = 12 + 1.5 × 7 = 22.5. Flagged values: 25; count = 1.

The value 25 is above the upper fence of 22.5 and is flagged for review, not automatic removal.

A smaller sample with interpolated quartiles

Inputs: Values = 3, 5, 6, 8, 9, 10, 12, 20.

Calculation: Q1 position = 1.75, so Q1 = 5 + 0.75 × (6 − 5) = 5.75. Q3 position = 5.25, so Q3 = 10 + 0.25 × (12 − 10) = 10.5. IQR = 4.75. Lower fence = 5.75 − 1.5 × 4.75 = −1.375. Upper fence = 10.5 + 1.5 × 4.75 = 17.625. Flagged value: 20; count = 1. Displayed fence range ≈ −1.38 to 17.63.

Linear interpolation gives fences of −1.375 and 17.625; the observation 20 is outside the upper fence.

A single observation lies beyond the upper Tukey fence and is marked for review.
Flag, then investigate

Sources and further reading

Share this article

Browse all articles · Calculator: Tukey outlier fences calculator