Statistics & Probability

Quartile and Interquartile Range (IQR) Calculator

Paste your data to get Q1, the median, Q3, the IQR and the five-number summary.

Your numbers

Separate numbers with commas, spaces or new lines. You can paste a column from a spreadsheet.

Your results

First quartile (Q1)
First quartile (Q1)
—
Median (Q2)
—
Third quartile (Q3)
—
Interquartile range (IQR)
—
Minimum
—
Maximum
—
Five-number summary
—

Quartile and Interquartile Range (IQR) Calculator by TheCalcTools

How the Quartile and Interquartile Range (IQR) Calculator works

Quartiles split sorted data into four parts with about a quarter of the values in each. Q1 is the 25th percentile, the median is the 50th and Q3 is the 75th.

This calculator uses linear interpolation between sorted values: the position of quartile p is (n − 1) × p, counting from 0. This is the rule used by Excel’s QUARTILE.INC, Google Sheets QUARTILE and the default in R and NumPy.

The interquartile range Q3 − Q1 covers the middle half of the data and is not affected by extreme values. Other textbooks use slightly different quartile rules, so results can differ a little for small data sets.

The formula

Position of Qp = (n − 1) × p (0-based); Qp = x₍ₖ₎ + f × (x₍ₖ₊₁₎ − x₍ₖ₎)IQR = Q3 − Q1. Five-number summary: minimum, Q1, median, Q3, maximum.

Worked example

Using the default values shown in the calculator:

Your data12, 15, 15, 18, 20, 22, 25, 25, 25, 30
  1. Sorted: 12, 15, 15, 18, 20, 22, 25, 25, 25, 30 (n = 10).
  2. Q1 is at position 9 × 0.25 = 2.25: 15 + 0.25 × (18 − 15) = 15.75. Q3 is at position 6.75: 25 + 0.75 × 0 = 25.00.
  3. IQR = 25.00 − 15.75 = 9.25.

Result:

First quartile (Q1)15.7500
Median (Q2)21.0000
Third quartile (Q3)25.0000
Interquartile range (IQR)9.2500
Minimum12.0000
Maximum30.0000
Five-number summary12, 15.75, 21.00, 25.00, 30

Frequently asked questions

Why does my textbook give a different Q1?

There are several accepted ways to compute quartiles, for example the “median of halves” method taught in many schools. They agree for large data sets but can differ for small ones. This calculator uses the common spreadsheet method.

What is the IQR used for?

It describes spread without being affected by outliers, and it is used to flag outliers: values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR.

Sources and further reading

More in Statistics & Probability · All calculators

This calculator gives estimates for information only. Check important results independently before you rely on them. See our disclaimer.