To find the fences of a box plot, use these formulas: Lower fence = Q1 – 1.5 × IQR. Upper fence = Q3 + 1.5 × IQR. The steps are: 1) Find the first quartile (Q1) and third quartile (Q3). 2) Calculate the interquartile range (IQR = Q3 – Q1). 3) Apply the formulas. These fences mark the boundaries beyond which data points are considered potential outliers.
What are box plot fences?
Fences are the cutoff values that define the range of typical data in a box plot. They are not part of the box itself but are used to identify outliers. Any data point that falls outside the lower or upper fence is plotted as a separate point, often a dot or asterisk, rather than being included in the whiskers.
There are two fences: a lower fence and an upper fence. They come from the quartiles and the interquartile range, a measure of spread that is resistant to extreme values.
What is the formula for the lower and upper fences?
The formulas are standard across statistics textbooks and common practice.
Lower fence: Q1 – 1.5 × IQR
Upper fence: Q3 + 1.5 × IQR
Q1 is the 25th percentile, Q3 is the 75th percentile, and IQR is the difference between them. The constant 1.5 is the conventional multiplier chosen by statistician John Tukey. It works well for approximately normal distributions, but you may adjust it for specific data shapes.
How to find Q1 and Q3 for the fence calculation?
To find Q1 and Q3, you first need to sort your data from smallest to largest. Q1 is the median of the lower half of the data (the 25th percentile). Q3 is the median of the upper half (the 75th percentile). There are different methods for handling datasets with an even or odd number of points, but the most common approach is the exclusive method used in most software.
If you have an odd number of data points, exclude the overall median when splitting the data into halves. If the number is even, split evenly. Then find the median of each half – that gives Q1 and Q3.
Example: Data set: 2, 4, 6, 8, 10, 12, 14. The overall median is 8. Lower half: 2,4,6. Median of lower half is 4 = Q1. Upper half: 10,12,14. Median is 12 = Q3.
How to calculate the interquartile range (IQR)?
Once you have Q1 and Q3, subtract Q1 from Q3. That is the IQR. It represents the range that contains the middle 50% of the data.
IQR = Q3 – Q1. For the example above: 12 – 4 = 8. So IQR = 8.
How to find the fences of a box plot: formula steps with example
Let us walk through a complete example with the data: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19.
Step 1: Sort the data. Already sorted.
Step 2: Find Q1 and Q3. There are 10 numbers. Split into lower half (1st to 5th): 1,3,5,7,9. Median of lower half is 5. So Q1 = 5. Upper half (6th to 10th): 11,13,15,17,19. Median is 15. So Q3 = 15.
Step 3: IQR = 15 – 5 = 10.
Step 4: Lower fence = Q1 – 1.5 × IQR = 5 – 1.5 × 10 = 5 – 15 = -10.
Step 5: Upper fence = Q3 + 1.5 × IQR = 15 + 15 = 30.
Any data point below -10 or above 30 would be an outlier. In this set, none exist because the smallest is 1 and largest is 19. The whiskers would extend to the minimum and maximum values within the fences.
Why is 1.5 used in the fence formula?
The factor 1.5 is a convention established by John Tukey in his 1977 book “Exploratory Data Analysis.” It provides a reasonable balance between flagging true outliers and not labeling too many normal points as outliers. For normally distributed data, only about 0.7% of values fall beyond 1.5 × IQR from the quartiles.
Some situations call for different multipliers. For very skewed data, you might use 3 × IQR for extreme outliers. But the standard box plot uses 1.5.
What do the fences tell you about your data?
Fences help you quickly spot unusual values. In health research, outliers might indicate measurement errors, unique patient responses, or subpopulations with different characteristics. Knowing how to calculate fences lets you identify these points systematically rather than by guesswork.
Fences also define the length of the whiskers in a standard box plot. Whiskers extend to the last data point that falls inside the fence on each side. Points beyond are plotted individually.
Common mistakes when finding fences
One mistake is confusing fences with whiskers. The fences are calculated values; the whiskers are the actual data points closest to but not beyond the fences. Another mistake is using incorrect quartiles. Different software may use slightly different methods, but for hand calculation the median-of-halves approach is standard.
Also remember that a negative lower fence is possible, as in the example above. That does not mean your data has negative values – it only means that no value in that dataset can fall below that threshold.
Frequently Asked Questions
What is the lower fence formula?
Lower fence = Q1 – 1.5 × IQR. Q1 is the first quartile, IQR is the interquartile range.
What is the upper fence formula?
Upper fence = Q3 + 1.5 × IQR. Q3 is the third quartile.
How do you find outliers using fences?
Any data point lower than the lower fence or higher than the upper fence is considered an outlier. These points are plotted separately on a box plot.
Can the lower fence be negative?
Yes, if Q1 is small and the IQR is large enough, the formula can produce a negative number. That is mathematically correct and simply means no data can fall below that fence.

