Quartile Calculator | Find Q1, Q2, Q3 & IQR

Sort observations and compare quartile conventions before interpreting the middle half of a dataset.

Quick Answer

The first quartile, written as Q1, marks the point below which about 25% of the data lie. The second quartile, written as Q2, is the median, so about 50% of the data lie below it.

Wooden counters grouped into columns on graph paper
Free Statistics & Data Tool

Quartile Calculator

Use this Quartile Calculator to find Q1, Q2, Q3, interquartile range, lower fence, upper fence, outliers, five-number summary, range, mean, variance, standard deviation, and a quick box-plot visualization. Enter raw data separated by commas, spaces, or line breaks, then choose the quartile method that matches your class, textbook, spreadsheet, or statistical convention.

Calculate Quartiles, IQR, and Outliers

Paste or type your data values below. The calculator sorts the data, calculates quartiles, identifies outliers using the 1.5 × IQR rule, and shows a five-number summary.

Method note: different textbooks and software can define quartiles slightly differently. Choose the method your teacher, exam board, spreadsheet, or data-analysis workflow expects.

What Is a Quartile Calculator?

A Quartile Calculator is a statistics tool that divides a data set into four ordered parts. The main quartiles are called the first quartile, second quartile, and third quartile. The first quartile, written as Q1, marks the point below which about 25% of the data lie. The second quartile, written as Q2, is the median, so about 50% of the data lie below it. The third quartile, written as Q3, marks the point below which about 75% of the data lie. Together, quartiles help describe the spread, center, and structure of a data set.

Quartiles are especially useful because they are resistant to extreme values. The mean can be pulled heavily by one unusually high or low number, but the median and quartiles are based on position in the sorted data. This makes quartiles helpful for exam scores, incomes, house prices, delivery times, website performance metrics, biological measurements, business revenue, survey responses, and many real-world data sets where outliers exist.

This calculator does more than return Q1, Q2, and Q3. It also calculates the interquartile range, or IQR, which is the distance between Q1 and Q3. The IQR measures the spread of the middle 50% of the data. It also calculates lower and upper outlier fences using the common 1.5 × IQR rule, flags possible outliers, reports the five-number summary, and shows a box-plot preview. These extra outputs make the page useful for students, teachers, researchers, data analysts, bloggers, and anyone learning descriptive statistics.

The calculator supports multiple quartile methods because quartiles are not defined identically in every textbook or software package. Some classes use the median-of-halves method and exclude the overall median from the lower and upper halves when the sample size is odd. Some include the median in both halves. Some software uses interpolation, where quartiles may fall between two data values. Spreadsheet tools such as Excel have inclusive and exclusive quartile functions. This calculator gives users control over the method so the result can match the expected convention.

How to Use the Quartile Calculator

Start by entering the data set into the input box. You can separate values with commas, spaces, or line breaks. For example, all of these formats work: 5, 8, 9, 12, 5 8 9 12, or one value per line. The calculator ignores extra spaces and reads negative numbers and decimals as valid numerical values. Avoid adding words, currency symbols, percent signs, or units inside the data field because those can make a value unreadable.

Next, choose the quartile method. If your teacher or textbook says to split the data into lower and upper halves, choose one of the median-of-halves options. If your assignment follows spreadsheet-style percentile calculations, choose Excel inclusive or Excel exclusive. If you are doing general exploratory data analysis and want a smooth percentile-style result, the linear interpolation method is often useful. When in doubt for schoolwork, follow the method shown by your teacher or course material.

Choose the number of decimal places. This affects how the final output is displayed, not the internal calculation. For example, a result of 13.666666 can be shown as 13.67 with two decimal places or 13.667 with three decimal places. For official homework or exam answers, follow the required rounding rule.

Select an outlier rule. The standard setting is the 1.5 × IQR rule, which is commonly used for box plots. You may also choose 3 × IQR for extreme outliers or turn outlier flagging off. After entering the data and settings, click Calculate Quartiles. The result panel will show Q1, median, Q3, IQR, outliers, five-number summary, and a visual box plot.

Quartile Calculator Formulas

The first step in every quartile calculation is sorting the data from smallest to largest:

Sorted data
\[x_{(1)}\le x_{(2)}\le x_{(3)}\le\cdots\le x_{(n)}\]

