ToolNimba

๐Ÿ“Š Interquartile Range Calculator: Find Q1, Q3, Median and Outliers (IQR)

Shihab Mia By Shihab Mia ยท Updated 2026-08-01

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.

This interquartile range calculator 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 the 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, and it works instantly on any list length from a handful of exam scores to a full data set pasted from a spreadsheet.

What is the Interquartile Range Calculator?

Quartiles split an ordered data set into four equal parts, and an interquartile range calculator exists because that split is more useful than a single average when your data is skewed or contains extreme values. 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, which is one of the most common reasons people search for an interquartile range calculator in the first place after their spreadsheet disagrees with their textbook. 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. Excel and many statistics packages instead use an inclusive or linear-interpolation method (QUARTILE.INC, PERCENTILE, or one of several numbered algorithms in R and Minitab), which can shift Q1 and Q3 by a small amount on the same data set. Tukey method 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. Some analysts distinguish mild outliers (beyond 1.5 x IQR) from extreme outliers (beyond 3 x IQR), reserving the stronger label for points that are dramatically far from the rest of the data. 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.

An interquartile range calculator is useful well beyond the statistics classroom. Analysts use the IQR to screen sensor readings, lab results, survey responses, or transaction amounts for anomalies before running further tests, because a mean or standard deviation calculated on unscreened data can be badly distorted by one bad entry. Quality control teams use it to flag manufacturing measurements that fall outside an expected range. In finance, the IQR of daily returns gives a sense of typical volatility without letting one crash or spike dominate the picture the way a standard deviation would. Because the IQR only depends on the middle half of the data, it also gives a quick clue about skewness: if Q2 sits much closer to Q1 than to Q3 (or vice versa), the distribution is lopsided even before you look at a histogram.

The IQR is one part of the five-number summary, which lists the minimum, Q1, median, Q3, and maximum together. That summary is exactly what a box-and-whisker plot draws: the box spans Q1 to Q3 with a line at the median, and the whiskers typically extend to the most extreme values that are still inside the 1.5 x IQR fences, with anything beyond plotted as individual outlier points. A related but less common statistic is the semi-interquartile range, or quartile deviation, which is simply half the IQR (IQR / 2) and is sometimes used as a rough estimate of spread around the median in skewed data.

Choosing between the IQR and the standard deviation comes down to how much you trust your data and how it is shaped. The standard deviation uses every value and is the natural partner for the mean in a roughly symmetric, outlier-free data set, while the IQR uses only the middle half and is the safer choice when your data is skewed, has a small number of extreme values, or you simply want a spread measure that will not be thrown off by a data-entry mistake. Reporting both, alongside the median and the mean, gives a fuller and more honest picture than either statistic alone.

When to use it

  • Finding Q1, Q3 and the IQR for a statistics assignment or to draw a box plot by hand.
  • Using this interquartile range calculator to spot 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.
  • Screening sensor readings, survey responses, or lab results for anomalies before running further statistical tests.
  • Getting a quick five-number summary (minimum, Q1, median, Q3, maximum) to describe a data set in a report.

How to use the Interquartile Range Calculator

  1. Enter your numbers, separated by commas, spaces, or new lines (at least four values).
  2. This interquartile range calculator 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.
  5. Compare the IQR to the full range (maximum minus minimum) to see how much the extremes are inflating the spread.

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. Semi-interquartile range (quartile deviation) = IQR / 2.

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

Find the IQR for an even-numbered data set with a low outlier: -8, 2, 4, 5, 6, 7, 8, 9 (8 values).

  1. Already sorted: -8, 2, 4, 5, 6, 7, 8, 9
  2. Even count, so Q2 = average of the 4th and 5th values = (5 + 6) / 2 = 5.5
  3. Lower half: -8, 2, 4, 5, so Q1 = average of 2 and 4 = 3
  4. Upper half: 6, 7, 8, 9, so Q3 = average of 7 and 8 = 7.5
  5. IQR = 7.5 - 3 = 4.5
  6. Lower fence = 3 - 1.5 x 4.5 = -3.75, upper fence = 7.5 + 1.5 x 4.5 = 14.25
  7. -8 is below -3.75, so it is flagged as an outlier

Result: Q1 = 3, Q2 = 5.5, Q3 = 7.5, IQR = 4.5, outlier: -8

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
Beyond 3 x IQRQ1 - 3 x IQR or Q3 + 3 x IQRSometimes labeled an extreme outlier

Common quartile calculation methods and how they differ

MethodAlso calledHow Q1 and Q3 are found
Tukey methodExclusive methodMedian excluded from both halves before splitting; used by this calculator and most box plots
Excel QUARTILE.INCInclusive methodMedian included in both halves; interpolates between ranked values
Excel QUARTILE.EXCExclusive percentile methodExcludes the endpoints; can differ from Tukey on small data sets
Linear interpolationPercentile methods (R types 6 to 9)Interpolates between two data points based on rank position, used in many stats packages

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.
  • Confusing the IQR with the semi-interquartile range. The semi-interquartile range (quartile deviation) is half the IQR, IQR / 2. Some textbooks and older references use it instead of the full IQR, so check which one a question or dataset is asking for before comparing numbers.
  • Trying to compute quartiles on too few values. With fewer than four data points there is no meaningful lower and upper half to take medians of. Small data sets can also make the quartile method you use (Tukey vs inclusive) matter much more than it would on a large sample.

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.
Five-number summary
The minimum, Q1, median, Q3 and maximum of a data set, the values used to draw a box plot.
Box plot (box-and-whisker plot)
A chart that shows the five-number summary as a box from Q1 to Q3 with a median line, and whiskers reaching to the most extreme non-outlier values.

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. This interquartile range calculator 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.

What is the difference between the IQR and the standard deviation?

The standard deviation uses every value in the data set and reacts strongly to extreme values, while the IQR only uses the middle 50% and barely moves when one value is unusually high or low. Use the IQR when your data is skewed or may contain errors, and the standard deviation for roughly symmetric, clean data.

Can the interquartile range be zero or negative?

The IQR can be zero if Q1 and Q3 are equal, which happens when at least half of the data shares the same value. It cannot be negative, because Q3 is always greater than or equal to Q1 by definition.

What is the semi-interquartile range?

The semi-interquartile range, also called the quartile deviation, is simply the IQR divided by two (IQR / 2). It is sometimes reported instead of the full IQR as a rough measure of spread around the median.

How is the IQR used in a box plot?

A box plot draws a box from Q1 to Q3 with a line at the median, so the box height is exactly the IQR. The whiskers then extend to the most extreme data points that are still within the 1.5 x IQR fences, and any values beyond those fences are plotted individually as outliers.