Omni Calculator logo

Upper Fence Calculator

Created by Luis Hoyos
Reviewed by Komal Rafay
Last updated: May 17, 2024

If you're searching for how to calculate the upper fence, the lower fence, and the outliers of your data set, this is the perfect tool.

Input your numbers, and the calculator will provide the following:

  • The lower and the upper fence;
  • The outliers; and
  • The calculation procedure

In the rest of this article, we explain how to find the upper and lower fences using their formulas.

In our lower and upper fence calculator, we get into a more comprehensive explanation.

How to calculate the upper fence and lower fence?

To calculate the upper and lower fences, you need three parameters:

  • The first quartile (Q);
  • The third quartile (Q); and
  • The interquartile range (IQR)

🙋 The interquartile range is the difference between the third and the first quartile: IQR = Q₃ - Q

🙋 In our quartile calculator, we explain how to find Q and Q

Once you know those parameters, the problem of how to find the upper fence and lower fence boils down to using two formulas:

Upper fence = Q₃ + 1.5 × IQR

The lower fence calculation is similar:

Lower fence = Q₁ ​− 1.5 × IQR

🙋 Using the 1.5 coefficient before IQR is the most common practice, but we can use other values (e.g., 2 or 3), depending on how dispersed we expect data to be. You can modify it in the calculator's advanced mode.

Now that we know how to find the upper fence and the lower fence let's look at the tricky part: obtaining Q and Q.

How to calculate the first and third quartiles

The tricky part about calculating the upper fence is finding the quartiles (Q₁ and Q₃). The procedure is as follows:

  1. Order your numbers in ascending order (our order from least to greatest calculator explains some algorithms for large data sets).
  2. Divide the ordered data set into two halves;
  3. The first quartile is the median of the first half, and the third quartile is that of the second (our median calculator explains how to obtain it).

If the number of elements is odd, the middle number marks the end of the first and the beginning of the second half (although there are various ways to deal with uneven amounts. Wikipedia lists four methods).


Let's use the following ordered set:

0, 7, 11, 12, 13, 14, 15, 16, 22, 30, 39, 49, 51, 56, 62, 74, 92, 97 98, 99

First, divide the data set into two halves:

  • First half: 0, 7, 11, 12, 13, 14, 15, 16, 22, 30.
  • Second half: 39, 49, 51, 56, 62, 74, 92, 97, 98, 99.

The medians of the first and second halves are 13.5 and 68, respectively. Therefore:

  • Q₁ = 13.5; and
  • Q₃ = 68.


How to find the upper fence and lower fence?

To find the lower and upper fence of a dataset:

  1. Obtain the first and third quartiles (Q1 and Q3, respectively).

  2. Find the interquartile range (IQR):

    IQR = Q3Q1

  3. Finally, calculate the upper and lower fences with the following formulas:

    Upper fence = Q3 + 1.5 × IQR
    Lower fence = Q1 ​− 1.5 × IQR

What is the relationship between quartiles and percentiles?

The relationship between the quartiles and percentiles is described by the following:

  • The first quartile (Q1) is the 25th percentile;
  • The third quartile (Q3) is the 75th percentile; and
  • The second quartile (Q2) is the 50th percentile (the median).
Luis Hoyos
Related calculators
Enter up to 50 numbers
Too few values — try adding some!
Check out 44 similar descriptive statistics calculators 📊
5 number summary5★ rating averageCoefficient of variation… 41 more
People also viewed…

Possible combinations

Use our possible combinations calculator to know how many combinations are possible, given a total number of objects and a sample size.


The perfect snowman calculator uses math & science rules to help you design the snowman of your dreams!

Test grade

With this test grade calculator, you'll quickly determine the test percentage score and grade.


Our Z-test calculator is here to help you learn about, and perform, a one-sample Z-test.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service