← All Calculators

Quartile & IQR Calculator

Find Q1, Q2 (median), Q3, the interquartile range (IQR), and outliers using the 1.5×IQR rule.

Quartile & IQR formulas

Position of the p-th percentilerank = (p / 100) × (n − 1), counting the sorted data from 0
Interpolatevalue = x⌊rank⌋ + (rank − ⌊rank⌋) × (x⌈rank⌉ − x⌊rank⌋)
IQRIQR = Q3 − Q1
Outlier fencesbelow Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR

Where Q1 = 25th, Q2 = 50th (median), Q3 = 75th percentile. This is the "inclusive" method used by Excel QUARTILE.INC.

Worked examples

  1. Data: 1, 3, 5, 7, 9, 11, 13, 15, 17, 40 (n = 10).

    1. Q1: rank 0.25 × 9 = 2.25 → 5 + 0.25 × (7 − 5) = 5.5
    2. Q2: rank 4.5 → 9 + 0.5 × (11 − 9) = 10
    3. Q3: rank 6.75 → 13 + 0.75 × (15 − 13) = 14.5
    4. IQR = 14.5 − 5.5 = 9; fences: 5.5 − 13.5 = −8 and 14.5 + 13.5 = 28

    Answer: Q1 = 5.5, median = 10, Q3 = 14.5, and 40 is an outlier

Tips & common mistakes

  • Textbooks and software use slightly different quartile methods, so small differences are normal.