Skip to content

Interquartile Range Calculator — Step-by-Step Solutions

The Interquartile Range Calculator finds Q1, Q2 (median), and Q3 from your dataset, then calculates the IQR. It supports four modes: basic IQR calculation, five-number summary, outlier detection using the 1.5 x IQR rule, and box plot data generation.

Enter comma-separated values to see the quartiles, fences, and any outliers. The outlier detection mode classifies values as mild or extreme outliers, and the box plot mode includes an SVG visualisation of your data distribution.

0 values detected

Your calculations will appear here

How to Use the Interquartile Range Calculator

  1. Select a mode: IQR from Dataset, Five-Number Summary, Outlier Detection, or Box Plot Data.
  2. Enter your numbers as a comma-separated list in the input field. The calculator accepts any number of values (minimum 4).
  3. In IQR mode, the calculator finds Q1, Q2 (median), Q3, and the interquartile range Q3 minus Q1.
  4. In Five-Number Summary mode, you get the minimum, Q1, median, Q3, and maximum, along with IQR and range.
  5. In Outlier Detection mode, the 1.5 x IQR rule identifies mild outliers (beyond 1.5 x IQR) and extreme outliers (beyond 3 x IQR).
  6. In Box Plot Data mode, the calculator generates all values needed for a box-and-whisker plot, including an SVG visualisation.

Formula and Theory

The interquartile range (IQR) measures the spread of the middle 50% of a dataset. It is calculated as Q3 minus Q1, where Q1 is the 25th percentile and Q3 is the 75th percentile. The IQR is resistant to outliers, making it a robust measure of spread.

The five-number summary consists of the minimum, Q1, median (Q2), Q3, and maximum. It provides a concise description of the distribution of a dataset and forms the basis for box-and-whisker plots.

Outlier detection using the IQR method defines fences: lower fence = Q1 - 1.5 x IQR and upper fence = Q3 + 1.5 x IQR. Values outside these fences are considered outliers. Values beyond Q1 - 3 x IQR or Q3 + 3 x IQR are classified as extreme outliers.

Box plots (box-and-whisker diagrams) visualise the distribution of data using the five-number summary. The box spans Q1 to Q3, a line marks the median, and whiskers extend to the most extreme non-outlier values. Outliers are plotted as individual points beyond the whiskers.

Worked Examples

Example 1: Basic IQR calculation

Problem: Find the IQR of: 2, 4, 7, 8, 10, 12, 15.

Solution: Sorted: 2, 4, 7, 8, 10, 12, 15. Q1 = median of {2, 4, 7} = 4. Q3 = median of {10, 12, 15} = 12. IQR = 12 - 4 = 8.

Answer: IQR = 8

Example 2: Outlier detection

Problem: Detect outliers in: 2, 4, 7, 8, 10, 12, 15, 50.

Solution: Q1 = 5.5, Q3 = 13.5, IQR = 8. Lower fence = 5.5 - 12 = -6.5. Upper fence = 13.5 + 12 = 25.5. 50 > 25.5, so 50 is an outlier.

Answer: Outlier: 50

Example 3: Five-number summary

Problem: Find the five-number summary of: 3, 7, 8, 5, 12, 14, 21, 13, 18.

Solution: Sorted: 3, 5, 7, 8, 12, 13, 14, 18, 21. Min = 3, Q1 = 6, Median = 12, Q3 = 16, Max = 21.

Answer: {3, 6, 12, 16, 21}

Frequently Asked Questions

What is the IQR used for?
The IQR measures the spread of the middle half of your data. It is commonly used to detect outliers, construct box plots, and compare distributions. Unlike the range, the IQR is not affected by extreme values.
How do you calculate quartiles?
Sort the data in ascending order. Q2 (the median) splits the data in half. Q1 is the median of the lower half, and Q3 is the median of the upper half. There are several methods for handling even/odd-sized datasets.
What is the 1.5 IQR rule?
Any value below Q1 - 1.5 x IQR or above Q3 + 1.5 x IQR is considered a potential outlier. This rule was popularised by John Tukey and is the standard method used in box plots.
How many values do I need?
You need at least 4 values to calculate meaningful quartiles. With fewer values, the quartile calculations become unreliable.

Related Statistics Calculators

Related Articles