Skip to content
CalcWorld

Browse all tools

Quartile Calculator

This quartile calculator sorts your data and finds Q1, the median (Q2), Q3 and the interquartile range. Q1 is the median of the lower half and Q3 the median of the upper half: for 1, 3, 5, 7, 9, 11 and 100 they are 3 and 11.

Sources: OpenStax Introductory Statistics 2e Updated

Separate the values with commas, spaces or new lines. Any order.

Quartiles

Q1 = 15, Q2 = 40, Q3 = 43

Interquartile range (IQR)
28
Minimum
6
Maximum
49
Range
43
1.5 × IQR fences
−27 and 85
Values outside the fences
none
Show steps Here’s how we got it
  1. Put the values in order, smallest first

    6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49

  2. Find the median (Q2)

    There are 11 values, so the median is the 6th one: 40

  3. Split the data into a lower half and an upper half

    Lower half: 6, 7, 15, 36, 39

    Upper half: 41, 42, 43, 47, 49

    With an odd number of values, this method leaves the median out of both halves.

  4. Q1 is the median of the lower half

    There are 5 values, so the median is the 3rd one: 15

  5. Q3 is the median of the upper half

    There are 5 values, so the median is the 3rd one: 43

  6. Subtract to get the interquartile range

    IQR = Q3 − Q1 = 43 − 15 = 28

    The IQR is the spread of the middle half of the data.

The quartile method

Sort the data, then, as in OpenStax Introductory Statistics:

Q2=median of all the dataQ1=median of the lower halfQ3=median of the upper halfQ_2 = \text{median of all the data} \qquad Q_1 = \text{median of the lower half} \qquad Q_3 = \text{median of the upper half}
IQR=Q3−Q1\text{IQR} = Q_3 - Q_1

With an even number of values, the two halves are simply the first half and the second half. With an odd number, the middle value is the median, and the methods disagree about where it goes:

MethodOdd number of valuesWhere it is used
Median left outThe median belongs to neither half.OpenStax Introductory Statistics; many school courses
Median includedThe median is counted in both halves.Some textbooks (sometimes called Tukey's hinges)
Linear interpolationRank = p × (n − 1) + 1, then interpolate between neighbours.Spreadsheet QUARTILE.INC functions

How to find quartiles and outliers

Find the quartiles of 1, 3, 5, 7, 9, 11 and 100 with the default method, and check whether 100 is an outlier.

  1. Put the values in order, smallest first

    1, 3, 5, 7, 9, 11, 100

  2. Find the median (Q2)

    There are 7 values, so the median is the 4th one: 7

  3. Split the data into a lower half and an upper half

    Lower half: 1, 3, 5

    Upper half: 9, 11, 100

    With an odd number of values, this method leaves the median out of both halves.

  4. Q1 is the median of the lower half

    There are 3 values, so the median is the 2nd one: 3

  5. Q3 is the median of the upper half

    There are 3 values, so the median is the 2nd one: 11

  6. Subtract to get the interquartile range

    IQR = Q3 − Q1 = 11 − 3 = 8

    The IQR is the spread of the middle half of the data.

Answer: Q1 = 3, Q2 = 7, Q3 = 11

The upper fence is Q3 + 1.5 × IQR = 11 + 1.5 × 8 = 23. The value 100 is above it, so the 1.5 × IQR rule flags it as an outlier.

Quartile calculator box plot of 1, 3, 5, 7, 9, 11 and 100: Q1 = 3, median 7, Q3 = 11, interquartile range 8, upper fence 23, and 100 marked as an outlier beyond the fence.
The box spans the middle half of the data. 100 lies far beyond the upper fence of 23, so the 1.5 × IQR rule flags it.

The quartiles hardly notice the 100: replace it with 13 and Q3 is still 11. The mean and the standard deviation do notice it, which is why skewed data is often summed up with the median and the IQR instead.

Why quartile methods give different answers

Take the calculator's default data, 11 values from 6 to 49. The median is 40 under every method, but Q1 and Q3 move depending on what happens to that middle value.

Three quartile methods on 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49: median left out gives Q1 15 and Q3 43, median included and QUARTILE.INC interpolation both give Q1 25.5 and Q3 42.5.
With an odd number of values, where the median goes changes Q1 from 15 to 25.5.

The interpolation method treats Q1 and Q3 as the 25th and 75th percentiles, with the same rank formula as the percentile calculator. The gap between methods shrinks as the data set grows.

Quartile practice question

Find Q1, the median, Q3 and the interquartile range of 12, 15, 11, 18, 20, 14, 17 and 13.

Check your answer

Answer: Q1 = 12.5, Q2 = 14.5, Q3 = 17.5

  1. Put the values in order, smallest first

    11, 12, 13, 14, 15, 17, 18, 20

  2. Find the median (Q2)

    There are 8 values, so take the mean of the 4th and 5th: (14 + 15) ÷ 2 = 14.5

  3. Split the data into a lower half and an upper half

    Lower half: 11, 12, 13, 14

    Upper half: 15, 17, 18, 20

    With an even number of values the data splits cleanly down the middle.

  4. Q1 is the median of the lower half

    There are 4 values, so take the mean of the 2nd and 3rd: (12 + 13) ÷ 2 = 12.5

  5. Q3 is the median of the upper half

    There are 4 values, so take the mean of the 2nd and 3rd: (17 + 18) ÷ 2 = 17.5

  6. Subtract to get the interquartile range

    IQR = Q3 − Q1 = 17.5 − 12.5 = 5

    The IQR is the spread of the middle half of the data.

Questions about quartiles

How do you find the quartiles of a data set?

Put the values in order and find the median. That is Q2. Split the data into a lower half and an upper half. The median of the lower half is Q1 and the median of the upper half is Q3.

Why do different calculators give different quartiles?

There is more than one accepted method. They differ in what to do with the median when the number of values is odd, and in whether to interpolate between values.

For 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49, leaving the median out of the halves gives Q1 = 15 and Q3 = 43, while including it gives Q1 = 25.5 and Q3 = 42.5. Use the method your course or software uses.

Which method does this calculator use by default?

The median of each half with the overall median left out, which is the method in OpenStax Introductory Statistics and in many school courses. The Method menu also offers the version that includes the median in both halves and the linear interpolation used by spreadsheet QUARTILE.INC functions.

What is the interquartile range?

IQR = Q3 − Q1. It is the spread of the middle half of the data. Unlike the range, it is not affected by one unusually large or small value.

How do you use quartiles to find outliers?

A common rule flags any value below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. The calculator shows these two fences and lists the values outside them.

Sources