Use this quartile calculator to split ordered data into quarters and measure the spread of its middle half.
For 1 through 8, Q1 = 2.5, median = 4.5, Q3 = 6.5, and IQR = 4. This tool uses the median-of-halves convention.
Median-of-halves: 6.5 − 2.5 = 4.
Embed Quartile & IQR Calculator
Copy this iframe code into a page that permits embeds.
How to Use the Quartile & IQR Calculator
Enter at least two observations. The tool sorts them, finds the overall median, splits the ordered list into lower and upper halves, and takes each half’s median to obtain Q1 and Q3. It reports IQR = Q3 − Q1 and flags values outside the 1.5 × IQR fences as potential outliers.
Which Quartile Method Does This Tool Use?
This calculator uses the median-of-halves method. For an odd number of observations, it excludes the central median from both halves. For an even number, each half contains exactly half the observations. Spreadsheet percentile functions and some textbooks use interpolation instead, so their quartiles can differ. Check your course convention before comparing answers.
Worked Example: Eight Ordered Values
For 1, 2, 3, 4, 5, 6, 7, 8, the median is (4 + 5)/2 = 4.5. The lower-half median is (2 + 3)/2 = 2.5; the upper-half median is (6 + 7)/2 = 6.5. Therefore IQR = 6.5 − 2.5 = 4.
Using IQR to Flag Potential Outliers
The lower fence is Q1 − 1.5 × IQR; the upper fence is Q3 + 1.5 × IQR. Values strictly outside those fences are flagged as potential outliers. A flagged value is not automatically a mistake and should be investigated in context.
Upper fence = Q3 + 1.5 × IQR
Quartile & IQR FAQs
What is the interquartile range?
IQR is Q3 minus Q1, the width of the middle half of the ordered data.
Is the median included in both halves?
No. For odd-sized sets this calculator excludes the central median from both halves.
Why does Excel give a different Q1?
Some spreadsheet percentile functions use interpolation rather than the median-of-halves method.
Method and references
This calculator uses the median-of-halves convention described above. Other courses and software may use a different quartile method; compare the convention before comparing answers.
Sources
View references
Disclaimer
For educational use. Check your class or textbook convention when the problem defines a different range, sequence index, or notation.