Skip to content

Quartile Calculator – IQR and Five-Number Summary

Updated:

Enter your data set to instantly get the five-number summary (minimum, Q1, median, Q3, maximum), the interquartile range, Tukey outlier fences, a box plot and a step-by-step explanation. Choose between three quartile methods.

Find Quartiles, the IQR and Outliers of Your Data

Input Fields
If enabled, the result will update automatically when you change any value.

Quartiles Formula

Formula
\[ \text{Five-number summary} = \bigl(\min,\; Q_1,\; \text{median} = Q_2,\; Q_3,\; \max\bigr) \] \[ \text{IQR} = Q_3 - Q_1 \] \[ \text{lower fence} = Q_1 - 1.5 \cdot \text{IQR}, \qquad \text{upper fence} = Q_3 + 1.5 \cdot \text{IQR} \]

Where:

  • \(Q_1\) — first quartile: the median of the lower half of the sorted data (25% of values lie below it)
  • \(Q_2\) — second quartile, i.e. the median of the whole data set
  • \(Q_3\) — third quartile: the median of the upper half (75% of values lie below it)
  • \(\text{IQR}\) — interquartile range: the width of the middle 50% of the data

A value is flagged as an outlier by Tukey's 1.5·IQR rule when it falls below the lower fence or above the upper fence.

Quartiles – Calculation Example

Example: find the quartiles, IQR and outliers of the data 3, 7, 8, 5, 12, 14, 21, 13, 18 using the exclusive (Tukey) method, which is the calculator's default.

Sorted data (n = 9): 3, 5, 7, 8, 12, 13, 14, 18, 21

\[ Q_2 = 12 \quad \text{(the middle, i.e. 5th value)} \]

\[ Q_1 = \frac{5 + 7}{2} = 6 \quad \text{(median of the lower half 3, 5, 7, 8)} \]

\[ Q_3 = \frac{14 + 18}{2} = 16 \quad \text{(median of the upper half 13, 14, 18, 21)} \]

\[ \text{IQR} = 16 - 6 = 10 \]

\[ \text{lower fence} = 6 - 1.5 \times 10 = -9, \qquad \text{upper fence} = 16 + 1.5 \times 10 = 31 \]

Result: five-number summary (3, 6, 12, 16, 21); IQR = 10. All values lie inside the fences [−9, 31], so there are no outliers. The range is 21 − 3 = 18.

How to use the calculator

  1. Type or paste your numbers into the Data values field. Separate them with commas, spaces or new lines; empty entries are ignored and up to 500 values are accepted.
  2. Choose a Quartile method from the dropdown: Exclusive — median of halves (Tukey), Inclusive — median included in both halves, or Linear interpolation — Excel QUARTILE.INC (R type 7).
  3. Read the results: the sorted data, the count, the full five-number summary, the range, the IQR and the outlier fences.
  4. Check the Outliers line to see which values (if any) fall outside the fences, and look at the box plot for a visual picture of the distribution.
  5. Open How the quartiles were found to follow the exact steps the calculator used for your chosen method — handy for homework or verification.

What quartiles and the IQR tell you

Quartiles split a sorted data set into four roughly equal parts. The first quartile \(Q_1\) marks the point below which 25% of the values fall, the median \(Q_2\) marks 50%, and the third quartile \(Q_3\) marks 75%. Together with the minimum and maximum they form the five-number summary, a compact description of a distribution that works even when you only have a rough idea of the data.

The interquartile range, \( \text{IQR} = Q_3 - Q_1 \), measures the spread of the middle 50% of the data. Because it ignores the lowest and highest quarters, it is a robust measure of spread: a few extreme values barely move it, whereas they can inflate the range or the standard deviation dramatically. This makes the IQR the preferred spread measure for skewed data such as incomes, house prices or response times.

The IQR also powers the standard outlier detection rule. Values outside \( [Q_1 - 1.5\,\text{IQR},\; Q_3 + 1.5\,\text{IQR}] \) are considered unusually far from the bulk of the data. On a box plot these points appear as individual dots beyond the whiskers, and you should investigate them before deciding whether they are errors, rare events, or legitimate extremes that belong in the analysis.

A quick look at a box plot built from the five numbers tells you a lot: if the median sits near the middle of the box the distribution is roughly symmetric in its centre; if it hugs one end the middle of the data is skewed in that direction. To quantify asymmetry more precisely, see the Skewness and Kurtosis Calculator.

