Quartile Calculator

Enter your data

Enter at least 4 numbers. The calculator sorts the data, finds Q1, the median (Q2) and Q3 by three methods, then works out the IQR, fences and outliers.

Try:

Q1 = 7 · Median = 12 · Q3 = 14
Tukey (inclusive) quartiles · IQR = 7 · n = 9

Quartiles by method

Five-number summary, fences and outliers

Box plot (Tukey quartiles)

The box runs from Q1 to Q3, the dark line is the median, the whiskers reach the furthest values inside the 1.5×IQR fences, and dots show outliers (amber = mild, red = extreme).

Calculation ledger

A quartile calculator splits sorted data into four equal parts. Use the calculator above to find Q1, the median (Q2) and Q3 by three methods — exclusive (TI-84), inclusive (Tukey) and linear (Excel QUARTILE.INC) — plus the IQR, the five-number summary, 1.5×IQR and 3×IQR fences, flagged outliers and a box plot.

What Is a Quartile?

Quartiles are the three values that split a sorted dataset into four equal groups, each holding a quarter of the data. The first quartile (Q1) marks the 25th percentile, the second quartile (Q2) is the median or 50th percentile, and the third quartile (Q3) marks the 75th percentile. Together with the minimum and maximum, they form the five-number summary, which is the data behind every box plot.

Quartiles describe the centre and spread of data without being pulled around by extreme values. Because they depend on position rather than size, one very large value moves the mean far more than it moves Q1 or Q3 — which is exactly why quartiles and the IQR are the standard tools for spotting outliers.

How to Use the Quartile Calculator

  1. Paste your dataset into the box above, separating numbers with commas, spaces or line breaks. At least 4 numbers are needed.
  2. Click Calculate Quartiles. The calculator sorts the data and works out Q1, the median and Q3 by all three methods.
  3. Read the headline result (Tukey quartiles), then compare the three methods in the table and check the IQR, fences and flagged outliers.
  4. Use the box plot and the calculation ledger to check every step, or try one of the worked examples under the input box.

The Three Quartile Methods Compared

There is no single way to find quartiles, and that is why different tools can give different answers for the same data. The three methods below are the ones this calculator shows side by side. They always agree on the median; they differ only in how Q1 and Q3 are placed.

MethodAlso calledHow Q1 and Q3 are foundUsed by
ExclusiveTI-84, Moore & McCabeSplit the sorted data at the median, leave the median out, then take the median of each half.TI-84 calculators and many school textbooks
InclusiveTukey’s hingesSplit the sorted data at the median, keep the median in both halves, then take the median of each half.Tukey’s box plots, Minitab and many statistics courses
LinearExcel QUARTILE.INC, Type 7Interpolate between the two nearest values at the 25th and 75th percentile positions.Microsoft Excel, R and NumPy

Which method should you use? Match the method your teacher, textbook or software expects: use the exclusive method for TI-84 work, the linear method for Excel (QUARTILE.INC) and the inclusive (Tukey) method for box plots and the 1.5×IQR outlier rule. When in doubt, the Tukey quartiles are the safest default, because the fences in the 1.5×IQR rule are defined from them.

What Is the Interquartile Range (IQR)?

The interquartile range is the distance between the third and first quartiles: IQR = Q3 − Q1. It measures the spread of the middle half of the data, so it ignores the lowest and highest quarters entirely. A small IQR means the central values are close together; a large IQR means they are spread out.

Because the IQR is built from quartiles, it is resistant to outliers. Compare it with the standard deviation, which uses every value and grows quickly when one extreme value is added. If you need a single number for the spread of skewed data, the IQR is usually the better choice. You can work out the full spread of a dataset with our standard deviation calculator and compare the two measures side by side.

Why Do Different Quartile Calculators Give Different Answers?

Different quartile calculators give different answers because there is no single agreed definition of a quartile: the exclusive (TI-84), inclusive (Tukey) and linear (Excel) methods place Q1 and Q3 differently. The median is always the same; only Q1, Q3 and the IQR change. None of the methods is wrong — each is a convention. To reproduce a result, use the same method as the original calculation, and if you are comparing answers from two tools, check which method each one uses first.

For the dataset 3, 5, 7, 8, 12, 13, 14, 18, 21, for example, the exclusive method gives Q1 = 6 and Q3 = 16, while the inclusive and linear methods both give Q1 = 7 and Q3 = 14. The difference comes only from whether the median (12) is included in the halves or not. This calculator shows all three results so you can see exactly where the difference comes from.

What Is the 1.5×IQR Rule?

The 1.5×IQR rule is the standard test for outliers: a value is an outlier when it lies more than 1.5 × IQR below Q1 or above Q3. The fences are Q1 − 1.5 × IQR (the lower fence) and Q3 + 1.5 × IQR (the upper fence). A value outside the 1.5×IQR fences but inside the 3×IQR far fences is a mild outlier; a value beyond the 3×IQR far fences is an extreme outlier.

For example, with Q1 = 7 and Q3 = 14, the IQR is 7, so the fences are −3.5 and 24.5. Any value below −3.5 or above 24.5 would be flagged as an outlier. The rule is a guide, not a proof: a flagged value may be a genuine observation, so always check it against the data before deleting it. To run the same check from the other direction, use our Empirical Rule Outlier Detector, and read how to find outliers using the IQR for a worked, step-by-step example.

