Quartile and IQR Calculator

Your values

Separate numbers with spaces, commas, semicolons or line breaks, or paste a spreadsheet column. Use a decimal comma only when values are separated by spaces, semicolons or line breaks. Up to 10,000 numbers.

Method

Median of each half, leaving out the median when the count is odd. Used by TI-83/84 calculators and many textbooks.

Result

First quartile (Q1)

Median (Q2)

Third quartile (Q3)

Interquartile range (IQR)
Lower fence
Upper fence
Outliers
30

Five-number summary

MinQ1MedianQ3Max
2691230
Box plotOpen circles mark the outliers beyond the 1.5 × IQR fences: 1 in total.

Quartiles by method

MethodQ1Q3IQR
Exclusive (TI-84)6126
Inclusive (Tukey)6.511.55
Excel .INC / NumPy6.511.55
Excel .EXC6126

Methods can disagree for small data sets; the differences shrink as the data set grows.

Sorted data (n = 11)

2, 5, 6, 7, 8, 9, 10, 11, 12, 14, 30

Step by step

  1. Q2: the count is odd, so the median is the middle value of the sorted list.
    Q2=x6=9Q_2=x_{6}=9
  2. Q1 and Q3: take the median of the lower and upper halves, leaving the middle value out of both.
    Q1=med⁡(x1,…,x5)=6Q_1=\operatorname{med}(x_{1},\ldots,x_{5})=6
    Q3=med⁡(x7,…,x11)=12Q_3=\operatorname{med}(x_{7},\ldots,x_{11})=12
  3. Interquartile range: subtract Q1 from Q3.
    IQR=Q3−Q1=12−6=6\mathrm{IQR}=Q_3-Q_1=12-6=6
  4. Fences: go 1.5 IQR below Q1 and above Q3.
    Q1−1.5 IQR=6−1.5×6=−3Q_1-1.5\,\mathrm{IQR}=6-1.5\times6={-3}
    Q3+1.5 IQR=12+1.5×6=21Q_3+1.5\,\mathrm{IQR}=12+1.5\times6=21
  5. Values outside the fences are outliers: 30.

About this tool

Quartiles split a sorted data set into four parts with roughly a quarter of the values in each. The first quartile Q1 has a quarter of the data below it, the median Q2 half and the third quartile Q3 three quarters. The distance from Q1 to Q3, the interquartile range (IQR), measures the spread of the middle half of the data and is not affected by extreme values.

Together with the minimum and maximum, the quartiles form the five-number summary drawn in a box plot. Values more than 1.5 IQR below Q1 or above Q3 are flagged as outliers, following John Tukey's rule.

How it works

Type or paste your data, then choose a quartile method. The calculator sorts the values and shows the first quartile Q1, the median Q2 and the third quartile Q3, the interquartile range, the 1.5 × IQR fences with any outliers, the five-number summary and a box plot.

Quartiles have no single universal definition, and calculators, textbooks and spreadsheets use different rules. Pick the one you were taught: the median-of-halves methods are common in school and on TI calculators, while spreadsheets and NumPy interpolate between data points. The comparison table shows Q1, Q3 and the IQR under every method, so you can see at once whether the choice matters for your data.

IQR=Q3−Q1Q1−1.5 IQR,Q3+1.5 IQR\begin{gathered}\mathrm{IQR}=Q_3-Q_1\\[0.6em]Q_1-1.5\,\mathrm{IQR},\quad Q_3+1.5\,\mathrm{IQR}\end{gathered}

Example

For 7, 12, 5, 30, 9, 2, 11, 8, 14, 6, 10 the sorted list is 2, 5, 6, 7, 8, 9, 10, 11, 12, 14, 30, and the median is the 6th value, 9. With the exclusive method the lower half is 2, 5, 6, 7, 8, so Q1=6Q_1 = 6, and the upper half is 10, 11, 12, 14, 30, so Q3=12Q_3 = 12. The IQR is 12−6=612 - 6 = 6.

The fences are 6−1.5×6=−36 - 1.5 \times 6 = -3 and 12+1.5×6=2112 + 1.5 \times 6 = 21, so 30 is an outlier and the upper whisker ends at 14. Excel QUARTILE.INC gives Q1=6.5Q_1 = 6.5 and Q3=11.5Q_3 = 11.5 for the same data: the method changes the answer for small samples.

Assumptions and limits

No quartile method is the correct one; they are conventions that agree for large data sets and can differ noticeably for small ones. If your teacher, textbook or software expects specific values, choose the matching method. The 1.5 × IQR rule is a screening rule rather than a test: a flagged value is unusual, not necessarily an error, and it should not be removed without a reason.

The Excel QUARTILE.EXC method needs at least 3 values. Results use double-precision arithmetic and are shown to 10 significant digits.

Frequently asked questions

Why do different calculators give different quartiles?

Because there are several definitions. TI calculators take the median of each half and leave out the median when the count is odd, Tukey's hinges include it, and Excel, Google Sheets and NumPy interpolate between neighbouring values at positions based on n − 1 or n + 1. For large data sets the methods agree closely; for a dozen values they can differ by a whole data point.

How do I find outliers with the IQR?

Compute the fences Q1−1.5×IQRQ_1 - 1.5 \times \mathrm{IQR} and Q3+1.5×IQRQ_3 + 1.5 \times \mathrm{IQR}. Any value below the lower fence or above the upper fence is an outlier. Some texts call values beyond 3 IQR extreme outliers.

What is the five-number summary?

It is the minimum, Q1, the median, Q3 and the maximum. These five numbers describe the centre, the spread and the extremes of a data set, and they are exactly what a box plot draws.

How do I read a box plot?

The box runs from Q1 to Q3 with a line at the median, so it contains the middle half of the data. The whiskers reach the smallest and largest values that are not outliers, and outliers are drawn as separate points. A median off-centre in the box or one long whisker suggests skewed data.

Which method does Excel use?

QUARTILE and QUARTILE.INC interpolate at position (n − 1)p + 1, the same as Google Sheets and NumPy's default. QUARTILE.EXC uses position (n + 1)p, like Minitab and SPSS. Choose the matching method here to reproduce a spreadsheet result.

Link with your values

Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.

ParameterValueIf omitted
valuesData setvalues separated by commas: 2,4,4,6required
methodMethodone of: median_exclusive, median_inclusive, excel_inc, excel_excdefault median_exclusive

Examples

  • ?values=6,7,15,36,39,40,41,42,43,47,49&method=median_inclusive
  • ?values=1,2,3,4,5,6,7,8,9,10&method=excel_exc

Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.

Result elements: [data-result-block="quartile_calculator"]