Quartile Calculator
Paste your numbers to get Q1, Q2 and Q3, the IQR, the outlier fences and a box plot.
https://flxcode.com/quartile-calculator/
Paste a column or row from Excel, Google Sheets or a CSV file, or type numbers separated by spaces, commas or new lines. A header word is ignored.
Example Quartiles
Quartiles, inclusive method
Read 12 numbers.
Textbooks, calculators and Excel use different quartile methods, so Q1 and Q3 can differ slightly for the same data.
| Q1 (25th percentile) | 9.75 |
|---|---|
| Q2 (median) | 12.5 |
| Q3 (75th percentile) | 16.5 |
| IQR (Q3 − Q1) | 6.75 |
| Smallest | 6 |
| Largest | 45 |
| Lower fence (Q1 − 1.5 × IQR) | -0.375 |
| Upper fence (Q3 + 1.5 × IQR) | 26.625 |
| Outliers | 45 |
| In Excel or Sheets | =QUARTILE.INC(A1:A12, 1) or =PERCENTILE.INC(A1:A12, 0.25) |
The steps, with your numbers
Sorted: 6, 7, 9, …, 21, 45
Q1: Rank = p × (n − 1) + 1 = 0.25 × 11 + 1 = 3.75, value 9.75
Q2 (median): 12.5
Q3: Rank = p × (n − 1) + 1 = 0.75 × 11 + 1 = 9.25, value 16.5
IQR = Q3 − Q1 = 16.5 − 9.75 = 6.75
Fences: 9.75 − 1.5 × 6.75 = -0.375 and 16.5 + 1.5 × 6.75 = 26.625. A value outside them is an outlier
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
Quick start
- Paste the list. The order does not matter.
- Choose inclusive or exclusive. Inclusive matches most spreadsheets.
- Read Q1, the median and Q3, then the IQR and any outliers. The box plot draws them.
How the quartiles are found
- Sort the numbers.
- Q2 is the median.
- Q1 is the 25th percentile and Q3 the 75th, found with the rank rule of the method:
p × (n − 1) + 1inclusive,p × (n + 1)exclusive. - IQR is Q3 − Q1. The fences are Q1 − 1.5 × IQR and Q3 + 1.5 × IQR.
Worked examples
| Numbers | Q1 | Q2 | Q3 | IQR | Outliers | Note |
|---|---|---|---|---|---|---|
| 6 7 9 10 11 12 13 15 16 18 21 45 | 9.75 | 12.5 | 16.5 | 6.75 | 1 | The default list. 45 is far out. |
| 1 2 3 4 5 6 7 8 | 2.75 | 4.5 | 6.25 | 3.5 | 0 | Eight evenly spaced numbers. |
| 3 5 7 8 9 11 13 15 17 | 7 | 9 | 13 | 6 | 0 | An odd count, nine values. |
| 10 12 12 13 14 14 15 16 40 | 12 | 14 | 15 | 3 | 1 | One high outlier. |
Inclusive and exclusive
| Numbers | Inclusive Q1, Q3 | Exclusive Q1, Q3 |
|---|---|---|
| 6 7 9 10 11 12 13 15 16 18 21 45 | 9.75, 16.5 | 9.25, 17.5 |
| 1 2 3 4 5 6 7 8 | 2.75, 6.25 | 2.25, 6.75 |
| 3 5 7 8 9 11 13 15 17 | 7, 13 | 6, 14 |
| 10 12 12 13 14 14 15 16 40 | 12, 15 | 12, 15.5 |
The two usually differ a little, most for small lists. Say which method you used when you report quartiles. For any other percentile, such as the 90th, use the percentile calculator. For the mean and the mode next to the median, see the mean, median and mode calculator.
Numbers this uses
Every constant the tool uses is listed here with its source. Where a number varies, you can edit it in the tool.
- Fence multiplier is 1.5 × IQR. Tukey's rule for box plots, the default in most software.
- Whiskers is the furthest values inside the fences. Not the minimum and maximum, unless there are no outliers.
- Limit is 100,000 numbers. For speed in the browser.
Common mistakes
- Leaving the numbers unsorted when working by hand.
- Calling a value an outlier just because it is the largest. It must be beyond the fence.
- Comparing quartiles from two programs that use different methods.
Nothing you type or paste is uploaded. We count events without cookies (details).
FAQ
What are quartiles?
Quartiles split sorted data into four parts with equal counts. Q1 is the 25th percentile, Q2 the median, Q3 the 75th. For the default list they are 9.75, 12.5 and 16.5.
What is the interquartile range?
The IQR is Q3 − Q1, the spread of the middle half of the data. The default list has an IQR of 6.75. It ignores the lowest and highest quarter, so unlike the range it is not moved by outliers.
How do I find outliers with the IQR?
The 1.5 × IQR rule: any value below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR is an outlier. For the default list the fences are -0.375 and 26.625, so 1 value (45) is flagged. The box plot draws outliers as open circles.
Why does my textbook give different quartiles?
Several methods exist. The tool offers the inclusive one (Excel QUARTILE.INC) and the exclusive one (QUARTILE.EXC). For 1 to 8 the inclusive Q1 is 2.75 and the exclusive Q1 is 2.25. Some courses split the list in halves and take the median of each half, which can match either one.
How do I read a box plot?
The box runs from Q1 to Q3 with a line at the median. The whiskers reach the furthest values still inside the fences. Circles beyond the whiskers are outliers. A median off-centre in the box, or one whisker longer than the other, shows skew.
How many numbers do I need?
The inclusive method works from one number, though quartiles of a handful of values mean little. The exclusive method needs at least 3. Below about 8 numbers, treat the quartiles as a rough guide.
What are the Excel and Google Sheets formulas?
=QUARTILE.INC(A1:A12, 1) gives Q1, with 2 for the median and 3 for Q3. =QUARTILE.EXC works the same way. Google Sheets has QUARTILE, which is the inclusive one. The tool shows the matching formula.
Is my list uploaded?
No. It stays in your browser, is not stored and is not sent. We only count which method you used.
More from FLXCode
Percentile CalculatorNew
Value at a percentile, or the percentile of a value, in your data, with the method stated.
Mean, Median, Mode CalculatorNew
Mean, median, mode and range of a list of numbers, with the working shown.
Standard Deviation CalculatorNew
Paste your numbers and get the sample and population standard deviation, with the steps shown.
Average CalculatorNew
Average (mean) of pasted numbers, or a weighted average for grades and prices, with the steps.