Understand your data with a box-and-whisker plot
A box-and-whisker plot, often shortened to boxplot, gives you a quick picture of where a dataset sits and how widely it spreads. Instead of trying to interpret a long list of raw values one by one, a boxplot compresses the list into five landmark numbers: the minimum, first quartile (Q1), median, third quartile (Q3), and maximum. Those five values make it much easier to talk about center, spread, and possible skew without needing a full chart with every point shown.
This calculator works entirely in your browser. Enter a list of numbers, submit the form, and the page sorts the data, computes the five-number summary, and draws a clean horizontal boxplot. Because the calculation happens locally with JavaScript, your numbers stay on your device. That makes the tool convenient for classroom exercises, quick checks while studying, and private datasets you do not want to upload anywhere.
The output is intentionally practical. You get a written result, a compact table, and a visual plot. That combination helps if you are learning what quartiles mean for the first time, checking homework, or preparing a report where you need both the exact values and a picture of the distribution.
How to use the calculator
Start by typing or pasting your data into the input box as a comma-separated list. Spaces are fine, and this version also accepts line
breaks, tabs, or semicolons, which is helpful if your numbers come from a spreadsheet. For example, you could enter
12, 15, 15, 18, 22, 30. When you click Create Plot, the calculator removes empty entries, ignores items that do
not parse as numbers, sorts the valid values from smallest to largest, and then computes the summary statistics.
After submission, look first at the written result line. It confirms the minimum, quartiles, median, maximum, and interquartile range. Then check the table if you want the values arranged neatly in columns. Finally, use the plot to see the shape at a glance: the box runs from Q1 to Q3, the line inside the box marks the median, and the whiskers extend to the minimum and maximum values in your list.
If your input contains only one valid number, the page will ask for more data because quartiles are only meaningful when there are at least two observations. If all of your valid values are identical, the calculator still returns a result. In that special case, the boxplot collapses into a centered mark because the range is zero.
What each value means
The minimum is the smallest observed value, and the maximum is the largest. The median, also called Q2, is the middle of the ordered data, so half the values lie below it and half lie above it. The first quartile Q1 marks the point below which roughly 25% of the data fall, while Q3 marks the point below which roughly 75% of the data fall. Together, Q1 and Q3 enclose the middle half of the dataset.
The distance from Q1 to Q3 is especially important because it defines the interquartile range, or IQR. The IQR measures the spread of the middle 50% of your data and is less sensitive to extreme values than the full range. When the box in a boxplot is wide, your central values are more spread out. When the box is narrow, the middle of the dataset is more tightly clustered.
How the quartile formula works
Different textbooks and software packages define quartiles in slightly different ways. This calculator uses a common linear interpolation approach on the sorted list. Suppose the sorted data values are x1, x2, …, xn. For a quartile proportion q, the fractional position is computed as follows:
Here, use q = 0.25 for Q1, q = 0.5 for the median, and q = 0.75 for Q3. If that position lands between two data points, the calculator interpolates between them instead of forcing the answer to be one of the original observations. In plain language, it blends the two neighboring values in proportion to how far the target position lies between them.
Once Q1 and Q3 are known, the interquartile range is simply:
Many statistics courses use the IQR to discuss potential outliers. A common rule labels values below Q1 − 1.5×IQR or above Q3 + 1.5×IQR as possible outliers. This calculator does not plot separate outlier points; it keeps the whiskers at the minimum and maximum values so the display stays simple and predictable.
Worked example
Suppose your dataset is 7, 9, 10, 10, 12, 15, 18, 21. The values are already sorted here so the quartile positions are easy to
follow. The minimum is 7 and the maximum is 21. To find the median, use q = 0.5, giving
pos = (8 − 1) × 0.5 = 3.5. That falls halfway between the 4th and 5th values, which are 10 and 12, so the median is 11.
For Q1, use q = 0.25. The position becomes 1.75, which lies between the 2nd and 3rd values, 9 and 10. Interpolating gives Q1 = 9.75. For Q3, use q = 0.75. The position becomes 5.25, which lies between the 6th and 7th values, 15 and 18, so Q3 = 15.75. The IQR is therefore 15.75 − 9.75 = 6.
Interpreting the plot is the next step. The box stretches from 9.75 to 15.75, which means the middle half of the values span 6 units. The median line sits at 11, a bit closer to Q1 than to Q3. That suggests the upper half of the central data are more spread out than the lower half, which can be a visual hint of right skew. It is only a hint, not a proof, but it is exactly the sort of pattern a boxplot is meant to reveal quickly.
How to read the result well
When the calculator finishes, begin with the median. It gives you a robust idea of the “typical” value because it is not pulled around as strongly by extreme numbers as the mean can be. Then compare the left and right halves of the box. If the median is centered and both box halves are about the same width, the middle of the distribution is fairly balanced. If one half is longer, the data on that side of the median are more spread out.
Next, compare the whiskers. A noticeably longer upper whisker can suggest a longer right tail, while a longer lower whisker can suggest a longer left tail. Because this calculator uses minimum and maximum values for whiskers, the whisker lengths reflect the full observed range, not an outlier-trimmed version. That is useful for introductory work because it keeps the meaning straightforward: the whiskers show the smallest and largest values you entered.
Keep in mind that a boxplot is a summary, not a full map of the distribution. Two very different datasets can share the same five-number summary. For example, a bimodal dataset and a single-peaked dataset might produce similar quartiles even though their shapes differ a lot. If the exact distribution matters, pair the boxplot with a histogram, dot plot, or the raw sorted values.
Assumptions, units, and data preparation
A boxplot is only meaningful when the numbers represent comparable measurements. If you mix inches with centimeters, or combine values from different populations without intending to, the summary can be misleading. The calculator does not know whether your numbers are test scores, temperatures, distances, times, or profits; it simply processes them numerically. That means you should make sure the values belong on the same scale and use consistent units before interpreting the result.
Decimals and negative values are supported. That is helpful for many real-world datasets, such as temperature changes, gains and losses, or deviations from a target. If you paste from a spreadsheet, replacing line breaks with commas is no longer necessary because the parser also accepts line breaks, tabs, and semicolons. Even so, it is a good habit to scan the result and confirm that the minimum and maximum match what you expect. That quick check helps you catch accidental text fragments, missing numbers, or unit mix-ups.
Another practical note is sample size. With very small datasets, quartiles can shift noticeably when one value changes. That is not a flaw in the calculator; it is a reminder that summaries based on only a few observations are naturally sensitive. As the dataset grows, quartiles tend to provide a more stable picture of the underlying spread.
Comparing the three quartile conventions on real data
The table below runs two small datasets through all three methods this calculator offers. Notice that for the even-sized dataset the Tukey hinge and exclusive methods agree exactly, because there is no middle observation to argue about. For the odd-sized dataset they diverge sharply, and the interquartile range shifts from 3 to 5.5 depending only on whether the median is counted in both halves or in neither.
| Dataset | Method | Q1 | Median | Q3 | IQR |
|---|---|---|---|---|---|
| 7, 9, 10, 10, 12, 15, 18, 21 (n = 8) | Linear interpolation | 9.75 | 11 | 15.75 | 6 |
| 7, 9, 10, 10, 12, 15, 18, 21 (n = 8) | Tukey hinges | 9.5 | 11 | 16.5 | 7 |
| 7, 9, 10, 10, 12, 15, 18, 21 (n = 8) | Exclusive median | 9.5 | 11 | 16.5 | 7 |
| 7, 9, 10, 12, 15 (n = 5) | Linear interpolation | 9 | 10 | 12 | 3 |
| 7, 9, 10, 12, 15 (n = 5) | Tukey hinges | 9 | 10 | 12 | 3 |
| 7, 9, 10, 12, 15 (n = 5) | Exclusive median | 8 | 10 | 13.5 | 5.5 |
Whiskers, fences and outliers
A box plot drawn to the minimum and maximum shows the range and nothing more. The version Tukey defined does something more useful: the whiskers stop at the most extreme observations still inside the fences and , and everything beyond is drawn as an individual point. This calculator now draws that version by default, marks the fences with dashed lines, and lists the flagged values.
Take the worked example above and append a single value of 60. The quartiles barely move, but the fences stay at 0.75 and 24.75, so 60 is plotted as an outlier while the whisker stops at 21. That is the behaviour that makes the chart worth drawing: one extreme observation is separated from the body of the data instead of stretching the whisker until the box looks tiny. Reach for the Simple whisker rule only when you specifically want to display the full range.
Bear in mind that the 1.5 multiplier is a convention rather than a result. For normally distributed data the fences sit near 2.7 standard deviations, so about 0.7 % of observations fall outside them by chance alone. In a sample of a thousand you should expect roughly seven flagged points with nothing whatsoever wrong with them.
Sources. The five-number summary and the fence rule come from Tukey; the competing quartile definitions are documented in the standard survey of them.
- The box plot, the 1.5 × IQR fence rule and the five-number summary as originally defined: J. W. Tukey, Exploratory Data Analysis, Addison-Wesley, 1977.
- The nine sample-quantile definitions used across statistical software, including the type 7 rule this page calls linear interpolation: Hyndman and Fan, Sample Quantiles in Statistical Packages, The American Statistician 50(4), 1996.
- Definitions and worked conventions for quartiles and box plots in an engineering context: NIST/SEMATECH e-Handbook of Statistical Methods, Box Plot.
Questions about quartiles and box plots
Why do my quartiles differ from another calculator?
Because there is no single agreed definition of a quartile. This page offers the three conventions in common use. Linear interpolation on position (n minus 1) times q is what Excel's PERCENTILE.INC, NumPy and R's default type 7 all use. Tukey hinges split the sorted list at the median and include it in both halves when the count is odd. The exclusive method leaves the median out of both halves instead. For an even count the last two agree; for an odd count they can differ noticeably.
Why do the whiskers stop before the minimum and maximum?
Under the Tukey rule a whisker extends only to the most extreme observation that still lies within 1.5 times the interquartile range of the box. Anything beyond that is drawn as an individual point. That is what makes a box plot an outlier-detection tool rather than just a picture of the range. Switch the whisker rule to Simple if you want the whiskers pushed out to the true minimum and maximum instead.
Does a point outside the fences mean the value is wrong?
No. The 1.5 times IQR rule is a screening convention, not a test of validity. In data drawn from a normal distribution roughly seven observations in a thousand fall outside the fences purely by chance, so in a large sample you should expect some. Flagged points are worth checking for transcription errors or genuinely different conditions, but discarding them because a rule highlighted them is how real effects get thrown away.
What happens when values repeat?
Repeated values are kept and counted individually, which is what every standard method does. If enough values are identical the box can collapse to zero width, meaning Q1, the median and Q3 all coincide. When that happens the interquartile range is zero, both fences sit on the same value, and every other distinct observation is technically outside them. The calculator reports this rather than hiding it.
Why is 1.5 the multiplier and not some other number?
It was John Tukey's judgement call, chosen so the rule flags a useful handful of points without drowning you in them. For a normal distribution the fences sit at about 2.7 standard deviations from the mean. Some analyses use 3.0 times the IQR for a stricter far-out criterion. Nothing about 1.5 is derived from theory; it is a convention that has proved practical.
Can I use this to compare two groups?
You can run each group separately and read the summaries side by side, which is the standard use of a box plot. Compare medians for typical values, box widths for the spread of the middle half, and whisker lengths and outliers for the tails. What a box plot cannot show is the shape within the box, so a bimodal group and a uniform one can produce identical plots. Check a histogram before concluding two groups are alike.
Where boxplots are useful
Boxplots show up in far more places than statistics homework. Teachers use them to compare exam results across sections. Scientists and lab technicians use them to summarize repeated measurements. Manufacturers use them to monitor variation in part size or weight. Coaches and analysts use them to compare player metrics across seasons. In each case, the attraction is the same: a boxplot tells you quickly where the middle of the data sits and how much spread there is, without drowning you in every individual observation.
The five-number summary is especially helpful when you care about robustness. Means and standard deviations are useful too, but they can be influenced strongly by extreme values. Quartiles and the median are often steadier when the data include outliers or skew. That is why a boxplot is such a common first look at real data.
Privacy and local processing
Everything on this page runs in the browser. The calculator logic, the plot rendering, and the optional mini-game all use client-side JavaScript. Your dataset is not uploaded by the tool itself. You should still follow your organization’s data policies if you work with sensitive information, but the page is designed to operate locally.
| Min | Q1 | Median | Q3 | Max |
|---|---|---|---|---|
| Count | — |
|---|---|
| Interquartile range | — |
| Range | — |
| Mean | — |
| Sample standard deviation | — |
| Lower fence, Q1 − 1.5 × IQR | — |
| Upper fence, Q3 + 1.5 × IQR | — |
| Whisker ends actually drawn | — |
| Points outside the fences | — |
| Median position within the box | — |
| Method | Q1 | Median | Q3 | IQR | Outliers flagged |
|---|
Optional mini-game: Quartile Lineup
Want a faster way to build intuition for boxplots? This short arcade-style challenge turns the same idea into a replayable puzzle. Each round shows a fresh dataset on a number line. Your job is to drag three glowing markers onto the best positions for Q1, the median, and Q3 before time runs out. It is separate from the calculator, so it will not change your math result, but it does make the quartile idea feel more immediate.
Quick takeaway: Q1 marks 25% of the ordered data, the median marks 50%, and Q3 marks 75%.
