Quartile & IQR Calculator
Find Q1, Q2 (median), Q3, and the interquartile range for any data set, plus min/max/range and the 1.5×IQR outlier fences, shown step by step.
What quartiles split the data into
Quartiles cut a sorted data set into four equal-sized groups of 25% each:
| Quartile | Cuts off the bottom | Also known as |
|---|---|---|
| Q1 | 25% of the data | First quartile, lower quartile |
| Q2 | 50% of the data | Median, second quartile |
| Q3 | 75% of the data | Third quartile, upper quartile |
The interquartile range, IQR = Q3 − Q1, is the width of the box that contains the middle 50% of the values — the "typical" spread, with the most extreme 25% on each end left out.
The exclusive method, step by step
This calculator finds quartiles using the exclusive method, one of two common conventions (the other, linear interpolation, is what the percentile calculator uses):
- Sort the data in ascending order.
- Find Q2 — the median of the whole sorted list.
- Split into a lower half and an upper half. If the count is odd, the median itself is excluded from both halves. If the count is even, the two halves just meet in the middle with nothing excluded.
- Q1 = the median of the lower half.
- Q3 = the median of the upper half.
- IQR = Q3 − Q1.
Worked example
For the data set 40, 42, 47, 53, 54, 59, 65 (7 values, already sorted):
- Q2 (median) = the middle value = 53 — excluded from both halves below
- Lower half = 40, 42, 47 → Q1 = median of these three = 42
- Upper half = 54, 59, 65 → Q3 = median of these three = 59
- IQR = 59 − 42 = 17
- Outlier fences = [42 − 1.5×17, 59 + 1.5×17] = [16.5, 84.5] — nothing in this data set falls outside, so there are no outliers.
Q1 is not the same as the 25th percentile
Q1 above came out to 42, but a linear-interpolation calculator finds the 25th percentile of this same data set as 44.5 — a different number, from a different (also valid) method. The exclusive method treats Q1/Q3 as medians of whole sub-groups; linear interpolation instead ranks every value and interpolates between the two closest ranks. Both are standard, both appear in textbooks and software, and they only match exactly for certain data set sizes. This calculator never mixes the two — if you need percentile-style interpolation, use the percentile calculator instead.
IQR and the 1.5×IQR outlier rule
Because IQR only looks at the middle 50% of the data, it doesn't care how extreme the top or bottom 25% get — a single huge or tiny value can't stretch it the way it stretches the full range or standard deviation. That robustness is exactly why IQR is the basis for a simple outlier test:
- Lower fence = Q1 − 1.5 × IQR
- Upper fence = Q3 + 1.5 × IQR
Any value outside those fences is flagged as a likely outlier. Try 1, 2, 3, 4, 5, 100 on this calculator: Q1 = 2, Q3 = 5, IQR = 3, so the fences are [−2.5, 9.5] — and 100 clearly falls outside, so it's flagged. This same box — median line, Q1/Q3 edges, whiskers out to the fences, and dots beyond them — is exactly what a box plot (box-and-whisker plot) draws.
Where it's used
Quartiles and IQR are the backbone of box plots, used everywhere from exam-score distributions to salary bands to manufacturing tolerances, precisely because they summarize spread without being thrown off by a handful of extreme values. For the central-tendency measures quartiles build on, see mean, median, and mode; for percentile-style interpolation instead of the exclusive method, see percentile; for a fuller statistical summary in one pass, see descriptive statistics.
Frequently asked questions
- What is the difference between Q1, Q2, and Q3?
- They are the three values that split a sorted data set into four equal-sized quarters. Q1 (the first quartile) is the boundary below which the lowest 25% of values fall. Q2 is the median — the boundary at 50%. Q3 (the third quartile) is the boundary below which the lowest 75% of values fall, leaving the top 25% above it.
- Why is Q1 here different from the 25th percentile calculator?
- This calculator uses the exclusive method — it finds the median, then finds the median of the lower half and the median of the upper half, excluding the overall median from both halves when the count is odd. The [percentile calculator](/en/calculators/statistics/percentile) uses linear interpolation between ranked values instead, which is a different (also standard) convention. The two methods agree closely on large, evenly spread data sets but can disagree on small ones — for the example set on this page, Q1 = 42 here versus P25 = 44.5 by interpolation. Neither is "wrong"; they are different textbook conventions, and this page always uses the exclusive method.
- What does the interquartile range (IQR) measure?
- IQR = Q3 − Q1 is the width of the middle 50% of the data. Unlike the full range (max − min), it ignores the most extreme values entirely, so a single very high or very low number can't distort it. That makes IQR a more robust measure of spread than range for data sets that might contain outliers.
- What is the 1.5×IQR rule for outliers?
- It flags any value below Q1 − 1.5×IQR or above Q3 + 1.5×IQR as a likely outlier. These two thresholds are called the lower and upper fences. The rule is a convention, not a law of statistics — a flagged value deserves a second look, not automatic removal, since it might be a genuine (if unusual) data point rather than an error.
- How do quartiles and the IQR show up in a box plot?
- A box plot draws a box from Q1 to Q3 with a line at the median (Q2), so the box itself spans the IQR. Whiskers extend out to the most extreme values that still fall inside the 1.5×IQR fences, and any points beyond the fences are usually drawn individually as dots — the same outliers this calculator lists.
- Why do I need at least two numbers?
- Splitting the data into a lower half and an upper half requires at least one value on each side of the median, so quartiles are only defined once there are two or more values.