What Is Median and Quartile?
Quartiles split sorted data into four groups with equal counts. Q1 is the 25th percentile, the median Q2 is the 50th and Q3 is the 75th. The interquartile range IQR = Q3 − Q1 measures the spread of the middle half of the data.
Textbooks and software compute quartiles in slightly different ways, so you can choose the exclusive or inclusive median-of-halves method, or the interpolation methods used by Excel (QUARTILE.INC and QUARTILE.EXC) and NumPy. The calculator also finds the 1.5 × IQR outlier fences, the range, the quartile deviation and the quartile coefficient.
The article below covers the formulas, variables, a worked example with outliers and answers to common questions about why different tools give different quartiles.
How to Use the Median and Quartile Calculator
- Paste or type your data separated by commas, spaces or new lines.
- Pick the quartile method your course or software uses.
- Read Q1, the median, Q3, IQR and the outlier fences.
- Check the box plot for outliers and skew.
Median and Quartile Formula
Interquartile range
Outlier fences
Interpolated quartile (Excel INC)
Median and Quartile Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| Q1 | First quartile | 25th percentile |
| Q2 | Median | 50th percentile |
| Q3 | Third quartile | 75th percentile |
| IQR | Interquartile range | Q3 − Q1 |
| Fences | Outlier boundaries | Q1 − 1.5 IQR and Q3 + 1.5 IQR |
Median and Quartile Worked Example
Take 7, 15, 36, 39, 40, 41, 42, 43, 47, 49 (n = 10). The median is (40 + 41) ÷ 2 = 40.5. The lower half is 7, 15, 36, 39, 40, so Q1 = 36. The upper half is 41, 42, 43, 47, 49, so Q3 = 43. IQR = 43 − 36 = 7. The fences are 36 − 10.5 = 25.5 and 43 + 10.5 = 53.5, so 7 and 15 are outliers.
With the example values loaded in the calculator above, the steps are:
- Sorted data: 7, 15, 36, 39, 40, 41, 42, 43, 47, 49.
- Method: median of halves (exclude the median).
- Q1 = 36, median Q2 = 40.5, Q3 = 43.
- IQR = Q3 − Q1 = 43 − 36 = 7.
- Fences: 36 − 1.5 × 7 = 25.5 and 43 + 1.5 × 7 = 53.5. 2 value(s) fall outside.
Result: First quartile Q1 = 36; Median Q2 = 40.5; Third quartile Q3 = 43; Interquartile range IQR = 7.
How to Read Quartiles and the IQR
The quartiles split sorted data into four parts. For 7, 15, 36, 39, 40, 41, 42, 43, 47, 49 the median is 40.5, Q1 is 36 and Q3 is 43, so the IQR is 7. The middle half of the values lies between 36 and 43.
The fences, Q1 − 1.5 × IQR and Q3 + 1.5 × IQR, flag possible outliers. Here they are 25.5 and 53.5, so the value 7 is flagged. Different tools compute quartiles by different rules, so a small difference from another program is normal.
Where Median and Quartile Is Used
Five-number summary
Get the minimum, quartiles and maximum for a box plot.
Spread
Use the IQR as a measure that outliers barely affect.
Outliers
Check values beyond the 1.5 × IQR fences.
Comparing methods
Switch the quartile method to match your course.
Common Median and Quartile Mistakes to Avoid
- Sort the data first.
- Use the quartile method your course expects.
- The 1.5 × IQR rule flags candidates. It does not prove a value is an error.
- With few values, quartiles depend a lot on the method.
Median and Quartile Terms and Definitions
- Quartile
- One of three cut points that divide sorted data into four equal-count groups.
- Five-number summary
- Minimum, Q1, median, Q3 and maximum.
- Fence
- The 1.5 × IQR boundary beyond which values are flagged as outliers.
Median and Quartile FAQs
How do you find Q1 and Q3?
Sort the data, find the median, then take the median of the lower half for Q1 and of the upper half for Q3. For 7, 15, 36, 39, 40, 41, 42, 43, 47, 49 they are 36 and 43.
Why do different tools give different quartiles?
There are several accepted definitions that treat the middle value and interpolation differently. Choose one and say which you used.
What is the IQR used for?
It measures the spread of the middle 50% of the data and is the basis of box plots and the outlier fences.
How do I find outliers with the IQR?
Compute Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Values outside these fences are flagged as possible outliers.