The median, or second quartile, is the middle value of the sorted data. If there are an odd number of observations, the median is the middle observation. If there are an even number of observations, the median is the average of the two middle observations.

Median for odd sample size
\[Q_2=x_{\left(\frac{n+1}{2}\right)}\]
Median for even sample size
\[Q_2=\frac{x_{(n/2)}+x_{(n/2+1)}}{2}\]

The interquartile range is the distance between the third quartile and the first quartile:

Interquartile range
\[IQR=Q_3-Q_1\]

The standard outlier fences are calculated as:

Outlier fences
\[\text{Lower Fence}=Q_1-1.5(IQR),\quad \text{Upper Fence}=Q_3+1.5(IQR)\]

Any value below the lower fence or above the upper fence is often flagged as a possible outlier:

Outlier condition
\[x<\text{Lower Fence}\quad\text{or}\quad x>\text{Upper Fence}\]

The range is the total spread from minimum to maximum:

Range
\[\text{Range}=\max(x)-\min(x)\]

Quartile Methods Explained

Quartile calculation can be confusing because there is more than one accepted convention. This does not mean one method is always wrong. It means quartiles are a positional summary, and different statistical traditions define the quartile positions differently. The results are usually close for large data sets, but they can differ noticeably for small data sets.

Median of Halves - Exclude Median

In this method, the data are sorted, the overall median is found, and then the lower and upper halves are formed. When the data set has an odd number of values, the median is excluded from both halves. Q1 is the median of the lower half, and Q3 is the median of the upper half. This method is common in many school statistics courses because it is easy to perform by hand.

Median of Halves - Include Median

In this method, when the data set has an odd number of values, the overall median is included in both the lower and upper halves. This can shift Q1 and Q3 closer to the center compared with the exclude-median method. Some textbooks and calculators use this approach, so it is useful to have as an option.

Linear Interpolation / Percentile Method

The linear interpolation method treats Q1 and Q3 as percentile positions. If a quartile position falls between two ordered data values, the calculator interpolates between them. This can produce quartile values that are not directly present in the original data set. That is normal. Interpolation is common in software-based statistics because it creates smoother percentile estimates.

Excel QUARTILE.INC and QUARTILE.EXC

Spreadsheet software often uses inclusive and exclusive percentile definitions. QUARTILE.INC includes the endpoints of the data range when estimating quartiles. QUARTILE.EXC excludes endpoints in its percentile position logic. The two can return different results, especially for small samples. If your assignment or workflow says to match Excel, choose the corresponding option.

Interquartile Range and Outliers

The interquartile range, or IQR, is one of the most important outputs of a quartile calculation. It measures the spread of the middle half of the data. Because it ignores the lowest 25% and highest 25% of positions, it is much less sensitive to extreme values than the full range. For example, if one data value is extremely large, the maximum and range can become huge, but Q1, Q3, and IQR may remain more representative of the typical data spread.

The IQR is commonly used to create box plots. A box plot shows the minimum, Q1, median, Q3, and maximum. The box runs from Q1 to Q3, and the median is drawn inside the box. Whiskers extend toward smaller and larger values. When outliers are present, some box plots place whiskers at the most extreme non-outlier values and plot outliers as separate points.

The common 1.5 × IQR outlier rule is a screening rule, not an automatic proof that a value is wrong. A data point outside the fences may be a data-entry error, a rare but valid observation, a meaningful special case, or evidence that the distribution has a long tail. Outliers should be investigated, not deleted automatically. In scientific and business work, removing outliers without a defensible reason can distort conclusions.

Five-Number Summary and Box Plots

The five-number summary consists of minimum, Q1, median, Q3, and maximum. It gives a compact description of the distribution. The minimum and maximum show the full observed span. Q1 and Q3 show the middle spread. The median shows the center. Together, these five numbers are enough to draw a basic box plot.

Box plots are useful for comparing distributions. For example, a teacher can compare test-score distributions between two classes. A business analyst can compare delivery times before and after a process change. A website owner can compare page-load times across devices. A health researcher can compare measurements across groups. Since box plots show center, spread, and outliers in one visual, they are excellent for quick exploratory analysis.

When reading a box plot, a wide box means the middle 50% of the data are spread out. A narrow box means the middle 50% are clustered. If the median is closer to Q1 than Q3, the upper half of the central data may be more spread out. If one whisker is much longer than the other, the distribution may be skewed. Outlier points can indicate unusual observations that deserve closer review.