What Is the Five-Number Summary?

The five-number summary is the minimum, Q1, median, Q3 and maximum of a dataset. Those five numbers are the data a box plot draws: the whiskers reach the minimum and maximum (or the furthest values inside the fences), the box runs from Q1 to Q3, and a line inside the box marks the median. In other words, the five-number summary is the box plot’s data.

Read the box plot this way: a long box means the middle half of the data is spread out; a median line off-centre means the data is skewed; and points beyond the whiskers are the outliers the 1.5×IQR rule flagged.

Quartile Calculator Examples

Example 1 — odd count. For 3, 7, 8, 5, 12, 14, 21, 13, 18, the sorted data is 3, 5, 7, 8, 12, 13, 14, 18, 21. The median is 12. The Tukey quartiles are Q1 = 7 and Q3 = 14 (IQR = 7); the exclusive quartiles are Q1 = 6 and Q3 = 16 (IQR = 10); the linear quartiles are Q1 = 7 and Q3 = 14 (IQR = 7). The 1.5×IQR fences are −3.5 to 24.5, so there are no outliers.

Example 2 — even count. For 1, 2, 3, 4, 5, 6, 7, 8, the median is 4.5. Tukey and exclusive both give Q1 = 2.5 and Q3 = 6.5 (IQR = 4), while the linear method gives Q1 = 2.75 and Q3 = 6.25 (IQR = 3.5). The fences are −3.5 to 12.5, so again there are no outliers.

Example 3 — with an outlier. For 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, the median is 5.5, Tukey Q1 = 3 and Q3 = 8, so the IQR is 5. The 1.5×IQR fences are −4.5 to 15.5, and the 3×IQR far fence is 23, so 100 is flagged as an extreme outlier. You can confirm the same flag with our Outlier Threshold Calculator.

Quartile Calculator vs Other Tools

Quartiles answer one question: where does a value sit in a sorted list? Other tools answer different questions, so pick the one that matches what you need:

What you needUse this tool
Quartiles, IQR, fences, outliers and a box plot for a datasetQuartile Calculator (this page)
Flag outliers using the empirical rule and z-scoresflag outliers with the empirical rule
Find where a value sits in a normal distributionnormal distribution calculator
Work out probabilities between two valuesEmpirical Rule Probability Finder
Rank a score as a percentilework out a percentile rank

Frequently Asked Questions

What is a quartile?

A quartile is one of three values — Q1, the median (Q2) and Q3 — that split sorted data into four equal parts. Q1 is the 25th percentile, so a quarter of the values lie below it. The median is the 50th percentile, and Q3 is the 75th percentile, so three quarters of the values lie below Q3.

How do you find Q1, Q2 and Q3?

Sort the data from smallest to largest. The median of the whole dataset is Q2. Then take the median of the lower half for Q1 and the median of the upper half for Q3. The exact result depends on the method: the exclusive method leaves the median out of the halves, the inclusive (Tukey) method keeps it in both halves, and the linear method interpolates between values.

Why does my TI-84 give different quartiles than Excel?

Your TI-84 and Excel use different quartile methods. The TI-84 uses the exclusive method, which leaves the median out when it splits the data into halves, while Excel’s QUARTILE.INC uses the linear method, which interpolates between values. The median is the same in both; only Q1, Q3 and the IQR differ. This calculator shows all three methods so you can match the one your course or software expects.

What is the IQR?

The IQR, or interquartile range, is the difference between the third and first quartiles: IQR = Q3 − Q1. It measures how spread out the middle half of the data is. Unlike the range or the standard deviation, the IQR is not affected by extreme values, which is why it is the standard measure of spread for skewed data.

How do you find outliers using the IQR?

Use the 1.5×IQR rule. Work out the fences: the lower fence is Q1 − 1.5 × IQR and the upper fence is Q3 + 1.5 × IQR. Any value below the lower fence or above the upper fence is an outlier. Values beyond the 3×IQR far fences (Q1 − 3 × IQR and Q3 + 3 × IQR) are extreme outliers. You can also identify outliers using the empirical rule as a cross-check.

What is the difference between a mild and an extreme outlier?

A mild outlier lies outside the 1.5×IQR fences but inside the 3×IQR far fences, so it is unusual but not far from the rest of the data. An extreme outlier lies beyond the 3×IQR far fences, so it sits much further away. In the example 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, the value 100 is an extreme outlier because it is beyond the far fence of 23.

What is the five-number summary?

The five-number summary is the minimum, Q1, the median, Q3 and the maximum of a dataset. These five values are exactly the data a box plot draws: the whiskers reach the minimum and maximum, the box runs from Q1 to Q3, and a line inside the box marks the median.

Can quartiles be decimals?

Yes. A quartile is a decimal whenever it falls between two values — for example, the median of an even-sized dataset is the mean of the two middle values, and the linear method interpolates between values. For 1, 2, 3, 4, 5, 6, 7, 8, the median is 4.5 and the linear quartiles are 2.75 and 6.25.

Related Tools

If quartiles are only part of the picture, these tools complete it: the Empirical Rule Graph Generator draws the 68-95-99.7 curve for a normal distribution, and the Bell Curve Generator plots the distribution as a bell curve from a mean and standard deviation.

The quartile and IQR definitions on this page follow the NIST/SEMATECH e-Handbook of Statistical Methods, which defines the interquartile range as the difference between the 75th and 25th percentiles.