Sizely
Quartile Calculator

Quartile Calculator

Quartile calculator: find Q1, Q2 (the median), Q3 and the IQR of a data set, plus the minimum, maximum and range. Learn the method with a box plot.

Alize Mendez

Written by

Alize Mendez

Updated

There was an error with your calculation.

Quartile Calculator
Quartile Statistics
First Quartile (Q1) 30
Second Quartile (Q2) 55
Third Quartile (Q3) 80
Interquartile Range (IQR) 50
Median = Q2 (x˜) 55
Minimum 10
Maximum 100
Range (R) 90

Quartile calculator at a glance#

What are quartiles?#

Quartiles split sorted data into four parts with roughly the same number of values in each segment. The first quartile, Q1, has about a quarter of the data at or below it. The second quartile, Q2, is the median. The third quartile, Q3, has about a quarter of the data at or above it. The interquartile range (IQR) is calculated as Q3 − Q1.

How does this calculator find Q1 and Q3?#

The calculator sorts your numbers and takes the median to identify Q2. Q1 is determined as the median of the lower half of your data, and Q3 is the median of the upper half. If your data count is odd, the median is excluded from both halves. Different calculators and spreadsheets might apply other rules, so results can vary slightly.

What are the lower, middle and upper quartiles of 122, 164, 71, 98, 84, 147, 114, 111, 98, 85, 104, 71, 77?#

Q1 is 80.5, Q2 is 98, and Q3 is 118. When sorted, the 13 values range from 71 to 164, and the 7th value, 98, serves as the median. The lower six values are 71, 71, 77, 84, 85, and 98, with their median calculated as (77 + 84) ÷ 2 = 80.5. On the upper half, you have 104, 111, 114, 122, 147, and 164, with a median of (114 + 122) ÷ 2 = 118. The IQR is calculated as 118 − 80.5 = 37.5.

What quartiles tell you#

Imagine 11 students took a test and their scores were 52, 61, 64, 68, 70, 73, 75, 79, 83, 88, and 97. The quartile values are Q1 = 64, Q2 = 73, and Q3 = 83. About a quarter of the class scored 64 or less, half scored 73 or less, and a quarter scored 83 or more. The middle half of the class falls between 64 and 83, a spread of 19 points.

While the range considers only the lowest and highest scores, the IQR disregards extremes. If the top student had scored 100 instead of 97, the range would change but the quartiles would remain the same.

How to find quartiles by hand#

With an odd number of values#

Take the 11 test scores, already sorted:

  • First, identify the median. With 11 values, the middle one is the 6th value, which is 73. This is your Q2.
  • Next, separate the data at the median, leaving the median out. The lower half includes 52, 61, 64, 68, 70, and the upper half consists of 75, 79, 83, 88, 97.
  • Q1 corresponds to the median of the lower half, which is 64.
  • Q3 represents the median of the upper half, which is 83.

This method matches what the calculator uses and aligns with how OpenStax Introductory Statistics approaches quartiles: Q1 is the middle value of the lower data half, and Q3 is the middle value of the upper half.

With an even number of values#

Remove the score of 97, leaving you with 10 values: 52, 61, 64, 68, 70, 73, 75, 79, 83, 88. The data now splits evenly into two halves of five:

  • The median is calculated as the average of the two middle values: (70 + 73) ÷ 2 = 71.5.
  • The lower half includes 52, 61, 64, 68, 70, making Q1 equal to 64.
  • The upper half consists of 73, 75, 79, 83, 88, making Q3 equal to 79.

When dealing with halves that contain an even number of values, the median of each half is the average of its two middle values, similar to finding the median of the entire set.

11 sorted scores with the median 73 left out: the lower half 52, 61, 64, 68, 70 has median Q1 = 64 and the upper half 75, 79, 83, 88, 97 has median Q3 = 83. With 10 scores the median is 71.5, Q1 = 64 and Q3 = 79
Q1 and Q3 are the medians of the lower and upper halves.

Interquartile range and outliers#

The interquartile range is calculated as IQR = Q3 − Q1. For the 11 test scores, the IQR is 83 − 64, which equals 19 points. This measures the spread of the middle half of the data, ensuring that a single extreme score won't stretch it like it stretches the full range. The standard deviation calculator measures spread around the mean instead.

