Quartile & IQR Calculator
Find the five-number summary, quartiles (Q1, Q2, Q3), interquartile range and Tukey outlier fences for a list of numbers — with a box plot, the rank arithmetic, and a live comparison of the four common quartile methods so you can match your textbook or software.
Written by Suhaib Hassan. Methods follow Hyndman & Fan (1996) and Tukey (1977), and each is checked against a hand-worked data set. Our methodology.
It sorts your data, finds each quartile's rank position, and interpolates between neighbouring values where the rank is not a whole number.
Textbooks, Excel and R often report different Q1 and Q3 for the same data. This page shows all four methods side by side instead of hiding the choice.
—
—
—
—
—
—
Values used
—
Box-and-whisker plot
The box spans Q1 to Q3 with the median marked. Whiskers reach the most extreme values inside the inner fences; dots beyond them are outliers.
—
Step-by-step working
—
Why different tools give different quartiles
Your data run through all four methods. The row for the method you selected is highlighted.
| Method | Q1 | Median | Q3 | IQR | Used by |
|---|
Why quartiles instead of mean and standard deviation?
Quartiles and the IQR are resistant statistics: a few extreme values barely move them, whereas the mean and standard deviation can shift a lot.
Example with the default data n = 14
Without it (n = 13): mean = 30.54, median = 28
Dropping one extreme value moves the mean by about 4.6 but the median by only 1.
Breakdown point 25%
Up to a quarter of the data can be replaced by arbitrarily extreme values before the quartiles themselves are dragged away. The mean can be moved arbitrarily by changing a single value.
Where quartiles are used
Exploratory analysis
Box plots built from the five-number summary show centre, spread and skew at a glance, and make side-by-side group comparisons easy.
Five-number summaryOutlier screening
Tukey’s 1.5 × IQR rule flags unusually high or low readings — for example a faulty sensor value or a mistyped entry — for review.
Inner and outer fencesSkewed data
Incomes, house prices and response times are skewed, so they are often summarised by the median and IQR rather than the mean and standard deviation.
Robust summariesWhat are quartiles and the IQR?
Quartiles split a sorted data set into four parts holding roughly equal numbers of values. Q1 is the 25th percentile, Q2 is the median (50th percentile) and Q3 is the 75th percentile. The interquartile range, IQR = Q3 − Q1, is the spread of the middle half of the data.
How the four methods place the cut points
- Inclusive (R-7): rank L = 1 + p(n − 1), interpolating between neighbouring sorted values. Used by Excel QUARTILE.INC, R’s default and NumPy’s default.
- Exclusive (R-6): rank L = p(n + 1), interpolating. Used by Excel QUARTILE.EXC, Minitab and SPSS; needs n ≥ 3.
- Tukey’s hinges: split the sorted data at the median and take the median of each half; for an odd n the median belongs to both halves.
- Moore & McCabe: as above, but for an odd n the median is left out of both halves.
By Suhaib Hassan · Reviewed 28 September 2026 · How CalculatePilot verifies formulas →
Tukey’s outlier fences
Values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR lie outside the inner fences and are flagged as possible (mild) outliers. Values beyond Q1 − 3 × IQR or Q3 + 3 × IQR lie outside the outer fences and are flagged as extreme. A flag is a prompt to investigate, not proof that a value is an error.
Sources
- Hyndman, R. J. & Fan, Y. (1996). Sample quantiles in statistical packages. The American Statistician 50(4), 361–365.
- Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley.
- NIST/SEMATECH e-Handbook of Statistical Methods — 1.3.3.7 Box plot
- NIST/SEMATECH e-Handbook of Statistical Methods — 7.1.6 What are outliers in the data?
Frequently asked questions
Why does Excel give a different Q1 than my textbook?
Excel’s QUARTILE.INC interpolates at rank 1 + 0.25(n − 1), while many textbooks take the median of the lower half. Both are legitimate definitions; the comparison table above shows the results side by side for your data.
What is the interquartile range used for?
It measures the spread of the middle 50% of the data and, unlike the range or standard deviation, is barely affected by extreme values. It is also the basis of Tukey’s outlier fences.
How are mild and extreme outliers classified?
A value beyond 1.5 × IQR from the nearer quartile is a mild outlier; beyond 3 × IQR it is an extreme outlier. The 1.5 and 3 multipliers are Tukey’s conventions rather than laws of nature.
Can the lower fence be negative when all data is positive?
Yes. The fence is a calculation from Q1 and the IQR, so it can fall below zero even if every value is positive. It simply means no value is low enough to be flagged at the bottom.
What is the difference between quartiles and percentiles?
Quartiles are specific percentiles: Q1 is the 25th, Q2 the 50th and Q3 the 75th. Percentile methods share the same definitional choices as the quartile methods on this page.
How many values do I need?
Quartiles can be computed from as few as two values with the inclusive and hinge methods, but they are only meaningful with a reasonable amount of data. The exclusive method requires at least three values.
Related statistics calculators
Continue your analysis.