Quartile Calculator

Type or paste your numbers separated by commas, spaces, or new lines. You get Q1, the median, Q3, the IQR, the five number summary, the Tukey fences with any outliers flagged, and a box plot, with every step of the arithmetic shown. Both mainstream quartile methods (the TI-84 median split and Excel's interpolation) are computed side by side.

Put this calculator on your website for free

Copy one snippet and give your visitors a working Quartile Calculator.

How the quartile calculator works

Quartiles cut your sorted data into four piles with an equal count in each. Q2 is the median, the value with half the data below it. Q1 is the median of the lower half and Q3 the median of the upper half, so the box from Q1 to Q3 holds the middle half of everything you measured. Put another way, quartiles are just the 25th, 50th, and 75th percentiles wearing a uniform; the percentile calculator handles any other cut point you like.

From those three numbers everything else on this page follows. The five number summary adds the minimum and maximum. The IQR (interquartile range) is the width of the box, Q3 minus Q1. And the Tukey fences, sitting 1.5 IQRs beyond the box on each side, are the classic rule for flagging values that deserve a second look.

The formula

IQR = Q3 − Q1
Lower fence = Q1 − 1.5 × IQR    Upper fence = Q3 + 1.5 × IQR

Here Q1 and Q3 are the first and third quartiles of your sorted data, and any value outside the two fences is flagged as a potential outlier. The 1.5 comes from John Tukey, who introduced the rule in his 1977 book Exploratory Data Analysis. It is a convention, not a law of nature: the story goes that when asked why 1.5, Tukey said 1 was too small and 2 was too large. It has served half a century of data analysis well, but a flagged point is a candidate for investigation, never automatically wrong.

Worked example

Take the list 4, 8, 6, 5, 3, 7. Sorted: 3, 4, 5, 6, 7, 8, so n = 6 and the median is (5 + 6) / 2 = 5.5.

Split the list in half. Lower half 3, 4, 5 gives Q1 = 4; upper half 6, 7, 8 gives Q3 = 7. So IQR = 7 − 4 = 3.

The fences sit at 4 − 1.5 × 3 = −0.5 and 7 + 1.5 × 3 = 11.5. Every value is inside them, so nothing gets flagged.

Excel would answer slightly differently: its QUARTILE function interpolates and gives Q1 = 4.25 and Q3 = 6.75 for the same six numbers. Neither answer is wrong; see the next section.

Why your textbook and Excel disagree

If you have ever computed quartiles by hand, checked them in Excel, and found different numbers, you did nothing wrong. There are two mainstream conventions and they genuinely disagree on most data sets.

The median split method (Tukey's hinges, your TI-84, and most statistics textbooks) splits the sorted data at the median, leaves the median value itself out when the count is odd, and takes the median of each half. The interpolation method (Excel's QUARTILE and QUARTILE.INC, Google Sheets, and the default in most statistics software) instead walks to position (n − 1) × 0.25 in the sorted list, counting from zero, and interpolates between the two nearest values when it lands between them. On the six numbers above, one method says Q1 is 4 and the other says 4.25.

Both are reasonable answers to the same question, the gap shrinks as your data grows, and the honest move is to name your method. This calculator always computes both and shows them side by side whenever they differ, so you can match your class, your spreadsheet, or your software without wondering which one is broken. None of them are.

Why the IQR shrugs off wild values

Here is the IQR's superpower, on the same six numbers. The list 3, 4, 5, 6, 7, 8 has a range of 5 and an IQR of 3. Now change the 8 to 800, a slipped keystroke. The range explodes from 5 to 797. The IQR stays exactly 3, because Q1 and Q3 are still 4 and 7: the quartiles only care about the order of the values, not how far the extreme ones wandered. Better still, the unchanged fences immediately flag 800 as the value to go look at.

That is the trade in one sentence: the range and the standard deviation listen to every value including the wild ones, while the IQR listens only to the middle half. When your data is clean and roughly bell shaped, standard deviation tells you more. When it has heavy tails, skew, or the occasional typo, the IQR keeps its head. The mean, median, and mode split the same way: the mean chases a wild value, the median stays put.

Reading a box plot

A box plot is the five number summary drawn to scale, and once you can read one you can size up a data set in a glance. The box spans Q1 to Q3, so its width is the IQR. The line inside it is the median. The whiskers extend to the most extreme values that are still inside the fences, and anything beyond gets drawn as its own dot.

The shape talks. A median sitting dead center in the box with whiskers of equal length suggests a symmetric distribution. A median shoved toward one end of the box, or one whisker much longer than the other, is skew you can see without computing anything: the long side is where the stragglers live. And a tight box with long whiskers means the middle half of your data agrees with itself while the edges roam. The plot above is drawn from exactly the same numbers as the tables, so the picture and the arithmetic can never disagree.

Frequently asked questions

How do you calculate quartiles and the IQR?

Sort the data, find the median, then find the median of each half: the lower half's median is Q1 and the upper half's is Q3. The IQR is simply Q3 minus Q1, the width of the middle half of your data. The calculator above walks every step with your own numbers, including exactly how the halves were split.

Why does Excel give different quartiles than my TI-84?

They use two different conventions. Your TI-84 and most textbooks split the data at the median and take the median of each half, while Excel's QUARTILE function interpolates between positions in the sorted list. Both are legitimate, they genuinely disagree on most data sets, and neither is a bug. This calculator shows both side by side so you can match whichever tool your class uses.

How do you find outliers with the IQR?

Compute the fences: Q1 minus 1.5 times the IQR on the low side, and Q3 plus 1.5 times the IQR on the high side. Any value outside those fences is flagged as a potential outlier. The 1.5 factor is John Tukey's convention rather than a law of nature, and a flagged point deserves a second look, not automatic deletion.

What is a five number summary?

The minimum, Q1, the median, Q3, and the maximum: five numbers that sketch a whole data set. They tell you where the data starts and ends, where its middle sits, and how wide its middle half is. A box plot is exactly these five numbers drawn as a picture.

Is an outlier always a mistake?

No, and treating it as one is how discoveries get deleted. An outlier is a value that sits far from the rest by a chosen rule, nothing more. Sometimes it is a typo worth fixing, and sometimes it is the most interesting measurement in the set: the one patient who responded, the one server that failed. Investigate first, decide second.

When is the IQR better than standard deviation?

When your data has wild values or a long tail. Standard deviation squares every distance from the mean, so a single extreme point can inflate it badly, while the IQR only watches the middle half and does not move at all once a point is beyond it. For roughly bell-shaped data with no extremes, standard deviation is the more informative measure. Many analysts compute both and compare.

How do you read a box plot?

The box spans Q1 to Q3, so it holds the middle half of your data, and the line inside it is the median. The whiskers reach out to the furthest values still inside the fences, and any dots beyond them are flagged outliers. A median pushed to one side of the box, or one whisker much longer than the other, is skew you can see at a glance.

Related calculators