Upper and Lower Fence Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter the first and third quartiles of your data to get the fences beyond which values count as outliers.
Result
Lower fence
Upper fence
- Interquartile range (Q3 − Q1)
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- First quartile (Q1): enter a number.
- Third quartile (Q3): enter a number.
- Fence multiplier: choose 1.5 × IQR (inner fences, outliers) or 3 × IQR (outer fences, extreme outliers).
- Read the result: Lower fence; the panel also shows Interquartile range (Q3 − Q1) and Upper fence.
How this calculator works
IQR = Q3 − Q1. Lower fence = Q1 − 1.5 × IQR; upper fence = Q3 + 1.5 × IQR. Values outside the fences are outliers in Tukey's rule (Exploratory Data Analysis, 1977); with 3 × IQR, the outer fences flag extreme outliers.
Quartiles can be computed in several ways, so different software may give slightly different fences for the same data.
The formula
| Symbol | Meaning |
|---|---|
| First quartile (Q1) | |
| Third quartile (Q3) | |
| Fence multiplier | |
| Interquartile range (Q3 − Q1) | |
| Lower fence |
Worked example
| First quartile (Q1) | 10 |
|---|---|
| Third quartile (Q3) | 20 |
| Fence multiplier | 1.5 × IQR (inner fences, outliers) |
| Interquartile range (Q3 − Q1) | 10 |
|---|---|
| Upper fence | 35 |
Lower fence -5
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What are the fences for Q1 = 10 and Q3 = 20?
IQR = 10, so the lower fence is −5 and the upper fence is 35.
Is a value exactly on a fence an outlier?
No. Only values strictly below the lower fence or above the upper fence are outliers.