Skip to main content
Math

Interquartile Range Calculator: Q1, Q3, IQR, and Outliers

Paste your numbers and this tool sorts them, then reports Q1, the median, Q3, the interquartile range (IQR = Q3 - Q1), and the 1.5 x IQR outlier fences. The one choice that changes the answer is the quartile method, and it is visible: the default is the exclusive median-of-halves method - the common US classroom rule, matching the quartiles from a TI-83/84 and from Moore & McCabe's textbook. Switch to Tukey's hinges (include center) or the interpolated R/Excel type-7 method when your class, spreadsheet, or statistics package expects one of those instead.

Primary output 3.5

Paste at least four numbers. The default matches many classroom IQR examples; switch methods if your textbook or software uses inclusive or interpolated quartiles.

Paste numbers from homework, a spreadsheet column, or a small sample. Fractions like 3/4 are accepted.
IQR answers can differ by method. Use the method your class, spreadsheet, or statistics package expects.
IQR 3.5
Q1 3.5
Median 6
Q3 7
Show calculation details
1.5 x IQR fences -1.75 to 12.25
Outliers None by 1.5 x IQR
Sorted data 2, 3, 4, 5, 6, 7, 7, 7, 9
Method Median of halves (exclude center)
Values used 9 values

From a list of numbers to quartiles, IQR, and outliers

Sort the numbers, find the first and third quartiles, and the interquartile range is just IQR = Q3 - Q1; the 1.5 x IQR fences then screen for outliers. The catch is that Q1 and Q3 have more than one accepted definition, so the method you pick changes the answer. This tool defaults to the exclusive median-of-halves method (the common US classroom rule, matching a TI-83/84 and Moore & McCabe). For the sample 4, 7, 7, 3, 5, 2, 6, 7, 9 that default sorts to 2, 3, 4, 5, 6, 7, 7, 7, 9 and returns Q1 = 3.5, median = 6, Q3 = 7, so IQR = 3.5, with an upper fence of 12.25 and no outliers flagged. The sections below show how the three methods differ, how the fences work, and when to prefer IQR over the standard deviation.

Pick the method first

The three methods give different Q1/Q3 values on the same data. The default is exclusive median-of-halves (TI-84 / Moore & McCabe); switch to Tukey hinges or type 7 before comparing with another tool.

Read the sorted list

The result echoes your data sorted. If a value looks missing, duplicated, or wrong-signed, fix the input before trusting the quartiles.

At least four values

The tool needs four or more numbers to split into halves and build fences.

Fences flag, they don't delete

A value past a 1.5 x IQR fence is listed for review, never removed from your data.

Example: the same data, three methods

Method choice is not a rounding difference - it is a different definition of Q1 and Q3. Here are two data sets run through all three methods in this tool:

Data setMethodQ1Q3IQR
1, 2, 3, 4, 5, 6, 7, 8 (even n)Exclusive median-of-halves (default)2.56.54
1, 2, 3, 4, 5, 6, 7, 8 (even n)Tukey hinges (include center)2.56.54
1, 2, 3, 4, 5, 6, 7, 8 (even n)Interpolated type 7 (R / Excel)2.756.253.5
1, 2, 3, 4, 5 (odd n)Exclusive median-of-halves (default)1.54.53
1, 2, 3, 4, 5 (odd n)Tukey hinges (include center)242
1, 2, 3, 4, 5 (odd n)Interpolated type 7 (R / Excel)242

Two patterns worth remembering: for an even-length data set the two median-of-halves methods always agree (there is no middle value to include or exclude), so only the interpolated method stands apart; for an odd-length set the exclusive default drops the middle value while the hinges keep it, so all three can differ. None of these is a bug - they are different, equally valid conventions.

Which quartile method should I use, and why do calculators disagree?

This tool exposes three definitions of Q1 and Q3 instead of hiding one. The exclusive median-of-halves method (the default) sorts the data, finds the median, splits the values into a lower and an upper half, and for an odd count leaves the median out of both halves; Q1 and Q3 are the medians of those halves. This is the method most US intro-statistics courses teach, and it matches the TI-83/84 1-Var Stats output and Moore & McCabe's textbook Introduction to the Practice of Statistics. Tukey's hinges use the same half-split but keep an odd-count median in both halves, following Tukey's Exploratory Data Analysis (1977); several textbooks and packages use it. The interpolated type 7 method skips the half-split entirely: Q1 and Q3 come from linear interpolation at the 25th and 75th percentiles using the rank h = 1 + (n - 1)p, which is R's default quantile and Excel's QUARTILE.INC / PERCENTILE.INC. Because popular calculators pick different defaults, two of them can report different IQRs for the same numbers and both be correct. The fix is not to argue about which is right - it is to choose the method your assignment, report, or software uses, then confirm the sorted data and quartiles this tool shows.

