Quartile & Interquartile Range (IQR) Calculator
Calculate Q1, Q2 (median), Q3, and the interquartile range (IQR) from any data set, plus automatic outlier detection using the 1.5×IQR rule — the numbers behind every box plot.
Separate numbers with commas, spaces, or new lines.
10 values detected
Interquartile Range (IQR)
7
Q1 (25th percentile)
36
Q2 / Median (50th)
40.5
Q3 (75th percentile)
43
Min / Max
7 / 49
Lower Fence
25.5
Upper Fence
53.5
Outliers (outside 1.5×IQR)
7, 15
Data Points vs Quartiles
Step-by-Step Solution
Here's exactly how this answer was calculated, one step at a time.
- 1
Sort the data from smallest to largest
7, 15, 36, 39, 40, 41, 42, 43, 47, 49
Quartiles are always calculated on sorted data. There are n = 10 values in total.
- 2
Find the median (Q2)
Q2 = 40.5
With an even count (10) → average the two middle values: (40 + 41) / 2 = 40.5.
- 3
Split the data into a lower half and an upper half
Lower half: 7, 15, 36, 39, 40 | Upper half: 41, 42, 43, 47, 49
Since n is even, the data splits evenly in half with no value excluded.
- 4
Find Q1 as the median of the lower half
Q1 = 36
The lower half has an odd count (5) → take the middle value: 36.
- 5
Find Q3 as the median of the upper half
Q3 = 43
The upper half has an odd count (5) → take the middle value: 43.
- 6
Calculate the interquartile range
IQR = Q3 − Q1 = 43 − 36 = 7
The IQR measures the spread of the middle 50% of the data, between Q1 and Q3.
- 7
Calculate the lower and upper fences
Lower Fence = Q1 − 1.5×IQR = 36 − 1.5×7 = 25.5 | Upper Fence = Q3 + 1.5×IQR = 43 + 1.5×7 = 53.5
Any value outside these two fences is flagged as a potential outlier — the same rule used to draw box-plot whiskers.
- 8
Check each value against the fences
Outliers: 7, 15
These values fall below the lower fence or above the upper fence, so they're flagged as outliers.
✓ Final Answer: IQR = 7
Quartile & Interquartile Range (IQR) Calculator
This IQR calculator finds the first quartile (Q1), median (Q2), and third quartile (Q3) of any data set, then calculates the interquartile range (IQR) — the spread of the middle 50% of your data. It also flags outliers automatically using the standard 1.5×IQR rule, the same method used to draw the whiskers on a box plot.
It's built for students, teachers, statisticians, and data analysts who need fast, accurate quartile and outlier calculations without doing the sorting and splitting by hand.
What Are Quartiles and IQR?
Quartiles split a sorted data set into four equal parts. Q1 marks the boundary below which 25% of the data falls, Q2 is the median (50%), and Q3 marks the boundary below which 75% of the data falls. The interquartile range, IQR = Q3 − Q1, measures the spread of the middle half of the data and is far less sensitive to extreme values than the full range.
How Quartiles Are Calculated
This calculator uses the exclusive median method: sort the data, find the overall median (Q2), then split the data set into a lower half and an upper half (excluding the median itself if the data set has an odd number of values). Q1 is the median of the lower half, and Q3 is the median of the upper half.
Outlier Detection Using the 1.5×IQR Rule
A value is considered a potential outlier if it falls below the lower fence or above the upper fence, both calculated from the IQR.
- Lower Fence = Q1 − 1.5 × IQR
- Upper Fence = Q3 + 1.5 × IQR
- Any data point outside these fences is flagged as an outlier — this is exactly how outliers are identified on a standard box-and-whisker plot.
Frequently Asked Questions
How do you calculate IQR?
IQR (interquartile range) is calculated by subtracting the first quartile from the third quartile: IQR = Q3 − Q1. It represents the range of the middle 50% of the data.
What is the 1.5×IQR rule for outliers?
The 1.5×IQR rule flags any value below Q1 − 1.5×IQR or above Q3 + 1.5×IQR as a potential outlier. This is the standard method used to draw the whiskers on a box plot.
What is the difference between range and IQR?
Range is the difference between the maximum and minimum values in a data set, and is heavily affected by outliers. IQR only looks at the middle 50% of the data, making it a more robust measure of spread when outliers are present.