Q1, Q2 and Q3 — and every convention that would give you a different answer.
Your quartiles, by every method that disagrees
Paste numbers separated by commas, spaces or new lines.
Which convention?
Type 7 is what you get from Excel, R, NumPy, pandas, Sheets.
n = 9
Q1 3.00 · Q2 5.00 · Q3 7.00
That is the Type 7 answer. On this dataset the conventions do not agree — Q1 alone ranges over 1.00 depending on which one you use.
Q1
3.00
25% of the data sits below
Q2 (median)
5.00
the middle value
Q3
7.00
75% sits below
IQR
4.00
Q3 − Q1, the middle half
Your data, sorted
1 · 2 · 3 · 4 · 5 · 6 · 7 · 8 · 9
The conventions disagree here. If your answer does not match a textbook, this is almost certainly why — not an arithmetic error.
What this tool shows
There is no single agreed definition of a quartile. Eleven conventions are in everyday use, they give different numbers for the same data, and every other calculator picks one without telling you. This one computes them all and says when they part company.
Q1, Q2 and Q3 by the convention you choose
All eleven conventions side by side
Which one Excel, R, SPSS and the TI-84 use
The interquartile range that follows from each
Why small odd-sized datasets split the methods
How to get the same answer as your textbook
Eleven conventions Matches Excel and R Flags disagreement Named sources
Defaults to type 7, which is what Excel and R return.
Updated 7 September 2026 · Works in any browser, no installation
Sort the data, find the median, then find the middle of each half. That is the whole idea. The disagreement between methods is entirely about one detail — whether the median itself belongs to the halves, and whether to interpolate between neighbouring values — and it only bites when the sample is small and odd-sized.
At a glance
Formula shown
Q1 is the value below which a quarter of the sorted data falls, Q3 the value below which three quarters falls, and Q2 is the median. Type 7 places them by linear interpolation at position (n − 1)p + 1; the hinge rules instead take the median of each half of the sorted list.
Scenario support
Reporting the spread of exam marks or salaries; drawing a box plot; setting outlier fences at Q1 − 1.5·IQR and Q3 + 1.5·IQR; checking why a spreadsheet disagrees with a textbook.
Educational estimate
Planning support from the values you enter — not professional advice.
Why your spreadsheet and your textbook disagree
Take the numbers 1 through 9 and ask for the first quartile. Excel says 3. A TI-84 says 2.5. Both are right.
The median is 5, and it sits on an actual data point because there are an odd number of values. So when you split the list to find the middle of the lower half, you have to decide something the definition never settled: does the median belong to that half?
Include it and the lower half is 1, 2, 3, 4, 5, whose middle is 3. Exclude it and the lower half is 1, 2, 3, 4, whose middle is 2.5. Nothing has gone wrong in either case. Two reasonable people answered a question the word “quartile” does not answer on its own.
A quartile is an estimate of where a quarter of an unseen population lies, made from a finite sample. There are many defensible estimators for that, and statisticians have published at least nine. The disagreement is not sloppiness; it is an honest consequence of a small sample.
It also shrinks fast. With an even number of values the halves are unambiguous and the hinge rules agree exactly. With a few hundred values every method converges to within a rounding error. The argument is loudest precisely where students meet it: a dozen numbers on a worksheet.
The eleven conventions, and who uses which
Nine of them are the types catalogued by Hyndman and Fan in 1996, which is the classification R implements as quantile(type = ). Two more are the hinge rules that predate it.
Type 7 is the one you have almost certainly seen. It is the default in R, NumPy, pandas and Google Sheets, and it is what Excel returns from QUARTILE andPERCENTILE.INC. It interpolates so that p = 0 and p = 1 land exactly on the minimum and maximum.
Type 6 is Excel’s QUARTILE.EXC, and also the default in Minitab and SPSS. It positions quartiles at k/(n+1), which is where the order statistics of a uniform sample are expected to fall.
Tukey’s hinges come from the 1977 book that invented the box plot. When the count is odd, the median stays in both halves. Hinges were designed to be found quickly with a pencil, by folding a sorted list in half twice.
Moore and McCabe is the rule in most US introductory courses, and it is what a TI-83 or TI-84 reports. It is the same folding idea with the opposite decision: the median is excluded from both halves.
Type 8 is the one Hyndman and Fan themselves recommend, because its positions are approximately median-unbiased whatever the underlying distribution happens to be. Almost nothing uses it by default, which is a reasonable summary of how defaults get chosen.
The remaining types — 1 through 5 and 9 — appear in SAS, in older statistical packages, and in specific fields such as hydrology. The tool above lists each one alongside the software that uses it, so you can find your own.
Finding quartiles by hand, without a formula
For coursework you almost always want a hinge rule, because it needs no interpolation and no position formula.
Sort the values. Every method depends on order and nothing else. Duplicate values stay in the list; they are not collapsed.
Find the median. With an odd count it is the middle value. With an even count it is the average of the middle two.
Split the list at the median. This is the only step where the conventions differ. If the count is odd, decide whether the median goes into both halves (Tukey) or neither (Moore & McCabe). If the count is even, there is nothing to decide.
Take the median of each half. The lower half gives Q1, the upper half gives Q3.
Worked through on 31, 55, 58, 61, 63, 64, 66, 68, 71, 74, 78, 92 — twelve values, so the count is even. The median is the average of 64 and 66, which is 65. The lower half is the first six values, whose median is the average of 58 and 61, giving Q1 = 59.5. The upper half is the last six, whose median is the average of 71 and 74, giving Q3 = 72.5. The IQR is 13.
Now load that same preset into the tool above and it reports Q1 = 60.25 and Q3 = 71.75, for an IQR of 11.5. Neither result is a mistake. An even count settles the disagreement between the twohinge rules, because the halves are unambiguous — but it does nothing about the gap between a hinge rule and an interpolating type, and type 7 interpolates three quarters of the way from 58 to 61.
That is worth sitting with, because “the count is even, so it does not matter” is a common and wrong simplification. Even n makes Tukey and Moore & McCabe agree with each other. It does not make them agree with Excel. If you want a dataset where all eleven genuinely coincide, load the “all agree” preset: it works because the values sit in tied pairs exactly where every method looks, so there is nothing left to interpolate between.
What the interquartile range is actually for
Q3 minus Q1 is the interquartile range: the width of the middle half of the data.
Its value is that it ignores the ends. The range depends entirely on the two most extreme values, so one mistyped figure destroys it. The standard deviation squares every deviation, which gives distant points enormous influence. The IQR does neither: it is unchanged by anything that happens outside the middle 50%.
The formal version of that is the breakdown point, the share of the data that can be corrupted before a statistic becomes arbitrary. For the range it is zero — a single bad value is enough. For the IQR it is 25%.
That robustness is why quartiles anchor the standard outlier rule. Values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are conventionally flagged, and because the fences are built from quartiles rather than the mean, an outlier cannot quietly widen the very fence meant to catch it.
The 1.5 is a convention, not a theorem. Tukey chose it because for normally distributed data it flags roughly 0.7% of observations — rare enough to be interesting, common enough to be useful. The IQR Calculator works through the fences and what they do and do not mean.
When the choice of method changes a decision
Most of the time it does not matter, and it is worth being clear about when it does.
It rarely matters for large samples. Past a few hundred observations the methods agree to within a rounding error. If you are describing survey data or a year of transactions, pick the default and move on.
It matters for marking. On a twelve-value homework problem the difference between 2.5 and 3 is the difference between a mark and no mark. This is the single most common reason a student concludes their arithmetic is wrong when it is not.
It matters at a threshold. If a rule says “investigate anything past the upper fence”, then a different Q3 moves the fence, and a borderline case can flip from ordinary to flagged. Whoever wrote the rule should have written down the method too.
It matters when results must reconcile. A figure produced in Excel and a figure produced in R will not match on small samples, and the mismatch looks like a data problem. It is not; QUARTILE.EXC is type 6 and R’s default is type 7.
The practical rule: state the method whenever the sample is small enough for it to change the number, and use the same one on both sides of any comparison.
Which convention should you use
In order of how often the answer applies.
Whatever your course uses. If this is coursework, the only correct answer is the one your syllabus defines. In the US that is usually Moore & McCabe; check whether your textbook keeps the median in the halves.
Type 7, if nobody has specified. It is the default in R, NumPy, pandas, Sheets and Excel’s plain QUARTILE, so it is the number a reader is most likely to reproduce.
Type 8, if you want the defensible choice. Hyndman and Fan recommend it on the grounds that its positions are approximately median-unbiased regardless of distribution. If you are writing something that will be reviewed, this is the one with a published argument behind it.
Tukey hinges, if you are drawing a box plot by hand. They were designed for it, and they need no arithmetic beyond halving.
What matters more than the choice is saying which one you made. A quartile reported without its method is reproducible only by luck.
What quartiles cannot tell you
Three real limits, none of which a calculator can fix.
They say nothing about shape within a quarter. Two datasets can share all five of min, Q1, median, Q3 and max and look nothing alike — one smooth, one clustered at both ends. A box plot hides that by construction, which is why a dot plot or histogram is worth drawing alongside it.
They need an ordering, and only an ordering. That is a strength on ordinal data such as ratings, where a mean is not meaningful. It is a limit on categorical data, where quartiles do not exist at all.
They describe the sample, not the population. A quartile computed from thirty observations is an estimate with real uncertainty around it, and quartiles from small samples are noticeably unstable — add one value and Q1 can jump. Nothing on this page produces a confidence interval for a quartile, and the single number should not be read as though it were exact.
Finally, an outlier flagged by the 1.5 × IQR fence is a value worth looking at, not a value that has been shown to be wrong. Deleting points because a fence flagged them is how real effects get removed from real datasets.
Sources and methodology
The classification of methods, and the documentation for the tools each one corresponds to.
Method. All nine Hyndman-Fan types are computed from the single position rule in the paper — j = ⌊np + m⌋ with a type-specific m, then a weighted blend of x[j] and x[j+1] — rather than nine separate special cases, so a type cannot drift on its own. The two hinge rules are computed by actually splitting the sorted list, which is what makes the odd-n disagreement visible instead of hidden inside a formula. That engine is verified on every change against 0 assertions, including every type checked against R’s own published output on datasets chosen because the types diverge there, and a fuzz test requiring type 7 to agree to the last bit with the separate implementation that has driven this site’s Standard Deviation Calculator since long before this page existed. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
IQRInterquartile range, the 1.5 × IQR outlier fences, and exactly which values fall outside — with a slider that corrupts one value so you can watch the range move while the IQR does not.
Five Number SummaryMinimum, Q1, median, Q3 and maximum, drawn as a box plot with every one of your observations plotted underneath it — so you can see what the summary threw away.
PercentileThe value at any percentile and the percentile rank of any value, with all nine standard methods — and the round trip that shows the two directions are not inverses.
Standard DeviationSample and population standard deviation, plus variance, mean, median, quartiles, z-scores, outliers, and confidence intervals.
Weighted AverageEach value carries the weight you give it, with every item's share of the total shown as a percentage so you can see what is actually driving the answer.
Geometric MeanThe average for things that compound. Growth of +50% then -50% averages to zero arithmetically and to a real 13.4% loss geometrically, which is what actually happened.
An educational tool for summarising a dataset. Quartiles describe the sample you enter; extending them to a wider population is a separate inferential step this page does not take.
Published a quartile calculator that computes all eleven conventions in common use rather than silently picking one, because Excel, R, SPSS, the TI-84 and Tukey's original hinges give genuinely different answers for the same small dataset and every competing tool hides that.
The nine Hyndman-Fan types are implemented from the single position rule in the 1996 paper rather than as nine special cases, and each is asserted against R's own published quantile() output on datasets chosen because the types diverge there.
Corrected the worked example before publishing: the first draft claimed an even count makes every convention agree. It does not — it only makes the two hinge rules agree with each other, and the page now shows the exam-marks preset giving 59.5 by hand and 60.25 in the tool, with the reason.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.