Math · 93 calculators
Interquartile Range Calculator
The interquartile range measures the spread of the middle half of a data set. It is the difference between the upper quartile and the lower quartile, and because it ignores the extremes it gives a more stable picture of typical variation than the full range does.
Last updated
Interquartile range
11
- Lower quartile (Q1)
- 5
- Upper quartile (Q3)
- 16
- Median
- 8
- Upper outlier fence
- 32.5
Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.
The formula this calculator uses
IQR = Q3 - Q1
- IQR
- Interquartile range, the spread of the middle half of the data
- Q1
- Lower quartile, the 25th percentile of the sorted data
- Q3
- Upper quartile, the 75th percentile of the sorted data
How to check the result by hand
- 1
Sort the five values into ascending order
Place the smallest observation in x1, the next in x2, and so on up to the largest in x5. The default values 3, 7, 8, 12 and 20 are already in order. This precondition is essential because the quartile expressions take the first two and last two positions literally. If you enter an unsorted list, the result is a difference between two averages but not the interquartile range of the data. Check the order before touching any other step.
- 2
Identify the median
With exactly five sorted observations the median is the third value, x3. It is 8 for the default set. The median divides the list into a lower half of x1 and x2 and an upper half of x4 and x5. It is reported separately by the calculator but is not subtracted in the interquartile range formula, so do not confuse it with either quartile.
- 3
Find the lower quartile
Average the two values in the lower half. For x1 = 3 and x2 = 7 the lower quartile is (3 + 7) / 2 = 5. Averaging is appropriate here because there are two values in the half rather than one central value. If a different quartile convention is required, this is the step that must change, along with the corresponding upper-half calculation.
- 4
Find the upper quartile
Average the two values in the upper half. For x4 = 12 and x5 = 20 the upper quartile is (12 + 20) / 2 = 16. This value is also the base for the outlier fence. Keep the lower and upper quartiles distinct in your notes: subtracting them in the wrong order gives a negative number that signals a reversed subtraction rather than a meaningful spread.
- 5
Subtract and apply the fence
Compute the interquartile range as Q3 minus Q1, which is 16 - 5 = 11 for the default values. The upper fence follows from the same quartiles as Q3 + 1.5 x IQR, giving 16 + 16.5 = 32.5. Both figures are reported so you can see how the width of the central half determines where the outlier threshold falls.
Common Questions
How does the Interquartile Range Calculator work?
Sort the data, find the lower quartile Q1 and the upper quartile Q3, then subtract. In this teaching model the five entered values are already sorted: Q1 is the mean of x1 and x2, the median is x3, and Q3 is the mean of x4 and x5. For 3, 7, 8, 12 and 20 the result is 16 minus 5, giving an interquartile range of 11 and an upper outlier fence of 32.5.
What do I need to enter in the Interquartile Range Calculator?
It takes 5 inputs: First value (x1, smallest), Second value (x2), Third value (x3, median), Fourth value (x4), Fifth value (x5, largest). Fields that expect a unit say so next to the label.
Where does Interquartile range come from?
It comes from IQR = Q3 - Q1 — subtract the lower quartile from the upper quartile. The result is the width of the central fifty per cent of the sorted observations and is expressed in the original units.
What is the most common mistake with the Interquartile Range Calculator?
Forgetting to sort the input values. The expressions average the first two and last two entries, so they only produce quartiles when the list is in ascending order. Entering the numbers in the order they were collected gives an arbitrary difference between two averages. Sort the five values first, and re-sort after any edit, before reading the output.
For worked examples, common mistakes and the limits of this formula, read the full How To Calculate The Interquartile Range page.
