Free calculator

IQR & Outlier Calculator

Find the interquartile range, the outlier fences and every outlier in your data with the 1.5 × IQR rule, with each step shown and a box plot of the fences.

  • Step-by-step working
  • 1.5 × IQR fences
  • Extreme outliers flagged
  • Free

Your data

13 numbers

Quartile method

Textbooks and software disagree on how to calculate quartiles. Pick the method your class or software uses.

Interquartile range & outliers

0102030405060lower fence 13upper fence 41

Your data is saved in this browser only. Nothing is uploaded.

Step-by-step solutionShow
  1. 1

    Sort the data from smallest to largest

    2, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 58

    n = 13, so the minimum is 2 and the maximum is 58.

  2. 2

    Find the median (Q2)

    n is odd, so the median is the middle value (position 7).

    = 27

  3. 3

    Find Q1 and Q3

    Split the data into a lower half and an upper half, leaving out the median (6 values each). Q1 is the median of the lower half; Q3 is the median of the upper half.

    Lower: 2, 21, 23, 24, 25, 26

    Upper: 28, 29, 30, 31, 33, 58

    Q1 = 23.5, Q3 = 30.5

  4. 4

    Interquartile range

    IQR = Q3 − Q1 = 30.5 − 23.5

    = 7

  5. 5

    Outlier fences (1.5 × IQR rule)

    Lower = Q1 − 1.5 × IQR = 23.5 − 10.5 = 13

    Upper = Q3 + 1.5 × IQR = 30.5 + 10.5 = 41

    2 values lie outside the fences: 2, 58. 2, 58 are even beyond 3 × IQR (extreme).

Other quartile methods

MethodQ1Q3IQR
Median of halves (TI-84, most textbooks)23.530.57
Inclusive (Excel QUARTILE.INC, Google Sheets)24306
Exclusive (Excel QUARTILE.EXC, Minitab, SPSS)23.530.57

Need a full chart? Make a styled box plot with several groups.

The 1.5 × IQR rule

QuantityFormula
Interquartile rangeIQR = Q3 − Q1
Lower fenceQ1 − 1.5 × IQR
Upper fenceQ3 + 1.5 × IQR
OutlierAny value outside the fences

Worked example

Data: 2, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 58 (13 values).

  1. Median = 27 (the 7th value).
  2. Lower half: 2, 21, 23, 24, 25, 26, so Q1 = (23 + 24) ÷ 2 = 23.5. Upper half: 28, 29, 30, 31, 33, 58, so Q3 = (30 + 31) ÷ 2 = 30.5.
  3. IQR = 30.5 − 23.5 = 7, and 1.5 × IQR = 10.5.
  4. Fences: 23.5 − 10.5 = 13 and 30.5 + 10.5 = 41.
  5. 2 is below 13 and 58 is above 41, so both are outliers. Both are also beyond 3 × IQR (2.5 and 51.5), so they are extreme.

Load “With outliers” above to follow along.

Why 1.5?

The rule comes from John Tukey’s box plot. For normally distributed data, the fences fall about 2.7 standard deviations from the mean, so only about 0.7% of values would be flagged by chance. It is a convention, not a law; some fields use 2 × or 3 × IQR instead.

Prefer to measure unusualness in standard deviations? Use the z-score calculator (values with |z| above 3 are often treated as outliers). To draw the result, open the box plot maker.

Another example: one suspicious value

Reaction times (in hundredths of a second): 12, 14, 15, 15, 16, 17, 18, 19, 21, 48. Q1 = 15 and Q3 = 19, so IQR = 4 and the fences are 15 − 6 = 9 and 19 + 6 = 25. The value 48 is far above 25, so it is an outlier, perhaps a moment of distraction or a typo for 18. Check the original record before deciding what to do with it.

Minimum(non-outlier)MedianQ2, 50%Maximum(non-outlier)Outlier> Q3 + 1.5×IQRQ125%Q375%IQR = Q3 − Q1
The parts of a box plot. The box holds the middle 50% of the data; the whiskers stop at the last values inside the outlier fences.

Common mistakes to avoid

  • Deleting outliers automatically. First check whether a value is an error. Genuine outliers are often the most interesting data.
  • Using fences from a different quartile method. Q1 and Q3 change slightly between methods, and so can the outlier list for borderline values.
  • Using the IQR rule on tiny samples. With very few values, the quartiles are unstable.

Do it in other software

SoftwareHow
Excel=QUARTILE.INC(r,3) − QUARTILE.INC(r,1) for the IQR; fences from Q1 − 1.5*IQR and Q3 + 1.5*IQR.
Pythonq1, q3 = np.percentile(x, [25, 75]); iqr = q3 − q1; x[(x < q1 − 1.5*iqr) | (x > q3 + 1.5*iqr)]
TI-841-Var Stats gives Q1 and Q3; the modified box plot draws outliers automatically.

Related tools: Box Plot Maker, Five-Number Summary Calculator, Z-Score Calculator, Histogram Maker and Descriptive Statistics Calculator.

Frequently asked questions

How do you calculate the interquartile range?

Find the first quartile (Q1) and the third quartile (Q3), then subtract: IQR = Q3 − Q1. It is the range of the middle 50% of the data.

How do you find outliers with the IQR?

Compute the fences: lower fence = Q1 − 1.5 × IQR and upper fence = Q3 + 1.5 × IQR. Any value below the lower fence or above the upper fence is an outlier.

What is an extreme outlier?

A value more than 3 × IQR beyond the quartiles (below Q1 − 3 × IQR or above Q3 + 3 × IQR). The calculator flags these separately.

Should I delete outliers?

Not automatically. First check whether an outlier is a mistake (a typo or measurement error). If it is a genuine value, it is often the most interesting part of the data. Report it, and consider showing results with and without it.

Why is the IQR better than the range?

The range depends only on the two most extreme values, so a single outlier can distort it. The IQR ignores the top and bottom 25% of the data, so it is resistant to outliers.

Related tools