Skip to content
Statculator
Descriptive Statistics

Lower and Upper Fence Calculator

Free lower and upper fence calculator: find Q1 − 1.5 × IQR and Q3 + 1.5 × IQR, inner and outer fences, mild and extreme outliers and a box plot, with steps.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try
12 values

Separate values with commas, spaces or new lines.

The fences depend on Q1 and Q3, which differ slightly between methods.

Results

Lower fence, Q1 − 1.5 × IQR
41
Upper fence, Q3 + 1.5 × IQR
81
Values outside the fences
2 (1 mild, 1 extreme)

2 possible outliers found

Mild: 82. Extreme: 99. Check whether these values are a recording error, a different population or a genuine but unusual observation before removing anything.

First quartile, Q1
56
Third quartile, Q3
66
Interquartile range, IQR
10
1.5 × IQR
15
Lower outer fence, Q1 − 3 × IQR
26
Upper outer fence, Q3 + 3 × IQR
96
Mild outliers
82
Extreme outliers
99
Whisker ends (furthest values inside the fences)
48 and 67
Count, n
12

Interpretation: Values below 41 or above 81 are possible outliers; beyond 26 or 96 they are extreme. Here 82 and 99 are flagged.

Box plot with values beyond the inner fences shown as pointsBox plot with values beyond the inner fences shown as pointsQ1 56, median 60.5, Q3 66Mean 63.9167Outlier 82Outlier 994550556065707580859095100Value

Inner and outer fences

FenceFormulaValue
Lower outer fenceQ1 − 3 × IQR = 56 − 3026
Lower inner fenceQ1 − 1.5 × IQR = 56 − 1541
Upper inner fenceQ3 + 1.5 × IQR = 66 + 1581
Upper outer fenceQ3 + 3 × IQR = 66 + 3096

Values outside the inner fences

ValueSideTypeDistance beyond the box (in IQRs)
82Above the upper fenceMild (1.5–3 × IQR)1.6
99Above the upper fenceExtreme (beyond 3 × IQR)3.3

Distance is measured from Q1 (low values) or Q3 (high values) in multiples of the IQR. Over 1.5 is mild, over 3 is extreme.

Step-by-step solution

  1. 1

    Sort the data from smallest to largest

    xₖ below means the k-th smallest value.

    Sorted (n = 12): 48, 52, 55, 57, 58, 60, 61, 63, 65, 67, 82, 99
  2. 2

    Find the median, Q2

    n = 12 is even, so the median is the average of the two middle values.

    Q2 = (x₆ + x₇) / 2 = (60 + 61) / 2 = 60.5
  3. 3

    Find Q1, the median of the lower half

    Because n is even, the data split into two halves with no value left over.

    Lower half (positions 1–6): 48, 52, 55, 57, 58, 60
    Q1 = (x₃ + x₄) / 2 = (55 + 57) / 2 = 56
  4. 4

    Find Q3, the median of the upper half

    Upper half (positions 7–12): 61, 63, 65, 67, 82, 99
    Q3 = (x₉ + x₁₀) / 2 = (65 + 67) / 2 = 66
  5. 5

    Find the interquartile range

    IQR = Q3 − Q1 = 66 − 56 = 10
  6. 6

    Compute the inner fences (k = 1.5)

    Lower = Q1 − 1.5 × IQR = 56 − 15 = 41
    Upper = Q3 + 1.5 × IQR = 66 + 15 = 81
  7. 7

    Compute the outer fences (k = 3)

    Lower = Q1 − 3 × IQR = 56 − 30 = 26
    Upper = Q3 + 3 × IQR = 66 + 30 = 96
  8. 8

    Classify the values outside the fences

    A value exactly on a fence is not flagged.

    Mild (between inner and outer fences): 82
    Extreme (beyond the outer fences): 99

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

  1. Type or paste your numbers into Data values, separated by commas, spaces or new lines. They do not need to be sorted.
  2. 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.
  3. 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.
  4. 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 fenceUpper fence
FormulaQ1 − 1.5 × IQRQ3 + 1.5 × IQR
FlagsUnusually small valuesUnusually large values
Outer (extreme) versionQ1 − 3 × IQRQ3 + 3 × IQR
In a box plotLower whisker stops at the smallest value at or above itUpper 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:

  1. Sort the values from smallest to largest.
  2. 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.
  3. Find the IQR: IQR = Q3 − Q1, then multiply it by 1.5.
  4. Find the lower fence by subtracting 1.5 × IQR from Q1, and the upper fence by adding 1.5 × IQR to Q3.
  5. 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:

Interquartile range
IQR = Q3 − Q1
Lower fence formula
Lower fence = Q1 − 1.5 × IQR
Upper fence formula
Upper fence = Q3 + 1.5 × IQR
Outer fences
Q1 − 3 × IQR and Q3 + 3 × IQR
Formula symbols
SymbolMeaning
Q1first quartile (25th percentile), the median of the lower half
Q3third quartile (75th percentile), the median of the upper half
1.5, 3Tukey’s multipliers for the inner and outer fences
Mild outlierbetween an inner and an outer fence
Extreme outlierbeyond 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.

  1. 01Sort: 48, 52, 55, 57, 58, 60, 61, 63, 65, 67, 82, 99.
  2. 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.
  3. 03Lower fence: 56 − 15 = 41. Upper fence: 66 + 15 = 81.
  4. 04Outer fences: 56 − 30 = 26 and 66 + 30 = 96.
  5. 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 methodQ1Q3Lower fenceUpper fenceIs 82 an outlier?
Median of halves (TI-84, most textbooks)56664181Yes, mild
Tukey’s hinges56664181Yes, mild
Excel QUARTILE.INC, R default56.565.54379Yes, mild
Excel QUARTILE.EXC, Minitab55.566.53983No

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?

Find Q1 and Q3 and subtract to get the IQR. The lower fence is Q1 − 1.5 × IQR and the upper fence is Q3 + 1.5 × IQR. For example, with Q1 = 56 and Q3 = 66, the IQR is 10, 1.5 × IQR is 15, and the fences are 41 and 81.

Can the lower fence be negative?

Yes. Whenever 1.5 × IQR is larger than Q1, the lower fence drops below zero. For 0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 9, 30 days absent, Q1 = 1.5 and Q3 = 5.5, so the lower fence is 1.5 − 6 = −4.5. For data that cannot be negative, such as counts or times, this simply means no low outliers are possible; the upper fence of 11.5 still flags the 30.

What is the difference between inner and outer fences?

Inner fences use 1.5 × IQR and outer fences use 3 × IQR beyond the quartiles. A value between an inner and an outer fence is a mild outlier; a value beyond an outer fence is an extreme outlier. Most textbooks and box plots use only the inner fences.

Is a value exactly on the fence an outlier?

No. Under Tukey’s rule a value is an outlier only if it is strictly below the lower fence or strictly above the upper fence. A value equal to a fence is the furthest point a whisker can reach.

Why 1.5 times the IQR?

John Tukey chose 1.5 as a practical compromise: wide enough that normal data rarely cross the fences (about 0.7% of values do), narrow enough to catch values that deserve a second look. The 3 × IQR outer fence marks values that are very unlikely under a normal model.

Should I remove outliers from my data?

Only if you have a reason beyond the fence rule, such as a confirmed recording error or a value from a different population. Removing genuine values to make results look cleaner biases the analysis. When in doubt, report results with and without the outlier.

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/