Upper and Lower Fence Calculator

Upper & Lower Fence Calculator

Identify outliers using box plot methodology. Calculate inner and outer fences to detect mild and extreme outliers.

Last updated: March 2026

Fence Calculator

Min 4 values. Enter numbers separated by commas or spaces.

Q1 (25th)
4.50
Median
7.00
Q3 (75th)
10.00
IQR
5.50

Inner Fences (±1.5×IQR)

Lower-3.75
Upper18.25

Mild outliers fall outside these limits

Outer Fences (±3×IQR)

Lower-12.00
Upper26.50

Extreme outliers fall outside these limits

Detected Outliers

Extreme Outliers:

50.00

What are Fences and Outliers?

Fences are boundaries used in box plot analysis to identify outliers—observations that deviate significantly from the main data distribution. There are two fence types corresponding to two levels of outlier severity.

Inner Fences are at Q1 − 1.5×IQR and Q3 + 1.5×IQR. Values outside these but within outer fences are mild outliers. Outer Fences are at Q1 − 3×IQR and Q3 + 3×IQR. Values beyond outer fences are extreme outliers—highly suspicious and warrant immediate investigation.

The multipliers (1.5 and 3) are empirically chosen based on normal distribution theory: 1.5×IQR ≈ ±2.7σ, and 3×IQR ≈ ±5.4σ. This method doesn't assume normality, making it robust for any distribution shape.

How to Identify Outliers

Step-by-Step Process

Step 1: Sort data and calculate Q1 (25th), Q3 (75th), and median (50th) percentiles
Step 2: Calculate IQR = Q3 − Q1 (interquartile range)
Step 3: Calculate inner fences: Q1 − 1.5×IQR (lower), Q3 + 1.5×IQR (upper)
Step 4: Calculate outer fences: Q1 − 3×IQR (lower), Q3 + 3×IQR (upper)
Step 5: Classify points: outside inner = mild outlier, outside outer = extreme outlier
Step 6: Investigate causes before deciding to keep or remove outliers

Why IQR-Based Method?

The IQR method is distribution-free (no normality assumption), making it robust for any data shape. Unlike Z-scores which assume normality, fence-based outlier detection works well for skewed, multimodal, or heavy-tailed distributions.

Example Calculation

Product Quality: Weight Analysis

Data:
Measurements (grams): 2, 4, 5, 7, 8, 12, 50
Step 1:
Calculate quartiles:
Q1 = 4.5, Median = 7, Q3 = 10
Step 2:
Calculate IQR:
IQR = 10 − 4.5 = 5.5
Step 3:
Calculate inner fences:
Lower = 4.5 − 1.5(5.5) = −3.75
Upper = 10 + 1.5(5.5) = 18.25
Step 4:
Calculate outer fences:
Lower = 4.5 − 3(5.5) = −12.0
Upper = 10 + 3(5.5) = 26.5
Result:
The value 50 exceeds the upper outer fence (26.5), so it's an extreme outlier. Investigation reveals a labeling error: the product weighed 5.0g, not 50g. Correcting it refines analysis.

Frequently Asked Questions

Should I remove all outliers?

No. Always investigate first. Outliers may be measurement errors (fix and keep), legitimate extreme values (keep for robustness), or indicate special conditions (analyze separately). Blind removal biases results.

Why use 1.5 and 3 for multipliers?

Based on normal distribution theory: 1.5×IQR ≈ ±2.7σ (99.5% within), 3×IQR ≈ ±5.4σ (extreme). These are conventional thresholds that work well empirically, though other values are valid.

What's the minimum sample size?

At least 4–5 points to calculate meaningful quartiles. For reliable IQR estimation, 20+ observations are better. With small samples, quartiles are unstable.

Does this work for non-normal data?

Yes, it's distribution-free. Unlike Z-scores (which assume normality), the IQR fence method is robust for skewed, multimodal, or any other distribution shape.

What if my data has natural groups?

Calculate fences separately for each group. Applying global fences to grouped data can misidentify group differences as outliers. Context matters—understand your data's structure.

How does IQR outlier detection compare to Z-score?

IQR is distribution-free and robust to skewness. Z-score assumes normality and can misbehave with outliers (they inflate SD). For general use, IQR is often more reliable.

Related Tools