Quick Answer
For the data set {1, 2, 3, 4, 5, 6, 7, 8}, Q1 = 2.5, Q3 = 6.5, and the IQR is 4.
Separate values with commas, spaces, or newlines
Common Examples
| Input | Result |
|---|---|
| 1, 2, 3, 4, 5, 6, 7, 8 | Q1: 2.5, Q3: 6.5, IQR: 4 |
| 3, 7, 8, 5, 12, 14, 21, 13, 18 | Q1: 6, Q3: 16, IQR: 10 |
| 1, 2, 5, 6, 7, 9, 12, 15, 18, 19, 27 | Q1: 5, Q3: 18, IQR: 13 |
| 10, 12, 14, 16, 18, 20, 100 | Q1: 12, Q3: 20, IQR: 8, Outlier: 100 |
How It Works
The interquartile range (IQR) is a measure of statistical dispersion that describes the spread of the middle 50% of a data set. It is more robust than range because it is not affected by extreme values.
Step 1: Sort the Data
Arrange all values in ascending order.
Step 2: Find the Median (Q2)
The median divides the sorted data into two equal halves. For an odd number of values, Q2 is the middle value. For an even number, Q2 is the average of the two middle values.
Step 3: Find Q1 and Q3
Q1 (the first quartile) is the median of the lower half of the data (all values below Q2). Q3 (the third quartile) is the median of the upper half of the data (all values above Q2). For an odd-sized data set, the middle value (Q2 itself) is excluded from both halves when computing Q1 and Q3.
Step 4: Calculate IQR
IQR = Q3 - Q1
Step 5: Determine Fences and Outliers
The lower fence is Q1 - 1.5 x IQR. The upper fence is Q3 + 1.5 x IQR. Any data point below the lower fence or above the upper fence is classified as an outlier. This is the standard method used in box-and-whisker plots.
Worked Example
For the data set {3, 7, 8, 5, 12, 14, 21, 13, 18}: Sorted: {3, 5, 7, 8, 12, 13, 14, 18, 21}. There are 9 values, so Q2 (median) = 12 (the 5th value). Lower half: {3, 5, 7, 8}. Q1 = (5 + 7) / 2 = 6. Upper half: {13, 14, 18, 21}. Q3 = (14 + 18) / 2 = 16. IQR = 16 - 6 = 10. Lower fence = 6 - 1.5(10) = -9. Upper fence = 16 + 1.5(10) = 31. All values fall within the fences, so there are no outliers.
Related Calculators
Standard Deviation Calculator
Calculate the standard deviation, variance, mean, and other statistics for any data set.
Percentage Calculator
Calculate percentages: find X% of Y, what percent X is of Y, percentage increase/decrease, and more.
Percentage Change Calculator
Calculate percentage change, percentage of a number, and what percent one number is of another.
CalculateY