Loading calculator...
- Fences mark the limits beyond which a value is treated as an outlier.
- Lower fence = Q1 − 1.5 × IQR. Upper fence = Q3 + 1.5 × IQR.
- IQR = Q3 − Q1, the spread of the middle half of the data.
- Any value below the lower fence or above the upper fence is flagged.
How to use the upper and lower fence calculator
Paste your numbers
Type or paste the numbers, separated by commas, spaces or new lines. You need at least 4.
Choose a quartile method
The default is the textbook method. Pick another in the advanced options if your course or software uses it.
Set the multiplier
Leave 1.5 for outliers. Use 3 to find extreme outliers.
Read the result
You get Q1, the median, Q3, the IQR, both fences and a list of outliers, plus your sorted data.
How the fences are calculated
Sort the data and find the first quartile (Q1) and third quartile (Q3). The interquartile range is the distance between them. The fences sit 1.5 times that distance outside the quartiles. This is Tukey’s rule and it is the one used for box plots.
Fence formulas
IQR = Q3 − Q1
Lower fence = Q1 − 1.5 × IQR
Upper fence = Q3 + 1.5 × IQR
For extreme outliers, replace 1.5 with 3.
Worked examples
Ten numbers with one large value
Data: 2, 4, 5, 7, 8, 9, 10, 12, 14, 40.
1.5 × 7 = 10.5, so Q1 − 10.5 = −5.5 and Q3 + 10.5 = 22.5. The value 40 is above the upper fence.
The numbers 1 to 10
Data: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
No value is outside the fences.
A set with no outliers
Data: 10, 12, 23, 23, 16, 23, 21, 16. Sorted: 10, 12, 16, 16, 21, 23, 23, 23.
Q1 is the median of 10, 12, 16, 16 and Q3 is the median of 21, 23, 23, 23.
Quartile methods compared
Software and textbooks do not all agree on how to find quartiles, so Q1 and Q3 can differ a little. Here is the data 1 to 9 under each method.
Q1 and Q3 for 1, 2, 3, 4, 5, 6, 7, 8, 9
Same data, different methods.
Use the method your teacher or software expects.
Where a fence calculator helps
Statistics homework
Check your IQR and outlier work step by step.
Cleaning data
Spot values that look unusually high or low before you analyze a set.
Box plots
Find the whiskers and outlier points for a box plot.
Quality checks
Flag measurements that fall outside the normal spread. Compare with the average calculator.
A value outside the fences is unusual, not automatically wrong. Check whether it is a typing mistake, a measurement problem or a real result before you remove it. Removing real data can change your conclusions.
Upper and lower fence calculator FAQ
What are the upper and lower fences?
They are cut-off values at Q3 + 1.5 × IQR and Q1 − 1.5 × IQR. Data outside them is flagged as an outlier.
How do I find the IQR?
Sort the data, find Q1 and Q3, and subtract: IQR = Q3 − Q1.
Why 1.5 times the IQR?
It is the convention proposed by John Tukey for flagging outliers in box plots. A multiplier of 3 is often used for extreme outliers.
Why does my Q1 differ from another tool?
Different methods compute quartiles slightly differently. Compare the method used by your book or software and choose the matching option.
How many numbers do I need?
At least 4 for this calculator. Quartiles from very small sets are rough, so more data gives more reliable fences.
Can the lower fence be negative?
Yes. If all your data are positive, a negative lower fence means no low value can be an outlier.