Quartile Calculator

Paste a list of numbers and get Q1, Q2 (median), Q3, the interquartile range (IQR), and the 1.5×IQR outlier fences.

Quick Facts

Method
Sort the data, split at the median, take medians of each half for Q1 and Q3
IQR = Q3 − Q1 measures the spread of the middle 50% of values.

Your Results

Calculated
Q1 (25th percentile)
-
Lower quartile
Q2 (median)
-
50th percentile
Q3 (75th percentile)
-
Upper quartile
IQR (Q3 − Q1)
-
Middle-50% spread
Minimum
-
Smallest value
Maximum
-
Largest value
Lower fence
-
Q1 − 1.5×IQR
Upper fence
-
Q3 + 1.5×IQR

Ready

Paste your numbers and press Calculate.

What quartiles are

Quartiles split a sorted dataset into four equal parts. Three cut points do the splitting: the first quartile Q1 (the 25th percentile), the second quartile Q2 (the 50th percentile, which is just the median), and the third quartile Q3 (the 75th percentile). Roughly 25% of the values lie below Q1, 50% below Q2, and 75% below Q3. Quartiles are the backbone of the five-number summary (minimum, Q1, median, Q3, maximum) and of the box-and-whisker plot.

How the quartiles are calculated

The core recipe is simple:

  1. Sort the values from smallest to largest.
  2. Q2 (median): the middle value. If there is an even number of values, average the two middle ones.
  3. Q1: the median of the lower half of the data.
  4. Q3: the median of the upper half of the data.

The only ambiguity is what to do with the median when the count is odd, and this is what the two methods on this calculator control:

  • Exclusive (Tukey / Excel QUARTILE.EXC): when the count is odd, the median value is excluded from both halves before taking their medians. This is the "median of halves" method taught in most introductory statistics courses.
  • Inclusive (Excel QUARTILE.INC, NumPy's default "linear" method): the p-th quartile is found by linear interpolation at rank p×(n−1) in the zero-indexed sorted list, with p = 0.25, 0.5, 0.75. On odd-length data the median value is effectively shared between the halves.

The two methods agree on the median and often agree on Q1/Q3, but they can differ on small or odd-sized samples, which is why statistical software lets you pick.

Worked example

Take the dataset 7, 15, 36, 39, 40, 41 (already sorted, n = 6, even). The median is the average of the two middle values, 36 and 39, so Q2 = 37.5. The lower half is {7, 15, 36} with median Q1 = 15; the upper half is {39, 40, 41} with median Q3 = 40, giving IQR = Q3 − Q1 = 40 − 15 = 25. These are the exclusive-method quartiles. The inclusive (interpolation) method places the quartiles between values instead, returning Q1 = 20.25 and Q3 = 39.75 for the same data — both share the median 37.5. That gap is normal and is exactly why the method dropdown exists.

The interquartile range and outliers

The IQR = Q3 − Q1 is the width of the middle 50% of the data. Because it ignores the top and bottom quarters, it is resistant to outliers, unlike the full range (max − min) or the standard deviation. Tukey's fence rule flags a value as a suspected outlier when it falls below the lower fence Q1 − 1.5×IQR or above the upper fence Q3 + 1.5×IQR. Points beyond 3×IQR are sometimes called "far out." These fences are exactly what draws the whiskers on a box plot.

Frequently Asked Questions

Why do my quartiles differ from another tool?
There are several accepted definitions of quartiles. This calculator offers the two most common: the exclusive (Tukey / QUARTILE.EXC) "median of halves" method and the inclusive (QUARTILE.INC / NumPy linear) interpolation method. Excel's QUARTILE.INC, Google Sheets QUARTILE, and pandas .quantile() default to the inclusive method; many textbooks and Minitab use the exclusive method. Switch the method dropdown to match your source. On even-sized data the two usually coincide.
Is Q2 the same as the median?
Yes. The second quartile is by definition the 50th percentile, which is the median of the whole dataset. It splits the data into a lower and an upper half.
Can quartiles equal each other or equal a data value?
Yes. If many values repeat or the data is clustered, Q1, Q2, and Q3 can be equal, and any quartile can land exactly on an observed value. That is expected, not an error — it just means the data is concentrated.
Does a value beyond the fence automatically get deleted?
No. The 1.5×IQR rule only flags candidates for review. A flagged point may be a genuine extreme observation, a data-entry error, or a value from a different population. Investigate before removing anything — deleting real data biases your results.