How to Calculate Quartile
Find Q1, Q2, Q3 and the interquartile range of data.
The Formula
IQR = Q3 - Q1The quartile formula uses the mathematical relationship: IQR = Q3 - Q1. Each variable in the formula represents a measurable quantity that affects the final result.
What Each Variable Means
Every value in the quartile formula, what it measures, and the value used in the worked example on this page:
| Variable | Type | Example value |
|---|---|---|
| Value 1 (smallest) | Input (you provide) | 1 |
| Value 2 | Input (you provide) | 3 |
| Value 3 (median) | Input (you provide) | 5 |
| Value 4 | Input (you provide) | 7 |
| Value 5 (largest) | Input (you provide) | 9 |
| Q1 (25th percentile) | Result (calculated) | — |
| Q2 (Median) | Result (calculated) | — |
| Q3 (75th percentile) | Result (calculated) | — |
| IQR = Q3 - Q1 | Result (calculated) | — |
| Lower Fence (Q1 - 1.5×IQR) | Result (calculated) | — |
| Upper Fence (Q3 + 1.5×IQR) | Result (calculated) | — |
Step-by-Step Method
- 1Write down the values you know: Value 1 (smallest), Value 2, Value 3 (median), Value 4, Value 5 (largest).
- 2Substitute your known values into the formula: IQR = Q3 - Q1.
- 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
- 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
- 5Verify your answer with the interactive Quartile Calculator — it solves the same formula instantly.
Worked Example
Take a concrete case: value 1 (smallest) = 0.5, with the other inputs at the typical values from the variables table above. Substituting into the formula gives q1 (25th percentile) = 1.7500, q2 (median) = 5.0000, q3 (75th percentile) = 8.0000, iqr = q3 - q1 = 6.2500, lower fence (q1 - 1.5×iqr) = -7.6250, upper fence (q3 + 1.5×iqr) = 17.3750. These numbers are solved by the same engine that powers the Quartile calculator, so you can reproduce them exactly by entering the same inputs there.
| Value 1 (smallest) | Q1 (25th percentile) | Q2 (Median) | Q3 (75th percentile) | IQR = Q3 - Q1 | Lower Fence (Q1 - 1.5×IQR) | Upper Fence (Q3 + 1.5×IQR) |
|---|---|---|---|---|---|---|
| 0.3 | 1.6500 | 5.0000 | 8.0000 | 6.3500 | -7.8750 | 17.5250 |
| 0.5 | 1.7500 | 5.0000 | 8.0000 | 6.2500 | -7.6250 | 17.3750 |
| 0.8 | 1.9000 | 5.0000 | 8.0000 | 6.1000 | -7.2500 | 17.1500 |
| 1 | 2.0000 | 5.0000 | 8.0000 | 6.0000 | -7.0000 | 17.0000 |
| 2 | 2.5000 | 5.0000 | 8.0000 | 5.5000 | -5.7500 | 16.2500 |
| 3 | 3.0000 | 5.0000 | 8.0000 | 5.0000 | -4.5000 | 15.5000 |
| 4 | 3.5000 | 5.0000 | 8.0000 | 4.5000 | -3.2500 | 14.7500 |
How each result changes as value 1 (smallest) changes, holding the other inputs constant.
Practice Problems
1. [1, 3, 5, 7, 9]: With Value 1 (smallest) 1, Value 2 3, Value 3 (median) 5, Value 4 7, Value 5 (largest) 9, what are the results?
Answer: The calculator returns Q1 (25th percentile) 2.0000, Q2 (Median) 5.0000, Q3 (75th percentile) 8.0000, IQR = Q3 - Q1 6.0000, Lower Fence (Q1 - 1.5×IQR) -7.0000, and 1 more more results for Value 1 (smallest) 1, Value 2 3, Value 3 (median) 5, Value 4 7, Value 5 (largest) 9.
2. Value 1 (smallest) 12.5, Value 2 25, Value 3 (median) 35, Value 4 45, Value 5 (largest) 80 — work it out, then check the answer.
Answer: With Value 1 (smallest) 12.5, Value 2 25, Value 3 (median) 35, Value 4 45, Value 5 (largest) 80, the results are Q1 (25th percentile) 18.7500, Q2 (Median) 35.0000, Q3 (75th percentile) 62.5000, IQR = Q3 - Q1 43.7500, Lower Fence (Q1 - 1.5×IQR) -46.8750, and 1 more more results.
Frequently Asked Questions
What is the formula for quartile?
The formula is: IQR = Q3 - Q1. Find Q1, Q2, Q3 and the interquartile range of data.
What values do I need to calculate quartile?
You need value 1 (smallest), value 2, value 3 (median), value 4, value 5 (largest). The calculator produces q1 (25th percentile), q2 (median), q3 (75th percentile), iqr = q3 - q1, lower fence (q1 - 1.5×iqr), upper fence (q3 + 1.5×iqr) from those inputs.
What is the quartile when value 1 (smallest) is 0.5?
With value 1 (smallest) = 0.5, the result is q1 (25th percentile) = 1.7500, q2 (median) = 5.0000, q3 (75th percentile) = 8.0000, iqr = q3 - q1 = 6.2500, lower fence (q1 - 1.5×iqr) = -7.6250, upper fence (q3 + 1.5×iqr) = 17.3750. This is worked through in full in the example on this page.
Related Topics
Use the Interactive Calculator
Skip the manual math — get instant results with our free Quartile calculator.