Quartile Calculation Example

Suppose the data set is:

Example data
\[7,12,13,16,20,21,22,25,30,35\]

The data are already sorted and there are 10 values. The median is the average of the 5th and 6th values:

Median example
\[Q_2=\frac{20+21}{2}=20.5\]

Using the median-of-halves method, the lower half is 7, 12, 13, 16, 20. The median of that lower half is 13, so Q1 is 13. The upper half is 21, 22, 25, 30, 35. The median of that upper half is 25, so Q3 is 25.

Quartiles example
\[Q_1=13,\quad Q_2=20.5,\quad Q_3=25\]

The interquartile range is:

IQR example
\[IQR=25-13=12\]

Using the 1.5 × IQR rule, the fences are:

Fence example
\[\text{Lower Fence}=13-1.5(12)=-5,\quad \text{Upper Fence}=25+1.5(12)=43\]

Because all values fall between −5 and 43, there are no outliers by this rule. The five-number summary is 7, 13, 20.5, 25, 35.

StatisticValueMeaning
Minimum7Smallest data value
Q113Lower quartile; about 25% of data are at or below this point
Q2 / Median20.5Middle of the data
Q325Upper quartile; about 75% of data are at or below this point
Maximum35Largest data value
IQR12Spread of the middle 50%

Common Quartile Mistakes

The first common mistake is calculating quartiles before sorting the data. Quartiles are based on ordered positions, so unsorted data will produce incorrect results. Always sort from smallest to largest before locating Q1, Q2, and Q3.

The second mistake is mixing quartile methods. A student may use the exclude-median method for Q1 and a percentile method for Q3 without realizing it. This creates inconsistent answers. Choose one method and use it throughout the calculation.

The third mistake is treating outliers as automatically invalid. The IQR rule only flags values that are unusually far from the middle 50% of the data. A flagged value might be a valid rare observation. Always check the context before removing it.

The fourth mistake is assuming the median and mean tell the same story. In skewed data, the mean can move toward extreme values while the median remains more central. Quartiles help reveal that difference by showing how values are distributed across the data set.

Quartile Calculator FAQs

What does a quartile calculator do?

It calculates Q1, Q2, Q3, interquartile range, outlier fences, possible outliers, five-number summary, and other descriptive statistics from a data set.

What is Q1?

Q1 is the first quartile. It marks the lower quartile position, where about 25% of the ordered data lie at or below that value.

What is Q2?

Q2 is the second quartile, also called the median. It is the middle value of the sorted data.

What is Q3?

Q3 is the third quartile. It marks the upper quartile position, where about 75% of the ordered data lie at or below that value.

What is IQR?

IQR means interquartile range. It is calculated as Q3 − Q1 and measures the spread of the middle 50% of the data.

Why do different calculators give different quartiles?

Different calculators may use different quartile definitions, such as median-of-halves, inclusive percentile, exclusive percentile, or linear interpolation.

How are outliers found using quartiles?

A common rule flags values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR as possible outliers.

Important Note

This Quartile Calculator is for educational, statistical, and general data-analysis use. It provides formula-based descriptive statistics, but formal research, grading, business reporting, and exam work should follow the quartile method required by the relevant teacher, textbook, software standard, or statistical protocol.

Advertisement

Find a five-number summary by hand

Take the ordered values 2, 4, 5, 7, 9, 11, 12 and 18. The median is halfway between 7 and 9, so it is 8. Using medians of the two halves gives a lower quartile of 4.5 and an upper quartile of 11.5. Their difference is 7. State the convention with your result because interpolation rules can give different answers for a small sample.

Finding Percentiles

There are some other terms that are related to "percentile" with meanings you may infer from their roots. Remember that the word percent means “per hundred.” This reflects that percentiles divide our data into 100 pieces. The word quartile has a root that means “four.” So, if a data value is at the first quantile of a dataset, that means that if you break the data into four parts (because of the quart-), this data value comes after the first of those four parts. In other words, it’s greater than 25% of the data, placing it at the 25th percentile. Quintile has a root meaning “five,” so a data value at the third quintile is greater than three-fifths of the data in the set. That would put it at the 60th percentile. The general term for these is quantiles (the root quant– means “number”).
In Mean, Median, and Mode, we defined the median as a number that is greater than no more than half of the data in a dataset and is less than no more than half of the data in the dataset. With our new term, we can more easily define it: The median is the value at the 50th percentile (or second quartile).
Let’s look at some examples.

