Fences are the cut-offs used to decide whether a data point is unusually small or large. They are built from the quartiles: the box of a box plot runs from Q1 to Q3, and the fences sit k interquartile ranges beyond each end of the box. Anything outside the fences is called an outlier and is plotted as a separate point.
John Tukey proposed k = 1.5 for the inner fences and k = 3 for the outer fences; values beyond the outer fences are “far out” or extreme outliers. Because the fences depend on quartiles rather than on the mean and standard deviation, the outliers themselves cannot drag the fences outwards and hide each other – a weakness of rules based on z-scores.
Enter your data and, if needed, change the multiplier: some analysts use 2 or 2.2 for skewed data such as rainfall or salaries, where the 1.5 rule flags too many points. The result lists the fences, the low and high outliers separately, and the data with the outliers removed.
How to use the Upper and Lower Fence Calculator
- Data set
- Fence multiplier (k) — 1.5 is the standard (Tukey) value; use 3 to flag only extreme outliers.
- Quartile method
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Sort the data, compute Q1 and Q3 with the selected method, then IQR = Q3 − Q1. Subtract k × IQR from Q1 for the lower fence and add it to Q3 for the upper fence. Values strictly outside the fences are outliers.
Worked example
Ten monthly rainfall totals in inches: 1.1, 1.4, 1.8, 2.0, 2.2, 2.5, 2.7, 3.1, 3.4, 7.9. The lower half 1.1 … 2.2 gives Q1 = 1.8 and the upper half 2.5 … 7.9 gives Q3 = 3.1, so IQR = 1.3 and 1.5 × IQR = 1.95. Lower fence = 1.8 − 1.95 = −0.15 and upper fence = 3.1 + 1.95 = 5.05. The 7.9-inch month is an outlier. Even with k = 3 the upper fence is 7.0, so it is an extreme outlier.
Choosing the multiplier
| k | Name | Typical use |
|---|---|---|
| 1.5 | Inner fences (Tukey) | Standard box plots and outlier screening |
| 2 – 2.2 | Relaxed fences | Skewed data or large samples where 1.5 flags too many points |
| 3 | Outer fences | Flag only extreme (“far out”) values |
Formula
Lower fence = Q1 − k × IQR · Upper fence = Q3 + k × IQR · IQR = Q3 − Q1 · k = 1.5 (inner fences) or 3 (outer fences)
Worked example
Inputs — Data set: 1.1, 1.4, 1.8, 2.0, 2.2, 2.5, 2.7, 3.1, 3.4, 7.9; Fence multiplier (k): 1.5; Quartile method: Median of halves, median excluded (TI-84, most textbooks).
Results — Lower fence (Q1 − k × IQR) = -0.15; Upper fence (Q3 + k × IQR) = 5.05; Outliers = 7.9; Low outliers (below the lower fence) = None; High outliers (above the upper fence) = 7.9; Number of outliers = 1.
Key terms
- Fence
- A boundary beyond which values are considered outliers.
- Inner fences
- Q1 − 1.5·IQR and Q3 + 1.5·IQR.
- Outer fences
- Q1 − 3·IQR and Q3 + 3·IQR.
- Outlier
- An observation that lies unusually far from the bulk of the data.
Frequently asked questions
How do you calculate the upper and lower fences?
Find Q1, Q3 and IQR = Q3 − Q1. Lower fence = Q1 − 1.5 × IQR, upper fence = Q3 + 1.5 × IQR.
What are the fences for 1.1, 1.4, 1.8, 2.0, 2.2, 2.5, 2.7, 3.1, 3.4, 7.9?
Q1 = 1.8, Q3 = 3.1 and IQR = 1.3, so the fences are −0.15 and 5.05. The value 7.9 is an outlier.
Why 1.5?
It is Tukey's convention: for normal data about 0.7% of values fall outside 1.5 × IQR fences, so points beyond them are rare enough to deserve a look.
What are inner and outer fences?
Inner fences use 1.5 × IQR, outer fences 3 × IQR. Points between them are mild outliers; points beyond the outer fences are extreme outliers.
Can a fence be negative when data cannot be?
Yes. A negative lower fence simply means no low outliers are possible.
Is a value exactly on the fence an outlier?
No – only values strictly beyond the fences are flagged.
Should I delete outliers?
Not automatically. Check whether they are errors; genuine extreme values often carry important information.