Interquartile Range CalculatorIQR, Outlier Fences, Box Plot and Grouped Data, with Steps

Paste your data to get the IQR, the upper and lower fences, and every mild and extreme outlier on a box plot. You can also compare the spread of two groups, find the IQR of a grouped frequency table, or check values against fences you already have.

1.5 × IQR outlier rule Mild vs extreme outliers 5 quartile methods (TI-84, Excel) Grouped-data IQR + ogive IQR vs SD vs MAD

Fences follow Tukey’s 1.5 × IQR rule, with the Hoaglin–Iglewicz (1987) 2.2 alternative. Quartile methods follow Hyndman and Fan (1996) and are cross-checked against NumPy. All math runs in your browser.

What is the interquartile range?

The interquartile range (IQR) is the spread of the middle 50% of a dataset: IQR = Q3 − Q1, the third quartile minus the first. Because it ignores the lowest and highest 25% of values, the IQR is robust to outliers. It is also the yardstick for Tukey’s outlier rule, where any value below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR is flagged.

IQR = Q3 − Q1 Q1MedianQ3outlier
Data label
Values (commas, spaces or new lines)
Quartile method
Fence multiplier (k)

Results update as you type. Values beyond Q1 − 3 × IQR or Q3 + 3 × IQR are always classed as extreme.

Interquartile range
IQR—

Enter your data

Your result appears here.

Box plot with outlier fences

The box spans Q1 to Q3, the whiskers reach the furthest non-outlier values, and the dashed lines mark the fences. Every observation is shown below the box.

Typical valueMild outlierExtreme outlier

Outlier check

Each flagged value, measured in IQRs beyond the nearer quartile.

How robust is your spread?

The SD is pulled by extreme values and the IQR is not. Dividing the IQR by 1.349 gives an SD estimate that ignores the tails.

Why your textbook or Excel may show a different IQR

The same data under five standard quartile definitions. Your selected method is highlighted.

Report it

—

