ToolNimba Browse

📊 Interquartile Range (IQR) Calculator

By ToolNimba Editorial Team · Updated 2026-06-19

Q1 (25th pct)
-
Q2 (median)
-
Q3 (75th pct)
-
IQR (Q3 - Q1)
-
Count (n)
-
Lower fence
-
Upper fence
-
Range
-
Sorted data
-

Uses Tukey's method: for an odd count the median is not included in either half. Outliers fall below Q1 - 1.5 x IQR or above Q3 + 1.5 x IQR.

The interquartile range (IQR) measures the spread of the middle 50% of a data set, the gap between the first quartile (Q1) and the third quartile (Q3). Paste or type your numbers, separated by commas, spaces, or new lines, and this calculator sorts them, reports Q1, Q2 (the median), Q3 and the IQR, and flags any outliers using the standard 1.5 x IQR rule. It uses Tukey method quartiles so the result matches what most statistics courses and box plots expect.

What is the Interquartile Range Calculator?

Quartiles split an ordered data set into four equal parts. The second quartile (Q2) is simply the median, the middle value that separates the lower half from the upper half. The first quartile (Q1) is the median of the lower half, and the third quartile (Q3) is the median of the upper half. The interquartile range is then IQR = Q3 - Q1, the distance that spans the central 50% of your values. Because it ignores the smallest and largest quarter of the data, the IQR is a robust measure of spread: a single extreme value barely moves it, unlike the full range or the standard deviation.

There are several accepted ways to pick the quartile positions, and different software can give slightly different numbers for the same data. This tool uses Tukey method (also called the exclusive method): the data is sorted, the median is found, and for an odd number of values the median itself is left out of both halves before Q1 and Q3 are taken as the medians of those halves. This is the convention behind the classic box-and-whisker plot and the 1.5 x IQR outlier test, which is why it pairs naturally with outlier detection here.

The 1.5 x IQR rule sets two fences. The lower fence is Q1 - 1.5 x IQR and the upper fence is Q3 + 1.5 x IQR. Any value below the lower fence or above the upper fence is treated as a potential outlier, a point far enough from the central cluster to deserve a second look. Flagging a value as an outlier does not prove it is an error, it may be a genuine but unusual observation, but it tells you which points to investigate before you trust an average or fit a model.

When to use it

  • Finding Q1, Q3 and the IQR for a statistics assignment or to draw a box plot by hand.
  • Spotting outliers in a set of measurements, test scores, or prices before computing an average.
  • Comparing the spread of two data sets using a robust measure that is not thrown off by one extreme value.
  • Checking the numbers a spreadsheet or stats package returns, since different quartile methods can disagree.

How to use the Interquartile Range Calculator

  1. Enter your numbers, separated by commas, spaces, or new lines (at least four values).
  2. The tool sorts them and shows Q1, Q2 (median), Q3 and the IQR instantly.
  3. Read the lower and upper fences to see the 1.5 x IQR outlier boundaries.
  4. Check the outliers box for any values that fall outside those fences.

Formula & method

IQR = Q3 - Q1, where Q1 is the median of the lower half and Q3 is the median of the upper half of the sorted data. Outlier fences: lower = Q1 - 1.5 x IQR, upper = Q3 + 1.5 x IQR. Any value below the lower fence or above the upper fence is flagged as an outlier.

Worked examples

Find the quartiles and IQR of 3, 7, 8, 5, 12, 14, 21, 13, 18 (9 values, odd count).

  1. Sort the data: 3, 5, 7, 8, 12, 13, 14, 18, 21
  2. Median Q2 is the 5th value = 12
  3. Lower half (values before the median): 3, 5, 7, 8
  4. Q1 = median of lower half = (5 + 7) / 2 = 6
  5. Upper half (values after the median): 13, 14, 18, 21
  6. Q3 = median of upper half = (14 + 18) / 2 = 16
  7. IQR = Q3 - Q1 = 16 - 6 = 10
  8. Fences: lower = 6 - 1.5 x 10 = -9, upper = 16 + 1.5 x 10 = 31 (no outliers)

Result: Q1 = 6, Q2 = 12, Q3 = 16, IQR = 10, no outliers

