Quartile Calculator
Result
Interquartile range (IQR)
- First quartile (Q1)
- 4.0000
- Second quartile (Q2)
- 4.5000
- Third quartile (Q3)
- 5.5000
- Minimum
- 2.0000
- Maximum
- 9.0000
- Count
- 8
Quartiles cut a sorted list into four parts: a quarter of the data falls at or below Q1, half at or below Q2, three quarters at or below Q3. Together with the smallest and largest values they make up the five-number summary, which describes a data set's position and spread without ever adding the numbers up. This quartile calculator prints all five, and puts the interquartile range — Q3 minus Q1, the width of the middle half of the data — at the top of the result, because that single number is what tells you whether the middle of the distribution is tight or stretched. It also shows Q2 beside them, which is the median, so the two pages agree by construction rather than by coincidence.
Formula
Q1 = value at position (n − 1) × 0.25, Q2 at (n − 1) × 0.5, Q3 at (n − 1) × 0.75 (interpolating between neighbours); IQR = Q3 − Q1
- xᵢ
- One value in the data set. Quartiles are positions in the sorted list, so what matters is the order of the values, not their size — one extreme reading shifts the outer markers a little but leaves the middle half nearly untouched
- n
- How many values the list holds, up to 200 here. The positions are counted from 0 and the last one is n − 1, which is why the three quartile positions are spread across that range
- Q1
- The first quartile, with about 25% of the data at or below it. It marks where the bottom quarter of the sorted list ends, and it is not necessarily a value that appears in your data
- Q2
- The second quartile, which is exactly the median: half the data at or below it. It is printed here for comparison, and the dedicated median page computes the same number from the same rule
- Q3
- The third quartile, with about 75% of the data at or below it. Together with Q1 it bounds the middle half of the data — the part that a box plot draws as a box
- IQR
- The interquartile range, Q3 − Q1: the spread of the middle half. It has the units of the data and, unlike the standard deviation, it is barely affected by outliers because it ignores the outer quarters entirely
Quartiles are the right summary when the data is skewed, has outliers, or is not measured on a scale where adding things up means anything — incomes, house prices, response times, exam marks. Where a mean and standard deviation describe a symmetric bell, the five-number summary describes a distribution of any shape: the median says where the centre is, Q1 and Q3 say how far the middle half stretches, and the smallest and largest values bound everything. The interquartile range is the usual companion to the median for the same reason the standard deviation accompanies the mean, and it is the number people quote when they want a spread that one wild reading cannot inflate. It is also the basis of the box plot and of the 1.5 × IQR rule for flagging possible outliers — the fence is drawn here, but the flagging is a separate job. Use quartiles alongside a histogram when you can: four cut points cannot show whether the data has two humps, and a bimodal data set will happily produce a perfectly ordinary-looking five-number summary.
Worked examples
Eight values: Q1 = 4, Q3 = 5.5, IQR = 1.5
- Sort: 2, 4, 4, 4, 5, 5, 7, 9 — eight values, so n − 1 = 7
- Q1: position 7 × 0.25 = 1.75, which is between the 4 at position 1 and the 4 at position 2, so Q1 = 4
- Q2: position 7 × 0.50 = 3.5, between 4 and 5, so Q2 = 4.5 — the same median the median page reports
- Q3: position 7 × 0.75 = 5.25, between the 5 at position 5 and the 7 at position 6: 5 + 0.25 × 2 = 5.5
- IQR: 5.5 − 4 = 1.5, so the middle half of the data spans a range of 1.5
The middle half here is the four values from 4 to 5.5, and the IQR is how wide that band is. Notice that Q1 landed exactly on a data point while Q3 did not: which quartiles coincide with observed values depends entirely on the count, and the five-number summary is a description of positions, not a subset of the data.
Four values, where every quartile is interpolated
- Sort: 1, 2, 3, 4 — four values, so n − 1 = 3
- Q1: position 3 × 0.25 = 0.75, three quarters of the way from 1 to 2, so Q1 = 1.75
- Q2: position 3 × 0.50 = 1.5, midway between 2 and 3, so Q2 = 2.5
- Q3: position 3 × 0.75 = 2.25, a quarter of the way from 3 to 4, so Q3 = 3.25
- IQR: 3.25 − 1.75 = 1.5
This is the case that separates the conventions, so it is worth knowing what the alternative gives. The method used by OpenStax and many textbooks splits the data at the median and takes the middle of each half: the lower half is 1 and 2, so Q1 = 1.5; the upper half is 3 and 4, so Q3 = 3.5, and the IQR becomes 2. This page uses interpolation between neighbours instead, which is R's default and NumPy's, and it prints Q1 and Q3 so you can see which convention produced them.
The textbook's own 14 values, computed the other way
- Sort: 1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10, 11.5 — fourteen values, so n − 1 = 13
- Q2: position 13 × 0.50 = 6.5, midway between 6.8 and 7.2, so Q2 = 7 — exactly the median the textbook reports
- Q1: position 13 × 0.25 = 3.25, a quarter of the way from the 2 at position 3 to the 4 at position 4, so Q1 = 2.5
- Q3: position 13 × 0.75 = 9.75, three quarters of the way from 8.3 to 9, so Q3 = 8.825
- IQR: 8.825 − 2.5 = 6.325
The same fourteen numbers appear in OpenStax's section on measures of location, which uses the halves method and reports Q1 = 2 and Q3 = 9, an IQR of 7. Both answers come from a documented, teachable rule; they differ because they interpolate differently between the same observations. The median agrees exactly, which is the reassuring part: whatever the convention, the middle of a data set is the middle of a data set.
Limitations
Four cut points cannot describe a distribution on their own. Two data sets can share every quartile and look nothing alike — one clustered, one with two humps — so read the five-number summary next to a histogram when the shape matters. Quartiles are also a convention rather than a fact: this page interpolates between neighbouring values, following Hyndman–Fan type 7, and the halves method used by many textbooks will give different numbers whenever the count is not a multiple of four. The count matters in another way too: with fewer than four values every quartile is an interpolation, and with a single value all five numbers are that value and the IQR is zero because there is no spread to measure. The list is capped at 200 values, and a token such as 1,500 is refused rather than guessed at, since a comma between digits is a decimal point in some countries and a thousands separator in others. Nothing on this page flags outliers: the 1.5 × IQR fence is the standard rule for that, and applying it is a separate tool's job.
Frequently asked questions
- How do you find the quartiles of a data set?
- Sort the list, then read off three positions: (n − 1) × 0.25 for Q1, (n − 1) × 0.50 for Q2, and (n − 1) × 0.75 for Q3, interpolating when a position falls between two values. With eight values the positions are 1.75, 3.5 and 5.25, giving Q1 = 4, Q2 = 4.5 and Q3 = 5.5. The interquartile range is then Q3 − Q1, which is 1.5 here. All three quartiles plus the smallest and largest values are printed above, so the whole summary is on one screen.
- Why is my Q1 different from another calculator's?
- Because the quartiles are a convention, not a fact, and the two common conventions disagree whenever the count is not a multiple of four. This page interpolates between neighbouring values, following Hyndman–Fan type 7 — the default in R and NumPy. Many textbooks, including OpenStax, instead split the data at the median and take the middle of each half: for its own fourteen values that gives Q1 = 2 and Q3 = 9, while this page returns 2.5 and 8.825. Both are documented rules. Q2, the median, comes out identical either way.
- What does the interquartile range tell me?
- It is the width of the middle half of the data: the range that contains the 50% of values between Q1 and Q3. It carries the units of your data, so an IQR of 1.5 means the middle half spans 1.5 of whatever you measured. Because it throws away the top and bottom quarters, one extreme reading barely moves it, which is why it is the customary spread to quote alongside a median. An IQR of zero means the middle half is a single repeated value — half your data or more is identical — and not that anything went wrong.
- What is the five-number summary?
- The smallest value, Q1, the median, Q3 and the largest value — the five numbers this page prints, usually written in that order. It is the standard way to describe a data set without assuming any particular shape, and it is exactly what a box plot draws: a box from Q1 to Q3 with a line at the median, and whiskers out to the extremes. The IQR shown at the top is not one of the five; it is Q3 − Q1, the width of the box.
- Can a quartile be a value that is not in my data?
- Yes, and with small lists it usually is. A quartile is a position on the scale of the data, so 1.75 for the four values 1, 2, 3 and 4 is a perfectly ordinary first quartile even though no value of 1.75 appears in the list. When a position lands exactly on a whole number the quartile coincides with an observed value instead. Both cases are printed with the count beside them, so you can see which one you are looking at.
- Does this page flag outliers?
- No. It gives you the interquartile range, which is the input to the standard rule: a value is treated as a possible outlier if it sits more than 1.5 × IQR below Q1 or above Q3. Applying that fence is deliberately a separate tool's job, so that this page stays an honest description of the data rather than a verdict about which points to discard. For the eight values above, 1.5 × IQR is 2.25, so the fence runs from 1.75 to 7.75.
References
- Measures of the Location of the Data — Introductory Statistics 2e, section 2.3 (defines the quartiles and the interquartile range as the spread of the middle half, and works through the 14-value example; its halves method differs from the interpolation used here) — OpenStax, Rice University
- quantile — R stats package reference (documents the nine quantile types; type 7, the default, is the convention used here for all three quartiles) — The R Project for Statistical Computing
- numpy.quantile — NumPy reference (the method="linear" default interpolates exactly as this page does) — NumPy
- GB/T 3358.1-2009, Statistics — Vocabulary and symbols, Part 1 (the Chinese national vocabulary standard covering the quartiles and the interquartile range; the record page notes that no online full text is offered) — State Administration for Market Regulation, China