Quartile methods, assumptions and practical tips

Unlike the median, quartiles have no single universally agreed definition, which is why the calculator offers three methods:

  • Exclusive (Tukey): the median is excluded from both halves when the count is odd. This is the method behind classic box plots and many textbooks.
  • Inclusive: the median is included in both halves when the count is odd. It gives slightly narrower quartiles for odd-sized samples.
  • Linear interpolation (R type 7): quartiles are interpolated between data points at fixed positions. This is what Excel's QUARTILE.INC, R's quantile() and NumPy's default percentile() produce, so use it when you need to match those programs.

The differences between the methods shrink as the sample grows, but with small data sets they can shift \(Q_1\), \(Q_3\), the IQR and the fences enough to change which points count as outliers. If you are comparing your results against a spreadsheet or a statistics package, first check that you have selected the same method.

A few things to keep in mind when interpreting the results:

  • The 1.5·IQR rule is a convention, not a law. For very large or heavy-tailed data sets, flagging values as "outliers" is normal and does not automatically mean anything is wrong.
  • Quartiles say nothing about the shape between the quarter marks; two very different distributions can share the same five-number summary.
  • The calculator assumes plain numeric data. If your values come in groups or with frequencies, expand them into individual entries first.
  • If you need an arbitrary percentile rather than specifically Q1/Q3, the Percentile Calculator supports nine interpolation methods; for other summary statistics such as mean, median and mode, see the Median and Mode Calculator.

Once you have identified outliers and a robust spread, you may want to describe the data further — for example with the Coefficient of Variation Calculator to compare variability between data sets measured on the same scale.

Frequently Asked Questions

How do I find Q1 and Q3 when the data set has an even number of values?

Sort the data, then split it into two equal halves. With an even count, the overall median is not a data point, so both the exclusive and inclusive methods work the same way: take the median of the lower half for \(Q_1\) and the median of the upper half for \(Q_3\). If a half has an even number of values, its median is the average of the two middle ones. Example: for 2, 4, 6, 8, 10, 12, Q1 = 4 and Q3 = 10, since each half has three values.

Why do I get different quartiles in Excel, on my TI-84, and here?

There is no single official definition of a quartile. Excel's QUARTILE.INC and R use linear interpolation (R type 7); TI calculators use an exclusive median-of-halves rule; Minitab and others differ again. The gaps are largest on small data sets and shrink as n grows. If your answer must match a specific tool, pick the same method here — use "Linear interpolation" to match Excel.

Do I need to sort my numbers before entering them?

No, order does not matter. The calculator sorts the values internally before computing anything, so 3, 7, 8 and 8, 3, 7 give identical results. Sorting by hand is only useful when you want to follow the step-by-step explanation on paper or verify the five-number summary yourself.

What is a good or normal IQR value?

There is no universal "good" IQR — it depends entirely on the scale of your data. An IQR of 5 is tiny for salaries in dollars but huge for exam grades out of 10. The IQR is best used comparatively: a smaller IQR means the middle 50% of values are more tightly clustered, a larger one means more spread. To compare variability across data sets measured on the same scale, divide the IQR by the median.

Can the IQR be zero or negative?

The IQR can never be negative because \(Q_3\) is always at least as large as \(Q_1\). It can equal zero when at least 25% of the values at both ends are identical — for example, many identical exam scores. A zero IQR means the middle half of the data is concentrated at a single value; the 1.5·IQR fences then collapse to that same value, so anything different gets flagged as an outlier. Interpret such results carefully.

Should I delete the outliers the calculator finds?

Not automatically. A value outside the 1.5·IQR fences is simply unusually far from the bulk of the data — it may be a data-entry error, a genuinely rare but valid observation, or evidence that heavy tails are normal for your variable (as with incomes). Check the source of each flagged point before removing it, and if you do exclude any, report both the original and the cleaned results.

How do I enter data that comes with frequencies, like "5 appears 3 times"?

The calculator works with a plain list of values, so you must expand grouped data first — enter 5 three times (5, 5, 5), 12 twice if it has frequency 2, and so on. Sorting and duplicates are handled automatically, and repeated values are perfectly fine. Alternatively, compute Q1 and Q3 from a cumulative frequency table by hand: find where 25% and 75% of the total frequency fall, then read off or interpolate the corresponding values.

Leave a Reply

Your email address will not be published. Required fields are marked *