Find the IQR and any outliers in 10, 12, 14, 15, 18, 21, 110 (7 values).

  1. Already sorted: 10, 12, 14, 15, 18, 21, 110
  2. Median Q2 is the 4th value = 15
  3. Lower half: 10, 12, 14, so Q1 = 12
  4. Upper half: 18, 21, 110, so Q3 = 21
  5. IQR = 21 - 12 = 9
  6. Lower fence = 12 - 1.5 x 9 = -1.5, upper fence = 21 + 1.5 x 9 = 34.5
  7. 110 is above 34.5, so it is flagged as an outlier

Result: Q1 = 12, Q2 = 15, Q3 = 21, IQR = 9, outlier: 110

The five-number summary and IQR for 3, 5, 7, 8, 12, 13, 14, 18, 21

StatisticValueWhat it means
Minimum3Smallest value in the set
Q1625% of values fall below this
Q2 (median)12Middle value, 50% fall below
Q31675% of values fall below this
Maximum21Largest value in the set
IQR10Spread of the middle 50% (Q3 - Q1)

Outlier fences from the 1.5 x IQR rule

BoundaryFormulaFlagged value
Lower fenceQ1 - 1.5 x IQRAny value below this is an outlier
Upper fenceQ3 + 1.5 x IQRAny value above this is an outlier
Within fencesbetween the two fencesTreated as a normal observation

Common mistakes to avoid

  • Forgetting to sort the data first. Quartiles only make sense on an ordered list. If you read off positions from an unsorted set you will get the wrong Q1 and Q3. This tool sorts for you, but if you work by hand, always sort first.
  • Mixing up quartile methods. Tukey (exclusive), the inclusive method, and interpolation methods can each give different Q1 and Q3 values for the same data, especially small sets. A mismatch with a spreadsheet usually means a different method, not a calculation error. This tool states it uses Tukey method.
  • Treating every flagged point as an error. The 1.5 x IQR rule highlights values worth checking, not proven mistakes. An outlier can be a real, important observation. Investigate the cause before deleting or keeping it.
  • Confusing IQR with the full range. The range is maximum minus minimum and swings with a single extreme value. The IQR covers only the middle 50%, so it is far more stable. Reporting one when you mean the other changes the story your data tells.

Glossary

Quartile
One of three cut points (Q1, Q2, Q3) that divide an ordered data set into four equal parts.
Q1 (first quartile)
The median of the lower half of the data. About 25% of values fall below it.
Q2 (median)
The middle value of the data set. Half the values fall below it and half above.
Q3 (third quartile)
The median of the upper half of the data. About 75% of values fall below it.
IQR
The interquartile range, Q3 - Q1, which measures the spread of the central 50% of the data.
Outlier
A value that falls below Q1 - 1.5 x IQR or above Q3 + 1.5 x IQR, far from the central cluster.

Frequently asked questions

What is the interquartile range?

The interquartile range (IQR) is the difference between the third quartile (Q3) and the first quartile (Q1), so IQR = Q3 - Q1. It measures the spread of the middle 50% of a data set and is a robust measure that is not distorted by a single extreme value.

How do you calculate Q1 and Q3?

Sort the data and find the median (Q2). Q1 is the median of the lower half and Q3 is the median of the upper half. This tool uses Tukey method, so for an odd number of values the median itself is left out of both halves before taking Q1 and Q3.

How does the 1.5 x IQR rule find outliers?

It builds two fences: a lower fence at Q1 - 1.5 x IQR and an upper fence at Q3 + 1.5 x IQR. Any value below the lower fence or above the upper fence is flagged as a potential outlier worth a closer look.

Why does my spreadsheet give a different IQR?

There are several accepted quartile methods. Excel QUARTILE.INC and some packages interpolate differently from Tukey method, so the same data can yield slightly different Q1 and Q3, and therefore a different IQR. This tool uses Tukey method, the convention behind box plots.

How many numbers do I need to enter?

You need at least four values so the data can be split into a lower and upper half for Q1 and Q3. The more values you have, the more meaningful the quartiles and outlier check become.

Should I always remove outliers?

No. A flagged outlier is a signal to investigate, not an instruction to delete. It may be a data-entry error, or it may be a genuine and important observation. Decide based on the context of your data, not the rule alone.