Quick answer: For 11, 12, 13, 14, 15, 16, 17, 18, 20, 30: Q1 = 13.25, median = 15.5, Q3 = 17.75, so the IQR is 4.5 and 30 lies above the upper fence 17.75 + 1.5 × 4.5 = 24.5, an outlier.
How it's calculated
The values are sorted. Quartiles use linear interpolation: the p-th quantile sits at position h = (n − 1)·p counting from 0, and between two values it is interpolated. This is the "inclusive" method used by Excel's QUARTILE.INC and PERCENTILE.INC and R's default (type 7).
Textbooks and other software use slightly different quartile rules (for example the median of each half, or Excel's QUARTILE.EXC), so Q1 and Q3 can differ a little for small lists. The median, mean and standard deviation do not depend on the method.
The IQR is Q3 − Q1, the spread of the middle half. Tukey's rule flags values below Q1 − 1.5·IQR or above Q3 + 1.5·IQR as possible outliers; these are the whiskers of a box plot. For the spread step by step, use the standard deviation calculator.
Worked examples
- 12, 15, 11, 18, 20, 13, 17, 14, 16, 30: Q1 = 13.25, median 15.5, Q3 = 17.75, IQR 4.5, outlier 30
- 1, 2, 3, 4, 5, 6, 7, 8: Q1 = 2.75, median 4.5, Q3 = 6.25, IQR 3.5
- Mean and SD of the first list: mean 16.6, s = 5.460972
Frequently asked questions
Why are my quartiles different from my textbook?
There are several accepted ways to compute quartiles. This calculator uses linear interpolation (Excel QUARTILE.INC, R type 7). The "median of halves" method taught in many schools can give slightly different Q1 and Q3.
What is the five-number summary?
Minimum, first quartile, median, third quartile and maximum. It is what a box plot draws.
How are outliers found?
With Tukey's fences: anything more than 1.5 IQR below Q1 or above Q3 is flagged. It is a rule of thumb for checking data, not proof that a value is wrong.
What's the median of 12, 15, 11, 18, 20, 13, 17, 14?
14.5. Sorted, the two middle values are 14 and 15, and the median sits halfway between them.
What is a box plot?
A picture of the five-number summary. The box runs from Q1 to Q3 with a line at the median, and the whiskers reach out to the lowest and highest values that aren't outliers.
When is the IQR better than the standard deviation?
When the data are lopsided or have a few extreme values, like salaries or house prices. The IQR ignores the extremes, while the SD gets dragged around by them.