Finding Percentiles

Consider the dataset 5, 8, 12, 1, 2, 16, 2, 15, 20, 22.
  1. At what percentile is the value 5?
  2. What value is at the 60th percentile?
Solution
Before we can answer these two questions, we must put the data in increasing order: 1, 2, 2, 5, 8, 12, 15, 16, 20, 22.
  1. There are three values (1, 2, and 2) in the set that are less than 5, and there are ten values in the set. Thus, 5 is at the 310×100=30th percentile.
  2. To find the value at the 60th percentile, we note that there are ten data values, and 60% of ten is six. Thus, the number we want is greater than exactly six of the data values. Thus, the 60th percentile is 15.
In each of the examples above, the computations were made easier by the fact that the we were looking for percentiles that “came out evenly” with respect to the number of values in our dataset. Things don’t always work out so cleanly. Further, different sources will define the term percentile in different ways. In fact, Google Sheets has three built-in functions for finding percentiles, none of which uses our definition. Some of the definitions you’ll see differ in the inequality that is used. Ours uses “less than or equal to,” while others use “less than” (these correspond roughly to Google Sheets’ ‘PERCENTILE.INC’ and ‘PERCENTILE.EXC’). Some of them use different methods for interpolating values. (This is what we did when we first computed medians without technology; if there were an even number of data values in our dataset, found the mean of the two values in the middle. This is an example of interpolation. Most computerized methods use this technique.) Other definitions don’t interpolate at all, but instead choose the closest actual data value to the theoretical value. Fortunately, for large datasets, the differences among the different techniques become very small.
So, with all these different possible definitions in play, what will we use? For small datasets, if you’re asked to compute something involving percentiles without technology , use the technique we used in the previous example. In all other cases, we’ll keep things simple by using the built-in ‘PERCENTILE’ and ‘PERCENTRANK’ functions in Google Sheets (which do the same thing as the ‘PERCENTILE.INC’ and ‘PERCENTRANK.INC’ functions; they’re “inclusive, interpolating” definitions).

Using Google Sheets to Compute Percentiles: Average SAT Scores

The data in “AvgSAT” contains the average SAT score for students attending every institution of higher learning in the US for which data is available.
  1. What score is at the 3rd quartile?
  2. What score is at the 40th percentile?
  3. At what percentile is Albion College in Michigan (average SAT: 1132)?
  4. At what percentile is Oregon State University (average SAT: 1205)?
Solution
  1. The 3rd quartile is the 75th percentile, so we’ll use the PERCENTILE function. Click on an empty cell, and type “=PERCENTILE(“. Next, enter the data: click on the letter at the top of the column containing the average SAT scores. Then, tell the function which percentile we want; it needs to be entered as a decimal. So, type a comma (to separate the two pieces of information we’re giving this function), then type “0.75” and close the parentheses with “)”. The result should look like this (assuming the data are in column C): “=PERCENTILE(C:C, 0.75)”. When you hit the enter key, the formula will be replaced with the average SAT score at the 75th percentile: 1199.
  2. Using the PERCENTILE function, we find that an average SAT of 1100 is at the 40th percentile.
  3. Since we want to know the percentile for a particular score, we’ll use the PERCENTRANK function. Like the PERCENTILE function, we need to give PERCENTRANK two pieces of information: the data, and the value we care about. So, click on an empty cell, type “=PERCENTRANK(“, and then click on the letter at the top of the column containing the data. Next, type a comma and then the value we want to find the percentile for; in this case, we’ll type “, 1132”. Finally, close the parentheses with “)” and hit the enter key. The formula will be replaced with the information we want: an average SAT of 1132 is at the 54th percentile.
  4. Using the PERCENTRANK function, an average SAT of 1205 is at the 76.1th percentile.

Using Google Sheets to Compute Percentiles: In-State Tuition

The dataset "InState" contains the in-state tuitions of every college and university in the country that reported that data to the Department of Education. Use that dataset to answer these questions.
  1. What tuition is at the second quintile?
  2. What tuition is at the 95th percentile?
  3. At what percentile is Walla Walla University in Washington (in-state tuition: $28,035)?
  4. At what percentile is the College of Saint Mary in Nebraska (in-state tuition: $20,350)?
