What this calculator does
The upper fence is the boundary statisticians use to flag unusually high outliers in a set of numbers. Any value above the upper fence is treated as a potential outlier and often gets special attention or a separate mark on a box plot, while values below it are considered part of the normal spread of the data.
The upper fence formula is Q3 + 1.5 × IQR, where Q3 is the upper quartile and IQR is the interquartile range, Q3 minus Q1. This calculator also reports the matching lower fence and lists any values in your data that actually fall outside either boundary.
The formula
Sort the data and find Q1 (25th percentile) and Q3 (75th percentile) by linear interpolation. The interquartile range IQR is Q3 minus Q1. The upper fence is Q3 plus 1.5 times the IQR, and the lower fence, for completeness, is Q1 minus 1.5 times the IQR.
| Term | Meaning |
|---|---|
| Q1, Q3 | The lower and upper quartiles, the 25th and 75th percentiles of the sorted data. |
| IQR | Interquartile range: Q3 − Q1, the spread of the middle 50% of the data. |
| Upper fence | Q3 + 1.5 × IQR, the boundary above which a value is flagged as a potential outlier. |
The inputs explained
| Field | What to enter |
|---|---|
| Data (comma or space separated) | The data set, as numbers separated by commas or spaces. |
When to use it
Building a box plot
Box plots draw their whiskers out to the most extreme data point still inside the fences, and plot anything beyond as individual points; the upper fence is what decides where that line is drawn.
Flagging suspicious data entry
A value well above the upper fence in a data set is often either a genuine extreme case or a data entry error, and the fence gives an objective threshold to investigate rather than relying on a gut feeling of what looks too high.
Comparing to a fixed rule of thumb
The 1.5 × IQR rule is a widely used convention rather than a strict statistical law, but it is consistent and reproducible, which is why it is the default outlier check in most statistical software.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How the upper fence moves with a shifting data set
The same relative spread of ten values, shifted up by adding a constant offset to every value.
| Data (offset applied) | Upper fence | Lower fence | IQR |
|---|---|---|---|
| offset 0 | 51.750 | 27.750 | 6.000 |
| offset 10 | 61.750 | 37.750 | 6.000 |
| offset 20 | 71.750 | 47.750 | 6.000 |
| offset 30 | 81.750 | 57.750 | 6.000 |
Questions
What is the upper fence formula?
Upper fence = Q3 + 1.5 × IQR, where Q3 is the 75th percentile of the data and IQR is the interquartile range, Q3 minus Q1. Any value above this figure is flagged as a potential outlier.
Why 1.5 times the IQR specifically?
It is a convention introduced by statistician John Tukey for box plots, chosen because it flags a reasonable proportion of genuinely unusual values without over-flagging normal variation, for data that is roughly symmetric. It is a widely used default, not a fixed mathematical law.
Does the interquartile range calculator already show the fences?
The interquartile range calculator on this site reports Q1, Q3 and the IQR itself, but not the upper and lower fence values. This calculator adds that specific outlier-boundary step on top of the same quartile calculation.
What should I do with a value beyond the upper fence?
Treat it as a signal to look closer, not as an automatic instruction to delete it. It might be a data entry error worth correcting, or it might be a genuine, important extreme value that should stay in the analysis.
For the full quartile and interquartile range breakdown behind this figure, see the interquartile range calculator. For the middle value of the same data set, see the median calculator.