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.
Where Median and Quartile Is Used
Box plots
Getting the five numbers needed to draw one.
Outlier detection
Flagging values outside the 1.5 × IQR fences.
Skewed data
Describing spread with the median and IQR instead of the mean and SD.
Exam questions
Checking quartile answers with the method your course uses.
Common Median and Quartile Mistakes to Avoid
- Always sort the data first.
- State the method when you report quartiles.
- The IQR is resistant to outliers, unlike the range and standard deviation.
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 (Q1) and of the upper half (Q3).
Why do different tools give different quartiles?
There are several accepted definitions that treat the middle value and interpolation differently.
What is the IQR used for?
It measures the spread of the middle 50% of the data and defines the outlier fences.
How do I find outliers with the IQR?
Values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are flagged as outliers.