How do the 1.5 x IQR outlier fences work?

Once Q1 and Q3 are set, the tool builds two screening boundaries: a lower fence at Q1 - 1.5 x IQR and an upper fence at Q3 + 1.5 x IQR. The NIST/SEMATECH e-Handbook calls these the inner fences and flags any point beyond them as a mild outlier; the 1.5 multiplier traces back to Tukey's box-plot work. Take 10, 12, 13, 14, 15, 16, 17, 18, 100 on the default method: Q1 = 12.5 and Q3 = 17.5, so IQR = 5 and the fences sit at 12.5 - 7.5 = 5 and 17.5 + 7.5 = 25. The value 100 is past the upper fence, so the tool lists it as a possible outlier - and stops there. Following NIST, a flagged point is something to investigate (a typo, a rare event, or a real value from a skewed distribution), not something to auto-delete. This tool ships the 1.5 x IQR inner fence only, not the wider 3 x IQR outer fence some texts use to separate mild from extreme outliers.

When is IQR better than the standard deviation?

IQR measures the spread of the middle 50% of the data, from Q1 to Q3, so a single extreme value barely moves it. The standard deviation squares every deviation from the mean, so one large outlier can inflate it sharply. That makes IQR the better spread summary when your data are skewed or contain outliers - incomes, house prices, response times, or scores with a few very high or very low values. It is also the engine behind the box plot: the box spans Q1 to Q3, the line inside is the median, and the whiskers usually stop at the 1.5 x IQR fences. Reach for the standard deviation instead when the data are roughly symmetric and you need a measure that feeds into means, z-scores, or normal-distribution work. A quick tell: when the mean and median are far apart the distribution is skewed, and IQR will describe the spread more honestly than the standard deviation.

Before you trust the answer

A few habits keep the result honest. First, read the sorted data the tool echoes back - a mistyped or missing value shifts the quartiles silently. Second, confirm the method matches your source before comparing numbers; a homework key usually wants the exclusive default, while a spreadsheet wants type 7. Third, keep genuine duplicate values - they are real data and belong in the quartile calculation unless they are entry errors. Remember the tool needs at least four numbers, works on a raw list rather than grouped frequency tables or class intervals, and uses the 1.5 x IQR inner fence only. For anything you will report or grade, match the exact convention your teacher, publisher, or software requires rather than assuming every calculator agrees.

References

  1. NIST/SEMATECH e-Handbook of Statistical Methods, 7.1.6 - What are outliers in the data?

    NIST/SEMATECH e-Handbook · accessed 2026-07-04

  2. NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.17 - Detection of Outliers

    NIST/SEMATECH e-Handbook · accessed 2026-07-04

  3. Hyndman, R.J. & Fan, Y. (1996). Sample Quantiles in Statistical Packages. The American Statistician 50(4):361-365

    The American Statistician · accessed 2026-07-04

  4. R stats manual - quantile()

    R Core Team · accessed 2026-07-04

Frequently asked questions

How do you calculate the interquartile range?
Sort the data, find Q1 and Q3 with the required quartile method, then subtract: IQR = Q3 - Q1. This calculator shows the sorted data and the method used so you can verify the steps.
How do you find Q1 and Q3?
In the default classroom method, Q1 is the median of the lower half and Q3 is the median of the upper half. If the data count is odd, the default excludes the overall median from those halves; the inclusive method includes it.
Why does my spreadsheet give a different IQR?
Spreadsheet and statistics software often use interpolated percentiles instead of a hand-split median-of-halves method. Switch this calculator to the interpolated percentile method when you need to compare with that style of output.
Can I use IQR to find outliers?
Yes, as a screening rule. Compute Q1 and Q3, find IQR, then use fences at Q1 - 1.5 x IQR and Q3 + 1.5 x IQR. Values outside those fences are possible outliers that should be reviewed, not automatically deleted.