Box Plot Calculator: Quartiles, Median and Outliers
Calculate the five-number summary of a data set (minimum, Q1, median, Q3, maximum), find outliers with the 1.5 IQR rule, and view it as a box-and-whisker plot.
Box Plot Calculator
Documentation
What is a box plot?
A box plot, also called a box-and-whisker plot, is a chart that summarizes a set of numbers using five values: the minimum, the first quartile, the median, the third quartile, and the maximum. It shows where most of the data sits and flags any unusual values, called outliers, without listing every data point.
Box plots are common in statistics, science, and business reports because they let people compare several groups of numbers at a glance.
The five-number summary
A box plot is built from five numbers, calculated after sorting the data from smallest to largest.
- Minimum: the smallest value that is not an outlier.
- First quartile (Q1): the value below which about a quarter of the data falls.
- Median (Q2): the middle value of the data set.
- Third quartile (Q3): the value below which about three-quarters of the data falls.
- Maximum: the largest value that is not an outlier.
The box in the chart stretches from Q1 to Q3. A line inside the box marks the median. Thin lines called whiskers reach out from the box toward the minimum and maximum. Any outliers are drawn as separate dots beyond the whiskers.
Box plot formula
For a data set sorted in ascending order with n values:
Median
Quartiles. Split the sorted data into a lower half and an upper half. If n is odd, leave the median itself out of both halves. Then:
This is often called the exclusive method. Other methods exist, and they can give slightly different Q1 and Q3 values for small data sets, but the exclusive method is the one this calculator uses.
Interquartile range (IQR)
Fences and whiskers. The fences mark the boundary for outliers:
A whisker does not stop exactly at a fence. It stops at the most extreme data point that still lies inside the fences:
Outliers. Any value below the lower fence or above the upper fence is an outlier and is plotted as an individual point rather than folded into the whisker.
How to calculate a box plot step by step
- Sort the data from smallest to largest.
- Find the median. With an odd count, it is the middle value. With an even count, it is the average of the two middle values.
- Find Q1: the median of the lower half of the data (the median itself is left out when the count is odd).
- Find Q3: the median of the upper half of the data, using the same rule.
- Calculate the IQR as Q3 minus Q1.
- Calculate the lower and upper fences using 1.5 times the IQR.
- Mark any value outside the fences as an outlier.
- Set the whiskers to the smallest and largest values that remain inside the fences.
Example
Take this data set of 11 values: 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49. It is already sorted.
With 11 values (odd), the median is the 6th value: 40.
The lower half is 6, 7, 15, 36, 39 (five values, median excluded). Its median is the middle value: Q1 = 15.
The upper half is 41, 42, 43, 47, 49. Its median is the middle value: Q3 = 43.
IQR = 43 − 15 = 28.
Lower fence = 15 − 1.5 × 28 = −27. Upper fence = 43 + 1.5 × 28 = 85. Every value in the data set falls between −27 and 85, so there are no outliers, and the whiskers reach the actual minimum and maximum: min = 6, max = 49.
Now compare a data set with an outlier: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50. Here Q1 = 3.5, Q3 = 9.5, and IQR = 6, giving an upper fence of 9.5 + 1.5 × 6 = 18.5. The value 50 sits above that fence, so it is plotted as an outlier, and the upper whisker stops at 11, the largest value still inside the fence, instead of at 50.
How to read a box plot
The box covers the middle 50% of the data, so a wide box means the middle of the data is spread out, and a narrow box means it is tightly packed. If the median line sits closer to one edge of the box, the data leans, or is skewed, toward the longer side. A whisker that is much longer than the other suggests the data trails off more on that side. Points beyond the whiskers are outliers and often deserve a closer look, since they can be genuine extreme values or errors in the data.
Common uses
Box plots are used to compare groups side by side, such as test scores across several classes, delivery times across two suppliers, or measurements from an experiment against a control group. Because a box plot condenses a whole distribution into five numbers, several of them can be lined up on one chart, which makes it easier to compare spread and typical values across groups than a table of raw numbers would.
Box plots compared with other charts
A histogram shows the full shape of a distribution in more detail but is harder to use when comparing many groups at once. A violin plot adds a density curve around the box, showing where values cluster more precisely. A scatter plot shows the relationship between two variables, something a box plot cannot do. The right choice depends on whether the goal is to compare groups (box plot), see one distribution's shape in detail (histogram or violin plot), or study a relationship (scatter plot).
History
The statistician John Tukey introduced the box plot in the 1970s, describing it in his 1977 book Exploratory Data Analysis. His original version, sometimes called the schematic plot, showed the median, quartiles, and the extreme values. In 1978, the statisticians Robert McGill, Tukey, and Wayne Larsen described a notched version that adds a confidence interval around the median. The 1.5 × IQR rule for marking outliers became a standard convention not long after.
Frequently asked questions
What is a box plot used for? It shows how a set of numbers is spread out and flags likely outliers, using the minimum, Q1, median, Q3, and maximum. It is especially useful for comparing several groups on one chart.
How do you read a box plot? The box spans Q1 to Q3, covering the middle half of the data. The line inside the box is the median. The whiskers reach to the most extreme values that are not outliers, and any values beyond the whiskers are drawn as separate points.
How do you identify outliers in a box plot? A value is an outlier if it falls below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR.
What is the difference between a box plot and a histogram? A box plot condenses a distribution into five numbers and outliers, which makes it compact and good for comparing groups. A histogram shows the frequency of values across ranges, giving more detail on the shape of a single distribution.
Can this calculator handle small data sets? This calculator needs at least five numbers to produce a five-number summary. Box plots are more informative with larger data sets, since a handful of values gives little sense of spread or outliers.
What does it mean if a box plot looks skewed? If the median sits nearer to Q1, the data has a longer tail on the high end. If it sits nearer to Q3, the data has a longer tail on the low end.