Solution
  1. The second quintile is the 40th percentile; using PERCENTILE in Google Sheets, we get $8,400.
  2. Using PERCENTILE again, we get $44,866.
  3. Using PERCENTRANK, we get the 81.6th percentile.
  4. Using PERCENTRANK, we get the 74.8th percentile.

The Range

Our first measure of dispersion is the range, or the difference between the maximum and minimum values in the set. It’s the measure we used in the standardized test example above.
Let’s look at a couple of examples.

Finding the Range

You survey some of your friends to find out how many hours they work each week. Their responses are: 5, 20, 8, 10, 35, 12. What is the range?
Solution
The maximum value in the set is 35 and the minimum is 5, so the range is 35-5=30.
For large datasets, finding the maximum and minimum values can be daunting. There are two ways to do it in a spreadsheet. First, you can ask the spreadsheet program to sort the data from smallest to largest, then find the first and last numbers on the sorted list. The second method uses built-in functions to find the minimum and maximum.
In either method, once you’ve found the maximum and minimum, all you have to do is subtract to find the range.

Finding the Range with Google Sheets

The data in “AvgSAT” contains the average SAT score for students attending every institution of higher learning in the US for which data is available. What is the range of these average SAT scores?
Solution
Step 1: To find the maximum, click on an empty cell in the spreadsheet, type “=MAX(”, and then click on the letter that marks the top of the column containing the AvgSAT data. That inserts a reference to the column into our function. Then we close the parentheses and hit the enter key. The formula is replaced with the maximum value in our data: 1566. Step 2: Using the same process (but with “MIN” instead of “MAX”), we find the minimum value is 785. Step 3: So, the range is 1566-785=781.
The range is very easy to compute, but it depends only on two of the data values in the entire set. If there happens to be just one unusually high or low data value, then the range might give a distorted measure of dispersion. Our next measure takes every single data value into account, making it more reliable.

The Standard Deviation

The standard deviation is a measure of dispersion that can be interpreted as approximately the average distance of every data value from the mean. (This distance from the mean is the “deviation” in “standard deviation.”)
To compute the standard deviation using the formula, we follow the steps below:
  1. Compute the mean of all the data values.
  2. Subtract the mean from each data value.
  3. Square those differences.
  4. Add up the results in step 3.
  5. Divide the result in step 4 by n-1
  6. Take the square root of the result in step 5.
Let’s see that process in action.

Computing the Standard Deviation

You surveyed some of your friends to find out how many hours they work each week. Their responses were: 5, 20, 8, 10, 35, 12. What is the standard deviation?
Solution
Let’s follow the six steps mentioned previously to compute the standard deviation.
Step 1: Find the mean: x¯=5+20+8+10+35+126=15.
Step 2: Subtract the mean from each data value. To help keep track, let’s do this in a table. In the first row, we’ll list each of our data values (and we’ll label the row x); in the second, we’ll subtract x¯=15 from each data value.
x 5 20 8 10 35 12
x−x¯ −10 5 –7 –5 20 –3
Step 3: Square the differences. Let’s add a row to our table for those values:
x 5 20 8 10 35 12
x−x¯ −10 5 –7 –5 20 –3
(x−x¯)2 100 25 49 25 400 9
Step 4: Add up those squares: 100 + 25 + 49 + 25 + 400 + 9 = 608.
Step 5: Divide the sum by n-1. Since we have 6 data values, that gives us 6086-1=121.6.
Step 6: Take the square root of the result: 121.6≈11.027.
Thus, the standard deviation is s≈11.027.
The computation for the standard deviation is complicated, even for just a small dataset. We’d never want to compute it without technology for a large dataset! Luckily, technology makes this calculation easy.

Finding the Standard Deviation with Google Sheets

The data in “AvgSAT” contains the average SAT score for students attending every institution of higher learning in the US for which data is available. What is the standard deviation of these average SAT scores?
Solution
To find the standard deviation, we click in an empty cell in our spreadsheet and then type “=STDEV(”. Next, click on the letter at the top of the column containing our data; this will put a reference to that column into our formula. Then close the parentheses with and hit the enter key. The formula is replaced with the result: 125.517.