What is a Lower and Upper Fence Calculator?
A lower and upper fence calculator applies Tukey’s 1.5 × IQR rule for outliers. Find the first quartile Q1, the third quartile Q3 and the interquartile range IQR = Q3 − Q1. The lower fence is Q1 − 1.5 × IQR and the upper fence is Q3 + 1.5 × IQR; any value below the lower fence or above the upper fence is a possible outlier. Outer fences at 3 × IQR separate mild outliers from extreme ones.
What the Lower and Upper Fence Calculator does
Enter a dataset and the calculator returns the lower fence and upper fence, the outer fences, every value outside them labelled mild or extreme, how far each one sits beyond the box in IQRs, and a box plot with the flagged values drawn as points. Every step is shown, from sorting the data to classifying each outlier, so you can check homework done by hand.
The lower fence and upper fence (also called the upper and lower fences, inner fences or Tukey’s fences) are the cut-offs that decide which values count as outliers in a box plot. That makes this page an IQR outlier calculator as well: paste your data and it tells you which values lie outside the fences. Choose the quartile method that matches your course or software, since the fences move with Q1 and Q3.
Fences give a quick, objective first screen for unusual values. Because they are built from quartiles, the outliers themselves barely move the fences, unlike rules based on the mean and standard deviation, which an extreme value can stretch enough to hide itself.
How to use the Lower and Upper Fence Calculator
- Type or paste your numbers into Data values, separated by commas, spaces or new lines. They do not need to be sorted.
- Choose a Quartile method. The default, median of halves, matches the TI-84 and most textbooks; pick QUARTILE.INC or QUARTILE.EXC to match Excel.
- Read the lower fence, the upper fence and the number of values outside them. The statistics below add Q1, Q3, the IQR, the outer fences and the mild and extreme outliers.
- Check the fences table and the box plot, then open the step-by-step solution to see how each fence was computed.
What is the lower fence and upper fence in statistics?
The lower fence is the smallest value that still counts as typical under Tukey’s rule: Q1 − 1.5 × IQR. Anything below it is a low outlier. The upper fence is the largest typical value, Q3 + 1.5 × IQR, and anything above it is a high outlier. Together, the lower fence and upper fence mark where a box plot’s whiskers are allowed to reach.
The fences are not data values themselves, and they are not the minimum and maximum. They are thresholds calculated from the quartiles, so they can fall between data points, beyond the range of the data, or even below zero.
| Lower fence | Upper fence | |
|---|---|---|
| Formula | Q1 − 1.5 × IQR | Q3 + 1.5 × IQR |
| Flags | Unusually small values | Unusually large values |
| Outer (extreme) version | Q1 − 3 × IQR | Q3 + 3 × IQR |
| In a box plot | Lower whisker stops at the smallest value at or above it | Upper whisker stops at the largest value at or below it |
How to find the lower and upper fence by hand
The method taught in most statistics courses, and used by the TI-84, takes five steps:
- Sort the values from smallest to largest.
- Find Q1 and Q3. Find the median, then take Q1 as the median of the lower half and Q3 as the median of the upper half. With an odd count, leave the overall median out of both halves.
- Find the IQR: IQR = Q3 − Q1, then multiply it by 1.5.
- Find the lower fence by subtracting 1.5 × IQR from Q1, and the upper fence by adding 1.5 × IQR to Q3.
- Compare each value with the fences. Anything strictly below the lower fence or strictly above the upper fence is a possible outlier. Repeat with 3 × IQR if you need the outer fences.
Lower fence formula and upper fence formula
Both fences are built from the quartiles of the sorted data:
| Symbol | Meaning |
|---|---|
| Q1 | first quartile (25th percentile), the median of the lower half |
| Q3 | third quartile (75th percentile), the median of the upper half |
| 1.5, 3 | Tukey’s multipliers for the inner and outer fences |
| Mild outlier | between an inner and an outer fence |
| Extreme outlier | beyond an outer fence |
For normally distributed data the inner fences sit about 2.7σ from the mean, so roughly 0.7% of perfectly ordinary values fall outside them. The outer fences sit about 4.7σ away, where only about 1 value in 400,000 would land by chance.
The rule comes from John Tukey’s Exploratory Data Analysis (1977). The inner and outer fence definitions used here match the NIST/SEMATECH e-Handbook of Statistical Methods.
Worked example
Worked example: daily website sign-ups (even n)
Problem. A site records 61, 55, 99, 58, 63, 48, 67, 57, 82, 60, 52, 65 sign-ups over twelve days. Find the lower and upper fences and classify any outliers.
- 01Sort: 48, 52, 55, 57, 58, 60, 61, 63, 65, 67, 82, 99.
- 02Lower half 48–60 gives Q1 = (55 + 57) / 2 = 56; upper half 61–99 gives Q3 = (65 + 67) / 2 = 66. IQR = 66 − 56 = 10, and 1.5 × IQR = 15.
- 03Lower fence: 56 − 15 = 41. Upper fence: 66 + 15 = 81.
- 04Outer fences: 56 − 30 = 26 and 66 + 30 = 96.
- 05No value is below 41. 82 lies between 81 and 96, so it is a mild outlier. 99 is above 96, so it is extreme.
Answer. The fences are 41 and 81 (inner) and 26 and 96 (outer). The 82-sign-up day is a mild outlier and the 99-sign-up day is extreme, worth checking for a promotion, a bot attack or a logging error.
Example with an odd number of values
Nine commute times are 12, 15, 17, 19, 20, 22, 23, 25 and 50 minutes. The median is 20, the 5th value. Leaving it out, the lower half 12, 15, 17, 19 gives Q1 = (15 + 17) / 2 = 16, and the upper half 22, 23, 25, 50 gives Q3 = (23 + 25) / 2 = 24. The IQR is 8 and 1.5 × IQR is 12.
The lower fence is 16 − 12 = 4 and the upper fence is 24 + 12 = 36, so 50 is an outlier. The outer fences are 16 − 24 = −8 and 24 + 24 = 48; since 50 is above 48, it is an extreme outlier. If you include the median in both halves (Tukey’s hinges), Q1 = 17, Q3 = 23 and the fences are 8 and 32, but 50 is still flagged.
Why your fences may differ from a textbook, Excel or a TI-84
The fence formulas are the same everywhere, but software computes Q1 and Q3 in different ways, and the fences move with them. For the sign-up data above, the four common methods give:
| Quartile method | Q1 | Q3 | Lower fence | Upper fence | Is 82 an outlier? |
|---|---|---|---|---|---|
| Median of halves (TI-84, most textbooks) | 56 | 66 | 41 | 81 | Yes, mild |
| Tukey’s hinges | 56 | 66 | 41 | 81 | Yes, mild |
| Excel QUARTILE.INC, R default | 56.5 | 65.5 | 43 | 79 | Yes, mild |
| Excel QUARTILE.EXC, Minitab | 55.5 | 66.5 | 39 | 83 | No |
How to find the fences in Excel, TI-84, R and Python
None of these has a single “fence” function, so compute Q1 and Q3 and apply the formulas.
- Excel or Google Sheets: with data in A1:A20, put =QUARTILE.INC(A1:A20,1) in B1 and =QUARTILE.INC(A1:A20,3) in B2. The lower fence is =B1-1.5*(B2-B1) and the upper fence is =B2+1.5*(B2-B1).
- TI-83 / TI-84: enter the data in L1, run STAT → CALC → 1:1-Var Stats, scroll to Q1 and Q3, and apply the formulas. The modified box plot in STAT PLOT draws values beyond the fences as separate points.
- R: q <- quantile(x, c(0.25, 0.75)); q[1] - 1.5 * IQR(x) and q[2] + 1.5 * IQR(x). boxplot.stats(x)$out lists the points outside Tukey’s hinge-based fences.
- Python: q1, q3 = numpy.percentile(x, [25, 75]), then q1 - 1.5 * (q3 - q1) and q3 + 1.5 * (q3 - q1).
What to do with a flagged value
A value outside the fences is a candidate for investigation, not automatic deletion. Work through these questions:
- Is it an error? Typos, unit mix-ups (grams entered as kilograms) and sensor glitches should be corrected or removed, with a note.
- Is it from a different population? A wholesale order among retail orders may belong in a separate analysis.
- Is it genuine? Real extreme values carry information. Keep them, and consider methods that are robust to them, such as the median and IQR.
- Does it change the conclusion? Run the analysis with and without the value and report both if they differ.
Common use cases
- Data cleaning: screen survey responses, lab results or transaction amounts before analysis.
- Box plots: the inner fences decide where whiskers end and which points are drawn separately; see the Box Plot Calculator.
- Quality monitoring: flag unusually long process times or defect counts for follow-up.
- Teaching: the 1.5 × IQR rule is the standard outlier definition in introductory and AP Statistics.
Assumptions and limitations
- In large samples, legitimate values often exceed the inner fences (about 7 in every 1,000 for normal data), so not every flagged point is a problem.
- For strongly skewed data, many values in the long tail will be flagged even though they are typical for that distribution. Consider transforming the data (for example, taking logs) first.
- Fences depend on the quartile method, which matters most for small samples.
- Tukey’s rule looks at one variable at a time and cannot detect unusual combinations of values. A robust alternative for one variable is the modified z-score from the Median Absolute Deviation Calculator; for roughly normal data you can also use a z-score cut-off.
Frequently asked questions
How do you find the upper and lower fence?
Can the lower fence be negative?
What is the difference between inner and outer fences?
Is a value exactly on the fence an outlier?
Why 1.5 times the IQR?
Should I remove outliers from my data?
Cite this page
Statculator. (2026, November 14). Lower and Upper Fence Calculator. Retrieved November 14, 2026, from https://statculator.com/descriptive-statistics/lower-and-upper-fence-calculator/