Descriptive Statistics
Quartile Calculator
Quartiles mark the quarters of the ordered list, and the page reports Q1, Q2, and Q3 together with the positions used to find them.
Worksheet
Press Calculate to see the result.
Quartiles mark the quarters of the ordered list, and the page reports Q1, Q2, and Q3 together with the positions used to find them.
What this calculator answers
Eight ordered values, 2, 4, 4, 5, 7, 8, 9, and 12, do not land the quarter marks on single observations. Hyndman-Fan type 7 puts Q1 at position 2.75, Q2 at position 4.5, and Q3 at position 6.25, counting the smallest value as position 1. When a position falls between two observations, the quartile is a weighted blend of those two neighbors. This page is about those three marks and their positions. It does not subtract them to make an interquartile range, and it does not build fences.
Q1, Q2, and Q3 are the results, each with the type 7 position that produced it. Q2 is the median under the same rule. Supporting counts and intermediate terms sit under the headline so a reader can see what was divided by what. When a checkbox or a tail setting changes the divisor or the rejection region, that choice appears in the steps rather than vanishing into a silent default.
The formula, written out
Hyndman-Fan type 7 quartiles uses this relationship.
position = 1 + (n - 1) * p, for p = 0.25, 0.5, and 0.75, with linear interpolation.
- n. How many values were typed.
- p. 0.25 for Q1, 0.5 for Q2, 0.75 for Q3.
- position. 1 + (n - 1) * p, counted from the low end.
- Q2. The median, the quartile at p = 0.5.
Type 7 spreads the quartile positions evenly from the first observation to the last. A non-integer position takes a fraction of the gap between the observations on either side, which is why Q3 can be 8.25 even though 8.25 was never typed. The algebra is the named textbook identity for this worksheet. Intermediate products and quotients appear in order so a calculator and a pencil can agree to the displayed rounding. If a neighbouring page uses a different divisor or a continuity correction, that page says so on its own ticket.
A full worked example
Example loaded in the worksheet
The form is prefilled with a small example so every arithmetic step can be checked by hand. Change one field after you finish the walkthrough and confirm the ticket moves the way the formula predicts.
Sort the 8 values: 2, 4, 4, 5, 7, 8, 9, 12. Hyndman-Fan type 7 places a quartile at position 1 + (n - 1) * p, counting the smallest value as position 1. Q1 is at position 2.75, between ordered position 2 (4) and position 3 (4), so Q1 = 4.
Q2 is at position 4.5, between ordered position 4 (5) and position 5 (7), so Q2 = 6. Q3 is at position 6.25, between ordered position 6 (8) and position 7 (9), so Q3 = 8.25. Q2 is the median under the same type 7 rule, not a second formula.
If the two neighboring values differ, the quartile is a blend. It does not have to be one of the typed numbers. Fences and the interquartile range are separate pages. They are not subtracted here.
| Q1 | 4 |
|---|---|
| Q2 | 6 |
| Q3 | 8.25 |
| Q1 position | 2.75 |
| Q2 position | 4.5 |
| Q3 position | 6.25 |
A second situation
A 20 is added at the top of the list
Sort the 9 values: 2, 4, 4, 5, 7, 8, 9, 12, 20. Hyndman-Fan type 7 places a quartile at position 1 + (n - 1) * p, counting the smallest value as position 1. Q1 is at position 3, between ordered position 3 (4) and position 3 (4), so Q1 = 4.
Q2 is at position 5, between ordered position 5 (7) and position 5 (7), so Q2 = 7. Q3 is at position 7, between ordered position 7 (9) and position 7 (9), so Q3 = 9. Q2 is the median under the same type 7 rule, not a second formula.
If the two neighboring values differ, the quartile is a blend. It does not have to be one of the typed numbers. Fences and the interquartile range are separate pages. They are not subtracted here.
| Q1 | 4 |
|---|---|
| Q2 | 7 |
| Q3 | 9 |
| Q1 position | 3 |
| Q2 position | 5 |
| Q3 position | 7 |
Adding 20 makes nine values. Q2 moves from 6 to 7 and Q3 moves from 8.25 to 9, while Q1 stays at 4 because the new point sits at the top of the order. The second example changes the feature that this formula is sensitive to, and the ticket shows the new figure beside the same definition. That contrast is the fastest way to see which input owns the movement.
What moves when the input moves
20 was added, which changes the count and the upper positions. The headline result went from 4 to 4.
The nudged inputs
Sort the 9 values: 2, 4, 4, 5, 7, 8, 9, 12, 20. Hyndman-Fan type 7 places a quartile at position 1 + (n - 1) * p, counting the smallest value as position 1. Q1 is at position 3, between ordered position 3 (4) and position 3 (4), so Q1 = 4.
Q2 is at position 5, between ordered position 5 (7) and position 5 (7), so Q2 = 7. Q3 is at position 7, between ordered position 7 (9) and position 7 (9), so Q3 = 9. Q2 is the median under the same type 7 rule, not a second formula.
If the two neighboring values differ, the quartile is a blend. It does not have to be one of the typed numbers. Fences and the interquartile range are separate pages. They are not subtracted here.
| Q1 | 4 |
|---|---|
| Q2 | 7 |
| Q3 | 9 |
| Q1 position | 3 |
| Q2 position | 5 |
| Q3 position | 7 |
How to read the result
Q1 of 4 at position 2.75 means the lower quarter mark is between the second and third ordered values, both of which are 4. Q3 of 8.25 is not a typed observation. It is the interpolated mark. Say the unit, the sample size or contract terms, and the formula name in the same sentence as the figure. A number without those three pieces invites a later reader to invent a definition that this page never used.
Write the result with its unit, the inputs that produced it, and the name of the formula. Write the result with its unit, the inputs that produced it, and the name of the formula. If the ticket shows a decision sentence, quote the alpha and the tail with it. If the ticket shows a money or dose figure, quote the rate and the schedule that produced it.
Assumptions that have to stay true
- Hyndman-Fan type 7 is the convention you intend to cite.
- The values can be ordered.
- You want the quarter marks, not a fence and not a mean.
- Interpolation between neighbors is acceptable when the position is not a whole number.
If an assumption above is false, do not average the discomfort away. Change the worksheet or change the question. A correct arithmetic step on the wrong model is still the wrong answer for the decision you are trying to make.
Mistakes that change the answer
- Splitting the list into four groups by eye and averaging each group.
- Using a different software default and expecting the same last digit.
- Calling Q1 the fence for outliers.
- Reporting only Q1 and Q3 and labeling Q2 as if it used a different rule.
Where a different calculator is the honest choice
Use the interquartile range calculator to subtract Q3 and Q1. Use the five-number summary when the minimum and maximum should travel with the quartiles. Use the median calculator when Q2 is the only mark you need. Related links under the essay open pages that keep their own formulas instead of hiding a mode switch inside this ticket.
When the job changes, move to a page built for that job: Interquartile Range Calculator, 5 Number Summary Calculator, Median Calculator.
Check yourself
Values are 2, 4, 4, 5, 7, 8, 9, and 12. What are Q1, Q2, and Q3?
Q1 is 4, Q2 is 6, and Q3 is 8.25.
Using the result in a sentence
Exam cut points, income quarters, and the box in a later box plot all start from these three marks. Keep the count, the unit, and the assumption list beside any copy of the number that leaves this browser tab.
A quartile position is not a promise that one quarter of the people scored below that exact typed value when interpolation was used. Small samples make the interpolated digits move when one point is added. Pair the headline with the steps before you staff a route, set a grade boundary, or compare two contracts from a single number.
Questions people ask next
01What definition does the Quartile Calculator commit to?
This page uses Hyndman-Fan type 7 quartiles: position = 1 + (n - 1) * p, for p = 0.25, 0.5, and 0.75, with linear interpolation.. Type 7 spreads the quartile positions evenly from the first observation to the last. A non-integer position takes a fraction of the gap between the observations on either side, which is why Q3 can be 8.25 even though 8.25 was never typed. If a textbook uses a different divisor, a different continuity correction, or a different rounding rule, the last digits can move, so the definition is printed above the result. The worksheet asks for Numbers, and it refuses a blank that the formula cannot interpret. Keep that printed definition in the sentence you write next to the figure so a later reader can rebuild the arithmetic without guessing which convention you chose.
02How should the worked example be read out loud?
In the loaded example the q1 is 4. Q1 of 4 at position 2.75 means the lower quarter mark is between the second and third ordered values, both of which are 4. Q3 of 8.25 is not a typed observation. It is the interpolated mark. Say the unit and the count before you say whether the number is large or small. Read the steps in order rather than jumping to the headline, because the intermediate terms are where a swapped percent and proportion usually hide. If the ticket shows both a primary figure and a comparison figure, name which one you are quoting.
03What is the fastest way to get a misleading result?
Splitting the list into four groups by eye and averaging each group. A quartile position is not a promise that one quarter of the people scored below that exact typed value when interpolation was used. Small samples make the interpolated digits move when one point is added. A second common failure is leaving a checkbox or tail setting in the wrong state and then treating the number as if the default had matched your plan. Reset the example, change one input, and confirm the ticket moves in the direction the formula predicts before you trust a live run.
04When should I leave this page for a different calculator?
Use the interquartile range calculator to subtract Q3 and Q1. Use the five-number summary when the minimum and maximum should travel with the quartiles. Use the median calculator when Q2 is the only mark you need. The related links under the essay go to those worksheets, which keep their own formulas instead of hiding them in a mode switch. If the question changed from a summary to a test, from a payment to a refinance, or from a raw score to a percentile, switch pages rather than forcing this ticket to answer a job it was not built for.
05What belongs in the sentence next to the number?
Q1 is 4, Q2 is 6, and Q3 is 8.25. Name the formula, the sample size or the inputs, and the unit before you compare the figure with someone else's. A bare number without those three pieces cannot be audited when a score, a rate, or a lab value is challenged later. Store the inputs beside the result whenever the figure will travel into a report.