Quartile Calculator
Split a data set into quarters, build a box-and-whisker plot, and flag outliers automatically — check exactly which quarter (and percentile) a single value falls into — or line up two data sets side by side to see which one is really more spread out. Includes an advanced comparison of the two most common quartile methods, since they don't always agree.
Background
Quartiles are the three values — Q1, Q2 (the median), and Q3 — that divide an ordered data set into four equal-sized groups of 25% each. The middle 50% of the data, from Q1 to Q3, is called the interquartile range (IQR), and it's the standard yardstick for how spread out the "typical" data is and for spotting values that don't belong.
How to use this calculator
- Quartiles & Box Plot takes a full data set and returns Q1, the median, Q3, the IQR, and flags any statistical outliers — with a box-and-whisker plot.
- Classify a Value takes a data set plus one value and tells you which quarter it falls in and its percentile rank — useful for "how good is this one score?" questions.
- Compare Two Data Sets puts two box plots on the same scale so you can see at a glance whether one group runs higher, is more spread out, or genuinely differs from the other.
- Click Calculate to see the visual and full step-by-step working for whichever mode you picked.
- Open Advanced to see the same data set split two different standard ways, side by side.
How this calculator works
The data is sorted from smallest to largest. The median (Q2) is the middle value — or the average of the two middle values when there's an even count.
The exclusive method (this calculator's default) splits the sorted data into a lower half and an upper half — excluding the median itself when the count is odd — then takes the median of each half to get Q1 and Q3.
IQR = Q3 − Q1. Outlier fences sit 1.5×IQR below Q1 and above Q3 (Tukey's rule); anything outside those fences is flagged as a statistical outlier rather than plotted as a normal whisker.
The interpolation method (used in the Advanced comparison) instead finds Q1 and Q3 at exact fractional positions in the sorted list, blending between the two nearest values when that position isn't a whole number.
For Classify a Value, the percentile rank counts how many values fall below your number (plus half of any that tie it exactly), divided by the total count — then that position is compared against Q1/Q2/Q3 to name the quarter.
For Compare Two Data Sets, each set gets its own Q1/median/Q3/IQR, and the two "boxes" (Q1 to Q3) are checked for overlap — non-overlapping boxes are a simple, well-known signal that two groups likely differ for real, not just by chance.
Formula & Equations Used
Median: middle value if n is odd; average of the two middle values if n is even.
Exclusive quartiles: Q1 = median of the lower half; Q3 = median of the upper half (median excluded from both halves when n is odd).
IQR: IQR = Q3 − Q1
Outlier fences: lower = Q1 − 1.5·IQR, upper = Q3 + 1.5·IQR
Interpolation method: for percentile p, rank = p·(n−1) (0-indexed); the value is interpolated between the two data points on either side of that rank.
Percentile rank of a value v: PR = (L + 0.5·E) / n × 100, where L = count below v and E = count equal to v.
Box overlap check (Compare Two Data Sets): the two IQR boxes overlap when Q1(A) ≤ Q3(B) and Q1(B) ≤ Q3(A).
Example Problems & Step-by-Step Solutions
These cover cases the Quick Examples chips above don't already demonstrate.
Example 1 — A clean odd-count split
Data: 2, 4, 4, 6, 8, 9, 12 (n = 7). Find Q1, the median, and Q3.
Step: Median (middle of 7) = 6. Lower half (excluding the median) = 2, 4, 4 → Q1 = 4. Upper half = 8, 9, 12 → Q3 = 9.
Example 2 — Catching a real outlier
Data: 12, 13, 13, 14, 15, 16, 16, 17, 90 (n = 9). Is 90 an outlier?
Step: Q1 = 13, Q3 = 16.5, so IQR = 3.5. Upper fence = 16.5 + 1.5(3.5) = 21.75. Since 90 > 21.75, yes — it's flagged as a statistical outlier.
Example 3 — Classifying a value by hand
Data: 55, 60, 62, 65, 68, 70, 72, 75, 78, 80 (n = 10). Where does 74 fall?
Step: Median = 69, Q3 = 75. Since 69 ≤ 74 < 75, it's in the third quarter. Seven of ten values are below 74, so PR = (7/10)×100 = 70th percentile.
Example 4 — Same data, two different quartiles
Data: 3, 5, 6, 9, 11, 14, 17, 19, 22, 25, 30 (n = 11). Compare methods for Q1 and Q3.
Step: Exclusive method: lower half 3,5,6,9,11 → Q1 = 6; upper half 17,19,22,25,30 → Q3 = 22. Interpolation method: rank = 0.25×10 = 2.5 → Q1 = 7.5; rank = 0.75×10 = 7.5 → Q3 = 20.5. Both methods agree on the median (14) — they only disagree on Q1 and Q3.
Example 5 — Two groups that clearly don't overlap
Group A: 10, 12, 13, 14, 15, 16, 17, 19. Group B: 30, 32, 33, 34, 35, 36, 37, 39. Are these really different?
Step: Group A: Q1 = 12.5, Q3 = 16.5. Group B: Q1 = 32.5, Q3 = 36.5. Since 16.5 < 32.5, the two boxes don't overlap at all — a strong sign these two groups genuinely differ, not just random noise.
Frequently Asked Questions
Why do the exclusive and interpolation methods give different answers?
They use different rules for splitting data that doesn't divide evenly into quarters. The exclusive method (common in textbooks) picks the median of a whole half of the data; the interpolation method (common in software) finds an exact fractional position and blends between neighboring values. Neither is "wrong" — they're just different conventions, and this calculator's main modes use the exclusive method since it's the one most often taught by hand.
Why was a value flagged as an outlier when it doesn't look that extreme?
The 1.5×IQR fence (Tukey's rule) is a standard convention, not a claim that the value is impossible or wrong. In a small or naturally spread-out data set, a perfectly legitimate value can still fall outside the fence — it's worth a second look, not automatic removal.
Does the value I'm classifying need to already be in my data set?
No. Classify a Value works for any number you want to test — a new test score, a hypothetical measurement, anything — by comparing it against the Q1/median/Q3 already computed from your existing data.
What's the smallest data set this works for?
You need at least 4 values for the split into halves to be meaningful. With very small data sets (4–8 values), Q1 and Q3 can land exactly on one of your original data points, which is normal and expected.
If two boxes overlap, does that mean the groups are the same?
Not necessarily — it just means their middle 50% ranges share some values, so IQR alone can't tell them apart. Two groups can overlap on spread but still have clearly different medians (or vice versa), so it's worth checking both before concluding anything.