AbraCalc

Quartiles and IQR Calculator

Calculate Q1, Q2 (median), Q3, and the interquartile range (IQR) from a list of numbers.

Embed this tool on your site

How to use this tool

  1. Enter numbers (comma-separated) in the fields above.
  2. Results update instantly as you type โ€” or click Calculate.
  3. Read your q1 (25th percentile) and the full breakdown beneath it.

Enter a list of numbers to find Q1, Q2 (median), Q3, and the interquartile range (IQR = Q3 โˆ’ Q1).

Formula

Sort values in ascending order, then:

Q2 (median) = middle value (or average of two middle values) of the full dataset.

Q1 = median of the lower half (values below Q2, excluding Q2 for odd-length sets).

Q3 = median of the upper half (values above Q2, excluding Q2 for odd-length sets).

IQR = Q3 โˆ’ Q1

How it works

This calculator divides a sorted dataset into four equal parts, identifying the 25th, 50th, and 75th percentile boundaries using the exclusive median method (the median value itself is excluded from both halves when the dataset has an odd number of values).

The interquartile range (IQR) spans the middle 50% of the data and is a robust measure of spread that is not affected by extreme values or outliers.

Worked example

Worked example

  1. Input: 1, 2, 3, 4, 5, 6, 7, 8 (already sorted, n = 8).
  2. Q2 (median): average of 4th and 5th values = (4 + 5) / 2 = 4.5.
  3. Lower half (n even, so first 4 values): [1, 2, 3, 4]. Q1 = (2 + 3) / 2 = 2.5.
  4. Upper half (last 4 values): [5, 6, 7, 8]. Q3 = (6 + 7) / 2 = 6.5.
  5. IQR = Q3 โˆ’ Q1 = 6.5 โˆ’ 2.5 = 4.0.

Q1 = 2.5, Q2 = 4.5, Q3 = 6.5, IQR = 4.0

Key terms

Quartile
One of three cut points (Q1, Q2, Q3) that divide a sorted dataset into four equal-frequency groups.
Interquartile range (IQR)
The distance between the 25th and 75th percentiles (Q3 โˆ’ Q1); captures the spread of the middle 50% of the data.
Median (Q2)
The middle value of a sorted dataset; the 50th percentile, half of all values fall below it and half above.
Outlier detection
Values more than 1.5 ร— IQR below Q1 or above Q3 are commonly flagged as potential outliers using the Tukey fence rule.
Box plot
A graphical summary that uses Q1, Q2, Q3, and the IQR fences to display a dataset's distribution and highlight outliers.

Frequently asked questions

What is the interquartile range (IQR)?
The IQR is the range of the middle 50% of the data: IQR = Q3 โˆ’ Q1. It is a robust measure of spread that is not affected by outliers, unlike the full range.

References & sources