Quartile Calculator
Find quartiles for your dataset, including Q1, Q2, and Q3. Paste numbers to get sorted values and a clear quartile breakdown for box plots.
Enter the Details
Calculate the first quartile, second quartile and third quartile of a set of numbers.
Enter numbers separated by comma , space or line break
Result will appear here...
What the quartile calculator does
Quartiles cut a sorted data set into four equal parts. This calculator finds the three cut points: the first quartile, one quarter of the way in, the second quartile, which is the median in the middle, and the third quartile, three quarters of the way in. It shows your sorted data alongside them.
They are the backbone of a box plot and the basis of the interquartile range, the most outlier-resistant measure of spread there is. Below is how it finds them and why a quartile can differ from one tool to the next.
How to use it
- Enter your numbers in the box, separated by commas, spaces, or line breaks. You need at least four.
- Press Calculate for the three quartiles and your sorted data, or Reset to clear it.
How the quartiles are worked out
It starts by sorting the data and finding the median, which is the second quartile and splits the set into a lower half and an upper half. The first quartile is then the median of the lower half, and the third quartile is the median of the upper half.
When the data has an odd number of values, the middle value is the overall median, and this calculator leaves it out of both halves before finding their medians. That choice, excluding the median from the halves, is what statisticians call the exclusive method, and it is the same one built into Texas Instruments calculators.
Which method, and why quartiles differ
Quartiles are one of those corners of statistics where reasonable people picked different rules. Besides the exclusive method this tool uses, there is an inclusive method, which keeps the median in both halves, and there are interpolation methods, like the one in Excel's QUARTILE.INC, that slide between data points instead of taking half-medians.
On the same data these can give noticeably different first and third quartiles, especially on small sets. So if a quartile here does not match another tool, the method is almost always the reason. The exclusive method is a common teaching choice and the one behind many box plots, but it is worth naming which you are using when you report a quartile.
A worked example
Take the nine numbers 3, 5, 7, 8, 12, 13, 14, 18, 21, already sorted. The median is the middle value, 12, so that is the second quartile.
Setting that middle 12 aside, the lower half is 3, 5, 7, 8, whose median is (5 + 7) ÷ 2 = 6, the first quartile. The upper half is 13, 14, 18, 21, whose median is (14 + 18) ÷ 2 = 16, the third quartile. So the quartiles are 6, 12, and 16, and the interquartile range is 16 minus 6 = 10.
Reading the quartiles
The three quartiles carve the data into four equal groups, each holding a quarter of the values. The distance between the first and third, the interquartile range, is the span of the middle half of the data. Because it ignores the top and bottom quarters entirely, it is barely moved by an outlier, which is why it is the spread measure of choice for skewed data.
The quartiles are also the box in a box plot: the box runs from the first quartile to the third, with a line at the median, so the whole picture is built from the three numbers this calculator gives you.
Entering your data, and the rounding
You can separate your numbers with commas, spaces, or line breaks, in any mix, and the calculator sorts them for you, so the order does not matter. You need at least four values for the idea of quarters to make sense. The quartiles are shown to three decimal places with trailing zeros trimmed.
Questions people ask
What are quartiles?
The three values that split sorted data into four equal parts. The first quartile is a quarter of the way in, the second is the median, and the third is three quarters of the way in.
What is the interquartile range?
The third quartile minus the first, which is the span of the middle half of the data. It is a measure of spread that is highly resistant to outliers.
Why do different calculators give different quartiles?
Because there are several accepted methods. This tool uses the exclusive method, which excludes the median from the halves. Inclusive and interpolation methods can give different first and third quartiles on the same data.
Why do I need at least four numbers?
Because quartiles divide data into four parts, and with fewer than four values that division is not meaningful.
References
A quick note on where the methods here come from. The definition of quartiles and the interquartile range is set out in the NIST/SEMATECH e-Handbook of Statistical Methods, the US government's public statistics reference. The reason different tools compute quartiles differently is covered in Hyndman and Fan's survey of quantile methods, the standard reference on the subject.
- NIST/SEMATECH e-Handbook of Statistical Methods (quartiles and the interquartile range). https://www.itl.nist.gov/div898/handbook/
- Hyndman, R. J. and Fan, Y. (1996), Sample Quantiles in Statistical Packages, The American Statistician. https://www.tandfonline.com/doi/abs/10.1080/00031305.1996.10473566
Ankit Khatiwada is a researcher and graduate student in Computer Science at Saarland University, with strengths in statistics, data analysis, data engineering, and full stack development. His work sits at the intersection of quantitative reasoning and applied technology, making him a strong fit for tools that depend on clear numerical logic. At Eon Tools, he reviews number and statistical tools.
Other Tools
- 5 Number Summary Calculator
- Arithmetic Mean Calculator
- Box Plot Calculator
- Class Width Calculator
- Decile Calculator
- Frequency Distribution Calculator
- Geometric Mean Calculator
- Harmonic Mean Calculator
- Mean Calculator
- Mean Median Mode Calculator
- Median Calculator
- Midrange Calculator
- Mode Calculator
- Outlier Calculator
- Percentile Calculator
- Percentile Rank Calculator
- Quartile Deviation Calculator
- Range Calculator
- Sample Mean Calculator
- Skewness Calculator
- Stem And Leaf Plot Calculator