Notes on your result

    Step-by-step solution
    Copied ✓

    How to Find the Interquartile Range (Step by Step)

    1. Sort the data from smallest to largest. With the default data that gives 4, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 16, 18, 19, 21, 33, 47.
    2. Find the median (Q2). With n = 19, the median is the 10th value, 12.
    3. Split the data into halves. With the exclusive method (TI-84 and most US textbooks), leave the median out, so each half has 9 values.
    4. Find Q1 and Q3. Q1 is the median of the lower half (4 … 12), which is 9. Q3 is the median of the upper half (13 … 47), which is 18.
    5. Subtract. IQR = Q3 − Q1 = 18 − 9 = 9 minutes. The middle half of patients waited between 9 and 18 minutes.
    6. Build the fences. Lower = 9 − 1.5 × 9 = −4.5; upper = 18 + 1.5 × 9 = 31.5. The values 33 and 47 lie above the upper fence. 47 is also beyond the outer fence (18 + 3 × 9 = 45), which makes it an extreme outlier.

    The calculator repeats these steps for your own data and colours the quartile positions in the sorted list, so you can check a hand calculation line by line. For quartiles on their own, with every position rule explained, see the Quartile Calculator.

    IQR Formula and Related Measures

    INTERQUARTILE RANGE

    IQR = Q3 − Q1

    This is the width of the middle 50% of the data, in the data’s own units.

    TUKEY’S FENCES

    Lower = Q1 − k × IQR
    Upper = Q3 + k × IQR

    k = 1.5 gives the inner fences (mild outliers) and k = 3 the outer fences (extreme outliers).

    SEMI-IQR AND QUARTILE COEFFICIENT

    Semi-IQR = (Q3 − Q1) / 2
    QCD = (Q3 − Q1) / (Q3 + Q1)

    The semi-IQR is also called the quartile deviation. QCD is a unit-free spread for comparing scales, like a robust coefficient of variation.

    ROBUST SD ESTIMATE

    σ̂ ≈ IQR / 1.349

    For normal data, IQR = 1.349σ. Comparing σ̂ with the ordinary SD shows how much the tails are inflating the SD.

    The 1.5 × IQR Rule for Outliers

    John Tukey’s rule flags any observation more than 1.5 IQRs below Q1 or above Q3. It is popular because it needs no assumption about the shape of the distribution, and the quartiles themselves are not distorted by the outliers they are trying to detect. The SD-based “±3 SD” rule fails exactly when outliers are present, because they inflate the SD.

    Why 1.5? How often each fence flags clean normal data

    Multiplier kFence position (normal data)Share of clean data flaggedTypical use
    1.5±2.70 σ0.70%Standard box plots and screening for mild outliers
    2.0±3.37 σ0.075%A stricter screen for large samples
    2.2±3.64 σ0.027%Hoaglin and Iglewicz’s recommendation for fewer false alarms
    3.0±4.72 σ0.0002%Outer fences, where only extreme outliers fall

    So with k = 1.5, even perfectly normal data will show about 1 flagged point in every 140 observations. In a sample of 500, expect around 3 or 4 “outliers” that are just ordinary tail values. That is why a flag means investigate, not delete. Check for data-entry errors and measurement problems first, and only remove a value if you can justify it. If you remove any, report results with and without them.

    Mild vs extreme: values between the inner (1.5) and outer (3.0) fences are mild outliers. Values beyond the outer fences are extreme. In the default data, 33 minutes is a mild outlier and 47 minutes is extreme, perhaps a prescription that needed a call to the prescriber.

    IQR vs Standard Deviation vs Range

    MeasureWhat it coversEffect of one outlierPair it withBest for
    RangeMin to max, 100% of the dataHuge, since it is defined by the extremes—Quick checks and quality limits
    IQRMiddle 50%None (unless over 25% of the data are outliers)MedianSkewed data, income, wait times, lab values, Likert scales
    Standard deviationAverage distance from the meanLarge, because deviations are squaredMeanRoughly symmetric data and inference such as t-tests
    MADMedian distance from the medianNone (50% breakdown point)MedianRobust statistics and outlier scoring

    Same standard deviation, very different spread

    Load the Compare two groups tab. Branch A and Branch B have almost identical standard deviations (10.17 and 10.17 minutes), yet Branch A’s IQR is 9 and Branch B’s is 16. Branch A is usually tighter, and two long waits (33 and 47 minutes) inflate its SD. Branch B is consistently spread out. The SD alone would call them equally variable. The IQR shows they are not. When you do need the SD, the Standard Deviation Calculator shows every step.

    Why Different Calculators Give Different IQRs

    There is no single agreed definition of a quartile. Hyndman and Fan (1996) catalogued nine. The five below cover nearly every textbook and software package. For the default data (n = 19):

    MethodUsed byQ1Q3IQR
    Exclusive medianTI-83/84, Moore and McCabe, most US intro textbooks9189
    Inclusive median (Tukey’s hinges)Tukey’s EDA, many box-plot programs9178
    Linear, type 7Excel QUARTILE.INC, Google Sheets, R default, NumPy default9178
    Type 6Excel QUARTILE.EXC, SPSS, Minitab9189
    Median-unbiased, type 8Recommended by Hyndman and Fan917.678.67

    With an even n, the two median-split methods always agree. The differences shrink as n grows and rarely matter beyond about 100 values. For coursework, use the method your textbook or exam board specifies. For reports, name the software you used. The calculator always shows all five methods for your data.

    How to Find the IQR for Grouped Data

    When data come as a frequency table, the individual values are unknown, so quartiles are estimated by linear interpolation within the class that contains them (the method used in GCSE and A-level statistics):

    Qk = L + ((kN/4 − CF) / f) × h

    L is the lower boundary of the quartile class, N the total frequency, CF the cumulative frequency before that class, f the class frequency and h the class width.

    Example (the Grouped data tab default): delivery times for 40 orders in classes 0–10 (4), 10–20 (11), 20–30 (15), 30–40 (8) and 40–50 (2).

    • Q1 position = 40/4 = 10th value, in the 10–20 class (CF before = 4): Q1 = 10 + (10 − 4)/11 × 10 = 15.45.
    • Q3 position = 3 × 40/4 = 30th value, in the 20–30 class (CF before = 15): Q3 = 20 + (30 − 15)/15 × 10 = 30.00.
    • IQR = 30.00 − 15.45 = 14.55 minutes.

    The calculator also draws the cumulative frequency curve (ogive) with Q1, the median and Q3 marked, which is the graphical method many exams ask for.

    How to Report the Median and IQR

    When data are skewed, report the median with the IQR instead of the mean ± SD. Two accepted styles are common:

    • As the interval: median wait was 12 min (IQR 9–18).
    • As the width: Mdn = 12, IQR = 9.

    Clinical and health journals usually prefer the interval form, because the reader sees both quartiles. Always state how outliers were handled and which quartile method or software you used.

    Common IQR Mistakes

    • Forgetting to sort. Quartiles of unsorted data are meaningless.
    • Reporting Q1 and Q3 but calling it “the IQR”. The IQR is one number (the difference), though the 9–18 interval form is acceptable when labeled.
    • Mixing quartile methods. A TI-84 answer and an Excel QUARTILE.INC answer can differ for the same data. Neither is wrong, but they are not interchangeable.
    • Automatically deleting flagged points. An outlier can be the most important observation in the dataset.
    • Pairing the IQR with the mean. The natural partner of the IQR is the median, and the SD’s is the mean.
    • Using class midpoints for grouped quartiles. Interpolate within the class instead.

    Frequently Asked Questions

    Sort the data, find the first quartile Q1 (the median of the lower half) and the third quartile Q3 (the median of the upper half), then subtract: IQR = Q3 − Q1. For example, if Q1 is 9 and Q3 is 18, the IQR is 9.

    The IQR tells you how spread out the middle half of your data is. A small IQR means typical values are close together, and a large IQR means they vary widely. Because it ignores the top and bottom quarters, it describes typical spread without being distorted by extreme values.

    Compute the lower fence Q1 − 1.5 × IQR and the upper fence Q3 + 1.5 × IQR. Any value below the lower fence or above the upper fence is a potential outlier. Values beyond Q1 − 3 × IQR or Q3 + 3 × IQR are extreme outliers.

    Tukey chose 1.5 as a practical balance. For normally distributed data, the 1.5 × IQR fences fall at about 2.7 standard deviations from the mean, so only about 0.7 percent of ordinary observations are flagged. A multiplier of 3 marks only extreme values, and Hoaglin and Iglewicz suggested 2.2 to reduce false alarms.

    There are several valid quartile definitions. The TI-84 and most US textbooks exclude the median when splitting the data. Excel QUARTILE.INC, Google Sheets and R interpolate linearly, and Excel QUARTILE.EXC, SPSS and Minitab use another interpolation rule. This calculator shows the IQR under all five common methods, so you can match your source.

    No. The range is the maximum minus the minimum and covers all of the data. The IQR is Q3 minus Q1 and covers only the middle 50 percent. One extreme value can change the range dramatically but usually leaves the IQR untouched.

    The IQR can never be negative, because Q3 is always at least as large as Q1. It can be zero when at least half of the values are identical, for example in heavily rounded or count data. In that case, every value different from the common one may be flagged as an outlier.

    Use the IQR, paired with the median, when data are skewed, contain outliers or are ordinal, such as incomes, waiting times, lab values or Likert ratings. Use the standard deviation, paired with the mean, for roughly symmetric data and when you plan parametric tests such as a t-test.

    Find the positions N/4 and 3N/4, locate the classes containing them from the cumulative frequencies, and interpolate within each class with Q = L + ((position − CF) / f) × h. Then subtract Q1 from Q3. The Grouped data tab shows this working and the cumulative frequency curve.

    The semi-interquartile range, or quartile deviation, is half the IQR: (Q3 − Q1) / 2. For a symmetric distribution, it is roughly the distance from the median to either quartile.

    For approximately normal data, divide the IQR by 1.349, because the IQR of a normal distribution equals 1.349 standard deviations. This robust estimate is often used in meta-analysis when studies report a median and IQR but no SD.

    You need at least four values to split the data meaningfully into quartiles. With small samples, the IQR is unstable and depends heavily on the quartile method, so treat it as a rough description and state the sample size.

    Methodology and Sources

    How the numbers are computed. The exclusive and inclusive methods take the median of each half, excluding or including the overall median when n is odd. Types 6, 7 and 8 use Hyndman and Fan’s interpolation formulas, with position h = (n + 1)p, (n − 1)p + 1 and (n + ⅓)p + ⅓ respectively. Fences are Q1 − k·IQR and Q3 + k·IQR, with k chosen by you, and outer fences are fixed at k = 3. Whiskers end at the most extreme values inside the inner fences. The robust SD is IQR / 1.349, and the scaled MAD is 1.4826 × the median absolute deviation. Grouped quartiles use linear interpolation within the class containing position kN/4. Before release, types 6, 7 and 8 were cross-checked against NumPy 2.5.3 percentile methods (weibull, linear and median_unbiased), agreeing to 14 decimal places. The median-split methods reproduce the widely used 11-value textbook example (6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49): Q1 = 15 and Q3 = 43 with the exclusive method, and 25.5 and 42.5 with the inclusive method.

    References

    1. Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley.
    2. Hyndman, R. J., and Fan, Y. (1996). Sample quantiles in statistical packages. The American Statistician, 50(4), 361–365. doi:10.1080/00031305.1996.10473566
    3. Hoaglin, D. C., Iglewicz, B., and Tukey, J. W. (1986). Performance of some resistant rules for outlier labeling. Journal of the American Statistical Association, 81(396), 991–999. doi:10.1080/01621459.1986.10478363
    4. Hoaglin, D. C., and Iglewicz, B. (1987). Fine-tuning some resistant rules for outlier labeling. Journal of the American Statistical Association, 82(400), 1147–1149. doi:10.1080/01621459.1987.10478551
    5. Rousseeuw, P. J., and Croux, C. (1993). Alternatives to the median absolute deviation. Journal of the American Statistical Association, 88(424), 1273–1283. doi:10.1080/01621459.1993.10476408
    6. Moore, D. S., McCabe, G. P., and Craig, B. A. Introduction to the Practice of Statistics. W. H. Freeman.
    7. Penn State Eberly College of Science. STAT 200, Lesson 3.2: Identifying Outliers, IQR Method. online.stat.psu.edu

    Disclaimer: This calculator is an educational and analytical aid. Verify results used in published research, clinical decisions or regulatory submissions with validated statistical software, and consult a qualified statistician where needed.

    Manzoor Ahmad, author of DexoCalc

    Manzoor Ahmad

    Founder of DexoCalc · 13+ years in web development and SEO

    Manzoor builds and personally reviews every DexoCalc calculator. Pharmacy and health data, from wait times to lab values, are rarely symmetric, and a single unusual case can distort an average. That is why this tool puts the median, IQR and an honest outlier check first, and shows how each quartile convention changes the answer. All formulas are cross-checked against reference statistical software before release.

    Read Manzoor’s story