Upper and Lower Fence Calculator: IQR and Outliers

Find Q1, Q3, the IQR and the upper and lower fences for a data set and spot outliers.

Loading calculator...

Upper and lower fence in short
On this page

How to use the upper and lower fence calculator

1

Paste your numbers

Type or paste the numbers, separated by commas, spaces or new lines. You need at least 4.

2

Choose a quartile method

The default is the textbook method. Pick another in the advanced options if your course or software uses it.

3

Set the multiplier

Leave 1.5 for outliers. Use 3 to find extreme outliers.

4

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.

Outliers are not always errors

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

They are cut-off values at Q3 + 1.5 × IQR and Q1 − 1.5 × IQR. Data outside them is flagged as an outlier.

Sort the data, find Q1 and Q3, and subtract: IQR = Q3 − Q1.

It is the convention proposed by John Tukey for flagging outliers in box plots. A multiplier of 3 is often used for extreme outliers.

Different methods compute quartiles slightly differently. Compare the method used by your book or software and choose the matching option.

At least 4 for this calculator. Quartiles from very small sets are rough, so more data gives more reliable fences.

Yes. If all your data are positive, a negative lower fence means no low value can be an outlier.

Embed this calculator on your website

Free to use on any site. Copy the code below and paste it into an HTML block on your page. Please keep the credit link under the calculator.

Works with WordPress, Wix, Squarespace, Webflow and most site builders that allow HTML. How embedding works.

Estimates, not advice

PureCalculate’s calculators give estimates for planning and education. They aren’t financial, tax or legal advice. Fees and tax rules change, so check the official source before making a decision. Spotted a mistake? Please tell us through the contact page.

More free calculators

Area Calculator

Find the area and perimeter of a rectangle, square, triangle, circle, trapezoid, parallelogram or ellipse, with m², ft², acre and hectare conversions.

Open calculator
Scroll to Top