Quartile Calculator
Enter six data values to compute Q1, Q2 (median), and Q3.
What this calculator does
Enter six values and the calculator returns Q1, Q2 (the median) and Q3 for the dataset. With the default inputs 4, 7, 2, 9, 5 and 12 it reports Q1 = 4, Q2 = 6 and Q3 = 9. Those three numbers tell you where the bottom quarter, the exact middle and the top quarter of your data sit, and they are the backbone of every box plot.
What quartiles are
Quartiles cut a sorted dataset into four parts that contain roughly equal numbers of observations. Q1 is the 25th percentile, Q2 is the 50th percentile (the median) and Q3 is the 75th percentile. Half of all values lie between Q1 and Q3, a span called the interquartile range, which is why analysts reach for quartiles instead of the minimum and maximum whenever a few extreme values would distort the picture.
Worked example: the default six values
Take the unordered defaults 4, 7, 2, 9, 5, 12 and run the median-of-halves method in three moves.
- Sort the values: 2, 4, 5, 7, 9, 12.
- Q2 is the average of the middle pair: (5 + 7) ÷ 2 = 6.
- Q1 is the median of the lower half 2, 4, 5, which is the middle value 4.
- Q3 is the median of the upper half 7, 9, 12, which is the middle value 9.
The interquartile range is Q3 − Q1 = 9 − 4 = 5. Values between 4 and 9 live in the middle 50% of the data; 2 and 12 sit in the outer quarters. Because the six values are sorted first, the order you type them in does not change the result at all.
Reading the results
The five-number summary is the quickest way to picture a dataset: minimum 2, Q1 4, median 6, Q3 9 and maximum 12. Notice how the median 6 sits exactly halfway between Q1 and Q3 here. When the median sits closer to Q3 than to Q1, the upper half of your data is more compressed than the lower half — a skew signal you would miss by staring at the mean alone.
The interquartile range
The IQR of 5 covers the values from 4 to 9, the middle 50% of the sample. Compare that with the full range of 12 − 2 = 10: half of that total spread comes from the outer quarters. If one exam score were miskeyed as 92 instead of 12, the range would explode to 90 while the IQR would not move at all, because 92 only shifts the maximum.
Outlier fences
The standard 1.5 × IQR rule builds fences at Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Here that is 4 − 7.5 = −3.5 on the low side and 9 + 7.5 = 16.5 on the high side. Every default value from 2 to 12 falls inside the fences, so this dataset has no outliers; a value of 20 or −10 would be flagged.
Why different tools give different quartiles
There is no single universal quartile definition, and software packages disagree on how to position Q1 and Q3 in small samples. This calculator uses the median-of-halves (Tukey) method. Excel’s QUARTILE.INC interpolates between neighboring values instead. Applied to the same six defaults, the methods produce genuinely different answers:
| Method | Q1 | Q2 | Q3 | IQR |
|---|---|---|---|---|
| Median-of-halves (this tool) | 4 | 6 | 9 | 5 |
| Excel QUARTILE.INC (inclusive) | 4.25 | 6 | 8.5 | 4.25 |
| Excel QUARTILE.EXC (exclusive) | 3.5 | 6 | 9.75 | 6.25 |
Every row is mathematically defensible; they weight the same six numbers differently. With 60 or 600 observations the methods converge and the differences shrink to a fraction of a unit. For homework and box plots, match the method your course uses — most introductory US statistics courses teach the median-of-halves method this calculator applies.
Where quartiles show up
- Box plots, which draw the box from Q1 to Q3 with a line at the median
- Salary and rent reports, usually quoted as a 25th–75th percentile band
- Test scoring, where Q3 is often the cutoff for an advanced group
- Response-time monitoring, where the 75th percentile is a standard service-level target
- Spreadsheet dashboards built on QUARTILE or PERCENTILE functions
The most common classroom use in 2026 is still constructing a box plot by hand: plot the five-number summary 2, 4, 6, 9, 12 on a number line, draw the box between Q1 and Q3, and extend whiskers to the minimum and maximum that are not outliers. The same five numbers appear in standardized-test score reports, so practicing on six values scales directly to real datasets.
Common mistakes
- Forgetting to sort before halving — Q1 of the unsorted list would come out wrong
- Including the median in both halves when the count is odd, which double-counts the middle value
- Mixing quartile methods mid-problem, then wondering why Q1 moved from 4 to 4.25
- Reading Q2 as the mean — here the median is 6 while the mean is 6.5, and the two need not stay close
- Subtracting Q1 from Q3 in the wrong order and reporting a negative IQR
A quick self-check: the results must satisfy Q1 ≤ Q2 ≤ Q3, and the mean of all six values is (4 + 7 + 2 + 9 + 5 + 12) ÷ 6 = 39 ÷ 6 = 6.5. If your hand-computed median disagrees with 6, recount the sorted list before moving on.
Frequently asked questions
What is the interquartile range for the default data?
Q3 − Q1 = 9 − 4 = 5. The middle 50% of the values span the interval from 4 to 9, and the remaining four values fall outside that band, two on each side.
Are there different quartile methods?
Yes. On the same six defaults this median-of-halves tool gives Q1 = 4 and Q3 = 9, Excel QUARTILE.INC gives 4.25 and 8.5, and QUARTILE.EXC gives 3.5 and 9.75. The methods agree more closely as the dataset grows.
What is Q2?
Q2 is the median. For the defaults it is (5 + 7) ÷ 2 = 6, the average of the two middle values after sorting.
How do I draw a box plot from these results?
Plot the five numbers 2, 4, 6, 9, 12 as minimum, Q1, median, Q3 and maximum. Draw the box from 4 to 9 with a line at 6, then run whiskers out to 2 and 12, which are inside the outlier fences.
Why does my textbook give Q1 = 4.25 instead of 4?
It is using the inclusive interpolation method: the Q1 position is 1 + (6 − 1) × 0.25 = 2.25, so Q1 = 4 + 0.25 × (5 − 4) = 4.25. Both answers are correct under their own definitions.
Can a quartile be a value not in the dataset?
Yes. Q2 here is 6, which does not appear among the six data values. With an even count, the median and often the quartiles fall between observed values.
How do quartiles relate to percentiles?
Q1, Q2 and Q3 are simply the 25th, 50th and 75th percentiles. Every quartile is a percentile, but percentiles also cover finer cuts such as the 90th.
What counts as an outlier in this dataset?
Using the 1.5 × IQR rule, the fences sit at −3.5 and 16.5. All six default values lie inside them, so nothing is flagged as an outlier.
Method and sources
- Quartile definitions using the median-of-halves method.