Skip to main content

Range & IQR Calculator

Calculate the range, quartiles, and interquartile range (IQR) of a dataset, flag outliers using the 1.5×IQR rule, and see it all laid out on a box plot — with full step-by-step working.

Background

Range and IQR are both measures of spread, but they answer different questions. The range (max − min) tells you the full width of the data, while the IQR covers just the middle 50% — which makes it far less thrown off by a single extreme value. That's also what makes the IQR the basis for the standard rule used to flag outliers.

Set up your data

Step 1 — How should quartiles be calculated?

These methods can disagree by a little, especially on small datasets — the step-by-step below always shows exactly which one was used.

Step 2 — Paste your data

Separate values with commas, spaces, or line breaks. Order doesn't matter.

Learning options

Result

No result yet. Set up your data above and click Calculate.

How to use this calculator

  • Choose a quartile method in Step 1 — if you're not sure which one your course or tool uses, Exclusive matches most intro statistics textbooks, while Interpolation matches what Excel, Google Sheets, and NumPy compute by default.
  • Paste your data in Step 2, in any order — commas, spaces, and line breaks all work.
  • Click Calculate to see the range, quartiles, IQR, any flagged outliers, and a box plot, plus full step-by-step working.

How range & IQR work

1

Range is simply the highest value minus the lowest. It's easy to compute but entirely determined by the two most extreme points — one unusual value can make the range misleading.

2

Quartiles split sorted data into four equal-sized groups. Q1 is the value below which 25% of the data falls, Q3 is the value below which 75% falls, and the median (Q2) splits the data in half.

3

The IQR (Q3 − Q1) covers only the middle 50% of the data, so it's much more resistant to extreme values than the range — this is why it's the standard companion to the median.

4

The 1.5×IQR rule flags any value more than 1.5 IQRs below Q1 or above Q3 as a likely outlier. It's a convention, not a law of nature — but it's the one used almost universally on box plots.

5

On a proper box plot, the whiskers stop at the most extreme values that are not outliers — not necessarily the true min and max. Any values beyond that get plotted as individual dots.

Formula & Equations Used

Range: R = max − min

Interquartile range: IQR = Q3 − Q1

Outlier bounds: Lower = Q1 − 1.5×IQR, Upper = Q3 + 1.5×IQR

Exclusive method: split the sorted data at the median (excluding it if n is odd); Q1 and Q3 are the medians of the lower and upper halves.

Inclusive method: same split, but the overall median is included in both halves when n is odd.

Interpolation method: position = p×(n−1) on the sorted, zero-indexed data; the quartile is linearly interpolated between the two nearest ranks.

Example Problems & Step-by-Step Solutions

These cover cases the Quick Examples chips above don't already demonstrate.

Example 1 — Exclusive vs. inclusive, by hand

Data: 1, 2, 3, 4, 5, 6, 7 (n=7, odd). Find Q1 and Q3 with both the exclusive and inclusive methods.

Exclusive: median=4 is excluded from both halves → lower={1,2,3}, upper={5,6,7} → Q1=2, Q3=6.

Inclusive: median=4 is included in both halves → lower={1,2,3,4}, upper={4,5,6,7} → Q1=2.5, Q3=5.5.

Result: Same data, genuinely different IQRs: 4 (exclusive) vs. 3 (inclusive).

Example 2 — A real outlier in test scores

Ten quiz scores: 72, 75, 78, 80, 81, 83, 85, 88, 90, 40. One student clearly struggled — does the 1.5×IQR rule flag it?

Step: Sorted, Q1=75, Q3=85 (exclusive method), IQR=10. Lower bound = 75 − 15 = 60.

Result: 40 falls below 60, so it's flagged as an outlier — while the range alone (90−40=50) would just look like "wide spread" without pinpointing which value is the problem.

Example 3 — Interpolation on an even-sized set

Data: 4, 8, 15, 16, 23, 42 (n=6). Find Q1 using the interpolation method.

Step: position = 0.25 × (6−1) = 1.25. That's 25% of the way from index 1 (value 8) to index 2 (value 15).

Result: Q1 = 8 + 0.25×(15−8) = 9.75 — a value that doesn't appear anywhere in the original data, which is expected for this method.

Example 4 — No spread at all

Data: 9, 9, 9, 9, 9. What happens to the range and IQR?

Step: max=min=9, and every quartile also equals 9 regardless of method.

Result: Range = 0 and IQR = 0 — both bounds collapse to exactly 9, so technically any other value pasted alongside these would be flagged as an outlier.

Frequently Asked Questions

Why are there multiple ways to calculate quartiles?

There's no single agreed-upon definition of "the value 25% of the way through the data," especially for small datasets where the quartile might not land exactly on a data point. Different textbooks and software packages made different reasonable choices, and none of them is universally "correct."

Why 1.5×IQR specifically for outliers?

It's a convention introduced by statistician John Tukey for box plots. For roughly bell-shaped data it flags a small, sensible fraction of points as unusual — but it's a rule of thumb, not a formal statistical test, so a flagged point still deserves a second look before being dismissed.

Is the range or the IQR a better measure of spread?

The range is easier to compute and more intuitive, but a single extreme value can distort it completely. The IQR ignores the most extreme 50% of the data by design, which makes it a more stable summary when outliers are possible.

Why don't the box plot whiskers reach the actual minimum and maximum?

By convention, whiskers stop at the most extreme value that isn't flagged as an outlier. If the true min or max lies beyond the 1.5×IQR bound, it's drawn as a separate dot instead of extending the whisker to it.

Back to all calculatorsAll calculators