IQR Calculator
Find the interquartile range (IQR = Q3 − Q1), the quartiles and the 1.5×IQR outlier fences for any list of numbers. Paste your data and the results update instantly.
How to Use
- Enter your data: type or paste the numbers into the box, separated by commas, spaces or new lines. Use a dot for decimals (3.5, not 3,5).
- Provide at least four numbers: the order doesn't matter, because the calculator sorts the values for you. Anything that isn't a number is ignored and counted in the note under the box.
- Read the results: the IQR appears at the top, with Q1, the median, Q3, the outlier fences, any outliers, min, max, range and count below it.
- Check which quartile method your course or software expects. This calculator uses linear interpolation, and other methods can give a slightly different IQR for the same data (see the method section below).
What You'll Discover
- IQR — the spread of the middle 50% of your data, Q3 − Q1, in the same units as your data.
- Q1, median (Q2) and Q3 — the three quartiles that split the sorted data into four parts with roughly equal numbers of values.
- Lower and upper fences — Q1 − 1.5×IQR and Q3 + 1.5×IQR, the cut-offs used by the standard outlier rule and by most box plots.
- Outliers — the values that fall outside those fences, listed for you (or “None”).
- Min, max, range and count — the context you need to read the IQR and to compare it with the full range.
The calculator needs at least four values. With fewer, it shows a dash and tells you how many numbers it found.
What Is the Interquartile Range?
The interquartile range (IQR) is the distance between the third quartile (Q3) and the first quartile (Q1). It describes how spread out the middle half of a dataset is.
IQR = Q3 − Q1
Quartiles cut sorted data into four parts. Q1 is the value with about 25% of the data at or below it, Q2 is the median (the 50% point), and Q3 has about 75% at or below it. Subtracting Q1 from Q3 leaves the width of the box in a box plot. Half of all the values lie in that stretch.
Because the IQR ignores the lowest quarter and the highest quarter of the data, a single extreme value can't drag it around. That makes it a resistant (robust) measure of spread, and the usual companion to the median for skewed data such as incomes, house prices, waiting times or response times. The IQR is never negative, since Q3 can't be smaller than Q1, and it is measured in the same units as the data.
Reading the number
There is no universal “good” or “bad” IQR. It only means something relative to the scale of your data: an IQR of 5 is tiny for annual salaries in dollars and large for exam marks out of 20. A small IQR means the middle half of the values are tightly packed; a large IQR means they are spread widely. Compare IQRs between groups measured in the same units to see which is more variable.
Which Quartile Method Does This Calculator Use?
There is more than one accepted way to compute quartiles, so the IQR you get can differ slightly between textbooks, spreadsheets and websites. This calculator uses linear interpolation between the closest ranks (the inclusive method):
- Sort the n values from smallest to largest.
- The p-th quartile sits at position p × (n − 1) counting from zero (p = 0.25 for Q1, 0.5 for the median, 0.75 for Q3).
- If that position isn't a whole number, take the value at the whole-number position below it and move the fractional share of the way toward the next value.
This is the same method as Excel's QUARTILE.INC, NumPy's default percentile calculation and R's default quantile type. A common textbook alternative, the median of halves, splits the sorted data at the median and takes the median of each half. Excel's QUARTILE.EXC is a third variant. For the numbers 1 to 10, the methods give:
| Method (data 1–10) | Q1 | Q3 | IQR |
|---|---|---|---|
| Linear interpolation, inclusive (this calculator, Excel QUARTILE.INC) | 3.25 | 7.75 | 4.5 |
| Median of halves (common textbook method) | 3 | 8 | 5 |
| Exclusive (Excel QUARTILE.EXC) | 2.75 | 8.25 | 5.5 |
With an odd number of values the picture changes slightly. For the numbers 1 to 5, this calculator gives Q1 = 2, Q3 = 4 and IQR = 2, which matches the median-of-halves variant that keeps the median in both halves. The variant that drops the median from both halves gives Q1 = 1.5, Q3 = 4.5 and IQR = 3. With an even number of values, the median-of-halves result typically differs from this calculator's.
If your teacher, exam board or software specifies a method, follow it and check your answer against that method. Neither is “wrong”; they are different definitions, and the gap shrinks as the dataset grows.
The 1.5 × IQR Rule for Outliers
The IQR is also the basis of the most widely taught outlier rule, often called Tukey's fences. Compute two cut-offs:
Lower fence = Q1 − 1.5 × IQR
Upper fence = Q3 + 1.5 × IQR
Any value below the lower fence or above the upper fence is flagged as a potential outlier. Box plots use the same fences: the whiskers usually stretch to the most extreme values that are still inside them, and points beyond are drawn individually. Some textbooks go further and call values beyond 3 × IQR from the quartiles “extreme” outliers. This calculator reports the 1.5 × IQR fences only, but you can compute the 3 × IQR limits by hand from its Q1, Q3 and IQR.
For a normal (bell-shaped) distribution, the IQR is about 1.349 standard deviations, and roughly 0.7% of values land outside the 1.5 × IQR fences. So on large, well-behaved data you'd expect only the occasional flag. On small samples, a flagged point is a prompt to look closer rather than proof.
A flag is not a verdict
A value outside the fences might be a typing mistake, a faulty sensor reading, a different population mixed in, or a perfectly genuine extreme result. Check the source before deleting anything. Removing real observations because a rule flagged them can distort your conclusions. Also note that when the IQR is 0, both fences collapse onto Q1 and Q3, so any value that differs from them is flagged.
Worked Examples
Example 1 — The numbers 1 to 10
Data: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 (n = 10).
- Q1 position = 0.25 × 9 = 2.25 (from zero), so it lies a quarter of the way from the 3rd value (3) to the 4th value (4): Q1 = 3.25
- Median = 5.5
- Q3 position = 0.75 × 9 = 6.75, so three quarters of the way from 7 to 8: Q3 = 7.75
- IQR = 7.75 − 3.25 = 4.5
- Fences: 3.25 − 1.5 × 4.5 = −3.5 and 7.75 + 6.75 = 14.5, so there are no outliers
Example 2 — Exam scores with one extreme value
Data: 12, 15, 18, 20, 22, 25, 27, 30, 95 (n = 9).
- Q1 = 18, median = 22, Q3 = 27
- IQR = 27 − 18 = 9
- Fences: 18 − 13.5 = 4.5 and 27 + 13.5 = 40.5
- 95 is above 40.5, so it is flagged as an outlier. No other value is outside the fences.
Example 3 — Eight made-up annual salaries
Data: 47000, 48000, 51000, 52000, 55000, 58000, 61000, 250000 (n = 8).
- Q1 = 48,000 + 0.75 × (51,000 − 48,000) = 50,250
- Median = 53,500
- Q3 = 58,000 + 0.25 × (61,000 − 58,000) = 58,750
- IQR = 58,750 − 50,250 = 8,500
- Fences: 37,500 and 71,500, so 250,000 is flagged as an outlier
IQR vs Range vs Standard Deviation
All three describe spread, but they react very differently to extreme values. Take the exam scores from Example 2, then replace the 95 with 35 and compare:
| Measure | With 95 | With 35 instead | Affected by the change? |
|---|---|---|---|
| Range (max − min) | 83 | 23 | Yes, completely driven by the extremes |
| Sample standard deviation | 25.28 | 7.35 | Yes, strongly, because it uses every value |
| IQR | 9 | 9 | No, the middle half is unchanged |
The IQR stays at 9 while the range and the standard deviation swing wildly. That's the point of the IQR: it describes the typical spread without being hijacked by one unusual value.
Which should you use? Pair the IQR with the median when the data are skewed or contain outliers. Pair the standard deviation with the mean when the data are roughly symmetric and you want a measure that uses every observation; try the standard deviation calculator or the variance calculator for that. For the median and other averages, use the mean, median and mode calculator.
What Is the IQR If...
What is the IQR if my data are the numbers 1 to 10?
For the numbers 1 to 10, this calculator gives an IQR of 4.5. Q1 is 3.25 and Q3 is 7.75, so 7.75 − 3.25 = 4.5. A median-of-halves textbook method would give 5 (Q1 = 3, Q3 = 8), because the methods place the quartiles slightly differently.
What is the IQR if my data contain an outlier?
An outlier barely changes the IQR, which is why the IQR is called a resistant measure. In 12, 15, 18, 20, 22, 25, 27, 30, 95 the IQR is 9 while the range is 83. The 95 is flagged as an outlier because it exceeds the upper fence of 40.5.
What is the IQR if I have an odd number of values?
For 1, 2, 3, 4, 5 this calculator gives Q1 = 2, Q3 = 4 and an IQR of 2. The calculator doesn't drop the median when it has an odd count. A textbook that removes the median from both halves would get Q1 = 1.5, Q3 = 4.5 and IQR = 3, so check which convention you are meant to use.
What is the IQR if I have an even number of values?
For 1, 2, 3, 4 this calculator gives an IQR of 1.5. Q1 = 1.75 and Q3 = 3.25. The median-of-halves method splits the data into {1, 2} and {3, 4} and returns Q1 = 1.5, Q3 = 3.5 and IQR = 2.
What is the IQR if all the values are the same?
If every value is identical, the IQR is 0. For 7, 7, 7, 7, Q1 = Q3 = 7, so there is no spread at all, and both fences equal 7.
What is the IQR if it is 0 but the values are not all the same?
An IQR of 0 only means the middle half of the values are identical, not the whole dataset. In 5, 5, 5, 5, 5, 5, 9 the quartiles are all 5, so the IQR is 0 and both fences are 5. The 9 lies above the upper fence, so it is flagged as an outlier. With a zero IQR, any value that differs from the quartiles is flagged, so interpret the flag with care.
What is the IQR if my data include negative numbers?
Negative values work normally; the IQR is still Q3 − Q1 and is never negative. For −8, −5, −3, −1, 0, 2, 4, 9 the calculator gives Q1 = −3.5, Q3 = 2.5 and an IQR of 6.
What is the IQR if my data have decimals?
Decimals are fine: use a dot as the decimal separator. For 3.5, 4.2, 5.1, 5.8, 6.4, 7.0, 7.7, 8.3 the calculator gives Q1 = 4.875, Q3 = 7.175 and an IQR of 2.3. Results are shown with up to six decimal places, with trailing zeros removed.
What is the IQR if I enter the numbers out of order?
The order you type the numbers in doesn't matter, because the calculator sorts them first. Entering 9, 1, 5, 3, 7, 2, 8, 4, 6, 10 gives exactly the same IQR as 1 to 10: 4.5.
What is the IQR if I add an extreme value to the numbers 1 to 10?
Adding 100 to the numbers 1 to 10 raises the IQR only from 4.5 to 5, while the range jumps from 9 to 99. Q1 moves to 3.5 and Q3 to 8.5. The new value is far above the upper fence of 16, so it is flagged as an outlier.
People Also Search For
How to calculate the IQR by hand
Sort the data, find Q1 and Q3, then subtract Q1 from Q3. For this calculator's method, Q1 sits at position 1 + 0.25 × (n − 1) counting from 1, and Q3 at 1 + 0.75 × (n − 1). With 10 values those are positions 3.25 and 7.75, so interpolate between the neighbouring values. Many courses use the median-of-halves method instead, so follow your own course's rule when you work by hand.
How to calculate the IQR in Excel or Python
In Excel, use =QUARTILE.INC(range, 3) − QUARTILE.INC(range, 1), which matches this calculator. In Python, numpy.percentile(data, 75) − numpy.percentile(data, 25) gives the same result with NumPy's default settings. For the numbers 1 to 10 both return 4.5. Excel's QUARTILE.EXC gives 5.5 instead, since it's the exclusive variant.
How to find outliers using the IQR
Multiply the IQR by 1.5, subtract it from Q1 and add it to Q3; anything outside those two fences is a potential outlier. This calculator does that for you and lists the flagged values in the Outliers row. For 12, 15, 18, 20, 22, 25, 27, 30, 95, the fences are 4.5 and 40.5, and 95 is flagged.
IQR vs standard deviation: which is better?
Neither is universally better: use the IQR for skewed data or data with outliers, and the standard deviation for roughly symmetric data. The IQR ignores the top and bottom quarters, so it resists extreme values. The standard deviation uses every value, so it is sensitive to them. For a normal distribution, the IQR is about 1.349 times the standard deviation.
What does a large or small IQR mean?
A small IQR means the middle 50% of values are close together, and a large IQR means they are spread out. Judge it against the scale of your data and against other groups measured in the same units. An IQR of 0 means Q1 and Q3 are equal, so the middle of the data is all the same value.
How is the IQR shown on a box plot?
The IQR is the length of the box itself, from Q1 to Q3, with the median drawn as a line inside it. In the common convention, whiskers extend to the most extreme values within the 1.5 × IQR fences and any points beyond them are plotted as separate dots. The Q1, median and Q3 from this calculator, plus the min and max, are what you need to draw one by hand.
Frequently Asked Questions
What does the IQR tell you?
The IQR tells you how spread out the middle 50% of your data is. A small IQR means the central values are tightly clustered, and a large IQR means they are widely dispersed. Unlike the full range, it isn't affected by extreme values at either end.
Which quartile method does this calculator use?
It uses linear interpolation between the closest ranks, the inclusive method. The quartile position is p × (n − 1) counting from zero, and the result is interpolated between the two neighbouring sorted values. This matches Excel's QUARTILE.INC and NumPy's default percentile calculation.
Why does my textbook or another tool give a different IQR?
Quartiles have several accepted definitions. The common textbook median-of-halves method and Excel's QUARTILE.EXC place Q1 and Q3 slightly differently, and for the numbers 1 to 10 they give IQRs of 5 and 5.5, versus 4.5 here. The differences are usually small and shrink on larger datasets. Use the method your course or software specifies.
What is the 1.5 × IQR rule?
It flags values that are more than 1.5 × IQR below Q1 or above Q3 as potential outliers. The cut-offs are called the lower and upper fences, and they are the same ones used for the whiskers in most box plots. A flagged value deserves a closer look, not automatic deletion.
Can the IQR be negative?
No. Q3 is never smaller than Q1, so the IQR is zero or positive. Negative numbers in your data are fine, but the IQR itself is a distance and can't be below zero.
Can the IQR be zero?
Yes. If Q1 and Q3 are equal, the IQR is 0. That happens when at least the middle half of the values are identical, as in 5, 5, 5, 5, 5, 5, 9. It doesn't mean every value is the same.
How many numbers do I need?
This calculator needs at least four values. With fewer than four, it shows dashes and tells you how many numbers it found. Quartiles from very small samples are not very informative, so the IQR is most useful on larger datasets.
How should I enter my data?
Separate the numbers with commas, spaces, semicolons or new lines, so you can paste a column straight from a spreadsheet. Use a dot as the decimal separator. Entries that aren't numbers are ignored, and the note under the box says how many were skipped. Thousands separators such as 1,000 would be read as two numbers, so leave them out.
Does the order of the numbers matter?
No. The calculator sorts the values before finding the quartiles, so you can enter them in any order. Repeated values are all counted.
Is the IQR affected by outliers?
Very little. The IQR depends only on Q1 and Q3, so a few extreme values at either end barely move it, though adding many of them can shift the quartiles. That's why it's called a resistant measure, and why it's paired with the median for skewed data.
What is the difference between the IQR and the range?
The range is max − min, so it is set by the two most extreme values. The IQR is Q3 − Q1 and covers only the middle 50% of the data. In 12, 15, 18, 20, 22, 25, 27, 30, 95 the range is 83 and the IQR is 9.
Is there a sample and a population IQR?
Not in the way there is for variance and standard deviation. This calculator takes every value you enter and applies one quartile method, with no n versus n − 1 correction. The different results you may see elsewhere come from different quartile methods, not from sample versus population.
What units is the IQR in?
The same units as your data. If you enter heights in centimetres, the IQR and the quartiles are in centimetres too. The count (n) is a plain number.
Is my data stored or sent anywhere?
No. All calculations run in your browser. Nothing you type is sent to a server or saved, and no account is needed.
Last reviewed: November 2026 — formulas and worked examples verified.