Outlier Calculator

Enter your data and the IQR multiplier (1.5 is the usual choice). Quartiles use linear interpolation, the same as Excel PERCENTILE.INC.

Updated

Embed this calculator

Paste this code into your page. The calculator runs inside the frame and links back to the full version.

Keep the credit link in place. Do not resell the calculator.

Formula

Quartiles use linear interpolation (Excel PERCENTILE.INC): sort the data, take position (n - 1) × p (p = 0.25 or 0.75) and interpolate between the two neighbouring values.

  • IQR = Q3 - Q1
  • lower fence = Q1 - k × IQR, upper fence = Q3 + k × IQR (k = 1.5 by default)
  • A value is an outlier if it is below the lower fence or above the upper fence. A value exactly on a fence is not.

Worked example

Data 1, 2, 3, 4, 5, 6, 7, 8, 9, 50 (n = 10):

  • Q1 at position 2.25 = 3.25, Q3 at position 6.75 = 7.75, IQR = 4.5
  • Lower fence = 3.25 - 6.75 = -3.5, upper fence = 7.75 + 6.75 = 14.5
  • 50 is above 14.5, so it is the only outlier.

Frequently asked questions

How does the IQR rule find outliers?

Compute Q1, Q3 and IQR = Q3 - Q1. A value is an outlier if it is below Q1 - k × IQR or above Q3 + k × IQR. For 1 to 9 and 50: Q1 = 3.25, Q3 = 7.75, IQR = 4.5, so the fences are -3.5 and 14.5 and only 50 is flagged.

Which quartile method does this calculator use?

Linear interpolation between ordered values, at position (n - 1) × p, as in Excel PERCENTILE.INC and the default of numpy. Other methods, such as exclusive medians or PERCENTILE.EXC, can give slightly different quartiles and fences on small data sets.

Why 1.5 as the multiplier?

1.5 is the convention from John Tukey for flagging mild outliers. A multiplier of 3 marks only extreme ones: for the same data the fences widen to -10.25 and 21.25.

Should I delete the outliers I find?

Not automatically. An outlier can be a typing error, or a real and important observation. Check the source before removing it, and report what you did.