The IQR also provides a standard method for identifying outliers. According to OpenStax, a value is considered a potential outlier if it is more than 1.5 times the IQR below Q1 or above Q3. In the case of these test scores, 1.5 times 19 equals 28.5, making the fences 64 − 28.5 = 35.5 and 83 + 28.5 = 111.5. All scores fall within this range, indicating no outliers. The mean, median, and mode calculator uses this rule to automatically list any outliers.

Quartiles and the box plot#

A box plot illustrates the five-number summary: the minimum, Q1, the median, Q3, and the maximum. For the test scores, these values are 52, 64, 73, 83, and 97. The box extends from Q1 to Q3 with a line inside marking the median, while whiskers reach out to the smallest and largest scores.

Box plot of the scores 52, 61, 64, 68, 70, 73, 75, 79, 83, 88 and 97: whiskers from 52 to 97, a box from Q1 = 64 to Q3 = 83 with the median 73 inside, and IQR = 83 − 64 = 19
A box plot draws the five-number summary, and the box is the IQR.

The length of the box represents the IQR. When the median line is closer to one end of the box, the middle half of the data is more spread out on the other side. For these scores, the median of 73 is slightly nearer to Q1 than to Q3, indicating that the upper half of the middle scores is spread out only slightly more.

Why quartile calculators give different answers#

Quartiles lack a universally accepted formula. A 2006 article by Langford in the Journal of Statistics Education identifies at least twelve distinct methods employed across textbooks, calculators, and software. For smaller data sets, these methods can produce noticeably different results.

For the 11 test scores, excluding the median from both halves gives Q1 = 64 and Q3 = 83. Tukey's hinges, however, include the median in both halves, altering the lower segment to 52, 61, 64, 68, 70, 73 with Q1 = (64 + 68) ÷ 2 = 66 and Q3 = 81. Linear interpolation, the default method in R according to its documentation and the approach used by Excel's QUARTILE function according to Langford, also gives 66 and 81 in this case.

Why quartile calculators give different answers
MethodQ1Q3
Median of each half, median left out (this calculator)6483
Tukey's hinges, median in both halves6681
Linear interpolation (this site's percentile calculator)6681

The percentile calculator on this site employs linear interpolation, which means its 25th and 75th percentiles may not align with the quartiles displayed by this calculator. Neither result is incorrect. If a specific method is required by your class or software, use that method and clearly state which one was applied.

Quartiles for the examples on this page#

Each row here represents the outcome from the calculator for a specific data set.

Quartiles for the examples on this page
Data SetQ1Q2 (median)Q3Iqr
52, 61, 64, 68, 70, 73, 75, 79, 83, 88, 9764738319
52, 61, 64, 68, 70, 73, 75, 79, 83, 886471.57915
122, 164, 71, 98, 84, 147, 114, 111, 98, 85, 104, 71, 7780.59811837.5
5, 5, 5, 8, 9, 1256.594
10, 20, 30, 40, 50, 60, 70, 80, 90, 10030558050

Sources#

Frequently asked questions#

Is Q2 the same as the median?#

Yes, it is. The second quartile is the median, which is the middle value of your sorted data. In the calculator, it's displayed twice: as Q2 and as the median.

How do you find Q1 and Q3 with an even number of values?#

To determine these, divide the sorted data into two equal parts. Q1 is the median of the lower half, while Q3 is the median of the upper half. For 52, 61, 64, 68, 70, 73, 75, 79, 83, 88, the halves contain five values each, leading to Q1 = 64 and Q3 = 79.

What is the lower quartile?#

The lower quartile is also called the first quartile, Q1. It marks the point where about a quarter of the data falls at or below. On the other end, the upper quartile, Q3, has about a quarter of the data at or above it.

What does the interquartile range tell you?#

The interquartile range (IQR) measures the spread of the middle half of your data set. A small IQR indicates that these middle values are closely packed, while a large IQR suggests they're more spread out. Since the IQR leaves out the top and bottom quarters, it doesn't get thrown off by one exceptionally high or low value.

Can Q1 be equal to the minimum?#

Yes, this can happen when your data set has repeated low values. For example, given values 5, 5, 5, 8, 9, 12, the lower half would be 5, 5, 5, making Q1 equal to 5, which is the same as the minimum value.

How many numbers does the calculator need?#

You need a minimum of two numbers, separated by commas or spaces, for the calculator to work. It will sort these numbers automatically, so the original order doesn't affect the outcome.