Quartile & IQR Calculator
Paste your data and get Q1, the median, Q3, the interquartile range and the five-number summary, with Tukey's fences, any outliers and a box plot drawn to scale. Pick the median-of-halves method your textbook or TI-84 uses, or match Excel's QUARTILE.INC or QUARTILE.EXC — the working shows exactly how each quartile was found.
0 values detected
Enter at least three numbers to see the quartiles.
How to Use the Quartile & IQR Calculator
- 1. Paste your data. Separate the numbers with commas, spaces or new lines. Order doesn't matter — the calculator sorts them — but you need at least three values.
- 2. Pick a quartile method. Median of halves is what most statistics courses and the TI-83/84 use. Choose Inclusive or Exclusive to match Excel's QUARTILE.INC or QUARTILE.EXC, R, SPSS or Minitab.
- 3. Read the five-number summary and the IQR. The box plot draws them to scale, and Tukey's fences flag any outliers.
- 4. Check the working. The sorted data, the halves or interpolation positions, and a comparison of all three methods show where every number came from.
What Quartiles and the IQR Tell You
Quartiles cut sorted data into four parts with roughly a quarter of the values in each. Q1, the first quartile, has about 25% of the data at or below it; Q2 is the median; Q3 has about 75% at or below it. Add the minimum and the maximum and you have the five-number summary — the five values a box plot draws.
The interquartile range, IQR = Q3 − Q1, is the spread of the middle half of the data. Unlike the range or the standard deviation it ignores the extremes, so one wild value barely moves it. That is why the median and IQR are the standard pair for describing skewed data — incomes, reaction times, length of hospital stay — where the mean and standard deviation would mislead.
Why Quartile Methods Give Different Answers
There is no single agreed definition of a quartile. With n values, Q1 usually falls between two data points, and conventions disagree about which position to use and how to interpolate. Hyndman and Fan (1996) catalogued nine methods; these three cover almost every course and program:
| Method | Rule | Used by |
|---|---|---|
| Median of halves | Median of each half; the median is left out when n is odd | TI-83/84, most textbooks |
| Inclusive (type 7) | Interpolate at position 1 + (n − 1) × p | Excel QUARTILE.INC, Google Sheets, R, NumPy |
| Exclusive (type 6) | Interpolate at position (n + 1) × p | Excel QUARTILE.EXC, SPSS, Minitab |
p = 0.25 for Q1 and 0.75 for Q3; positions count from 1 in the sorted list.
Take the example data — minutes of homework reported by 12 students, sorted: 12, 15, 17, 18, 20, 21, 23, 24, 26, 29, 31, 58. All three methods agree that the median is 22, the average of the 6th and 7th values. They disagree on the quartiles:
- Median of halves: the lower half is 12, 15, 17, 18, 20, 21, so Q1 = (17 + 18) ÷ 2 = 17.5; the upper half gives Q3 = (26 + 29) ÷ 2 = 27.5. IQR = 10.
- Inclusive: Q1 sits at position 1 + 11 × 0.25 = 3.75, three-quarters of the way from the 3rd value (17) to the 4th (18), so Q1 = 17.75. Q3 sits at position 9.25: 26 + 0.25 × (29 − 26) = 26.75. IQR = 9.
- Exclusive: Q1 sits at position 13 × 0.25 = 3.25, so Q1 = 17 + 0.25 × (18 − 17) = 17.25; Q3 at position 9.75 is 26 + 0.75 × 3 = 28.25. IQR = 11.
None of these is wrong — they are different definitions. The gap shrinks as n grows, but in a small classroom dataset it changes the answer, so use the method your course, textbook or software uses, and name it when you report quartiles. One more variant exists: Tukey's original hinges, which R's fivenum() reports, keep the median in both halves when n is odd, so they can differ from the TI-84 for odd n (never for even n).
Finding Outliers With Tukey's Fences
John Tukey's rule flags a value as a potential outlier when it lies more than 1.5 × IQR beyond the quartiles:
Lower fence
Q1 − 1.5 × IQR
Upper fence
Q3 + 1.5 × IQR
For the homework data with the median-of-halves method, the fences are 17.5 − 1.5 × 10 = 2.5 and 27.5 + 1.5 × 10 = 42.5, so the student who reported 58 minutes is flagged. The box plot's whiskers stop at the furthest values still inside the fences — 12 and 31 here — and the outlier is drawn as a separate point. Some texts also mark values beyond 3 × IQR as extreme outliers.
A flagged value is a prompt to check, not a verdict. It may be a typing error, or it may be the most interesting observation you have. Say what you did with it in your write-up rather than dropping it silently.
Frequently Asked Questions
- How do you find Q1 and Q3?
- Sort the data and find the median. With the median-of-halves method, Q1 is the median of the values below the median and Q3 is the median of the values above it; when n is odd, the median itself belongs to neither half. Spreadsheets and statistics packages instead locate Q1 at a position such as 1 + (n − 1) × 0.25 in the sorted list and interpolate between the two neighbouring values.
- Why does my calculator give a different Q1 than Excel?
- Because they use different definitions. The TI-83/84 and most textbooks use the median of halves, Excel's QUARTILE.INC (and the older QUARTILE) uses the inclusive type 7 method, and QUARTILE.EXC uses the exclusive type 6 method. Switch the method above to match the program you are checking against — the comparison table shows all three results for your data at once.
- What is the five-number summary?
- It is the minimum, Q1, the median, Q3 and the maximum. Those five values describe the centre, the spread of the middle half and the full extent of a dataset in one line, and they are exactly what a box plot draws.
- How do you find outliers with the IQR?
- Compute the fences Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Any value below the lower fence or above the upper fence is a potential outlier under Tukey's rule. The calculator lists them and draws them as separate points on the box plot.
- Is the median included when finding the quartiles?
- It depends on the method. The TI-84's median-of-halves method leaves the median out of both halves when n is odd, while Tukey's original hinges include it in both. The inclusive and exclusive methods never split the data at all — they interpolate at a position in the full sorted list.