Interquartile Range Calculator

Find the first and third quartiles, interquartile range, five-number summary, box plot, and potential outliers using the 1.5 × IQR rule.

Enter your values

STATISTICS

Enter your data

Enter observations once. The calculator sorts them before analyzing the distribution.

Separate values with commas, spaces, semicolons, or new lines. Integers, decimals, negatives, and repeated observations are accepted.

Ctrl + Enter also calculates
Try an example
Your interquartile range will appear here.Enter observations and calculate to see the sorted data and complete working.
Overview

What is an interquartile range calculator?

The interquartile range (IQR) is the difference between the third quartile and first quartile. It measures the spread of the middle 50% of ordered data and is less sensitive to extreme values than the full range.

Important terms

First quartile (Q₁)
The median of the lower half of ordered observations under the stated median-of-halves convention.
Third quartile (Q₃)
The median of the upper half under the same convention.
Interquartile range
IQR = Q₃ − Q₁, the width of the middle half of the data.
Outlier fence
A screening boundary at Q₁ − 1.5 × IQR or Q₃ + 1.5 × IQR.

When this method is useful

  • Summarize the spread of a skewed data set with reduced sensitivity to extremes.
  • Build or interpret a box-and-whisker plot.
  • Flag observations outside the conventional 1.5 × IQR screening fences.
Formula

Formula and variables

IQR⁡=Q3−Q1,L=Q1−1.5IQR⁡,U=Q3+1.5IQR⁡\operatorname{IQR}=Q_3-Q_1,\qquad L=Q_1-1.5\operatorname{IQR},\qquad U=Q_3+1.5\operatorname{IQR}
Q₁
first quartile
Q₂
median
Q₃
third quartile
L, U
lower and upper outlier fences

Order the data, split it into lower and upper halves, find each half's median to obtain Q₁ and Q₃, and subtract Q₁ from Q₃. This calculator excludes the overall median from both halves when the number of observations is odd.

Domain note: At least two finite observations are required. Quartile conventions differ between textbooks and software, so results should be interpreted using the median-of-halves method stated here.

How it works

How to use this calculator

  1. 1

    Sort observations from least to greatest.

  2. 2

    Split the ordered data at the overall median; when n is odd, omit the median from both halves.

  3. 3

    Find Q₁ and Q₃ as the medians of the lower and upper halves.

  4. 4

    Calculate IQR = Q₃ − Q₁ and optional fences Q₁ − 1.5 × IQR and Q₃ + 1.5 × IQR.

Worked examples

Step-by-step examples

Example 1

Problem: Find the IQR of 4, 7, 8, 10, 12, 15, 18, 21.

Substitution: The lower half is 4, 7, 8, 10, so Q₁ = (7 + 8) / 2 = 7.5. The upper half is 12, 15, 18, 21, so Q₃ = (15 + 18) / 2 = 16.5.

Result: IQR = 16.5 − 7.5 = 9.

The middle 50% spans 9 units. The fences are −6 and 30, so none of these observations lies outside them.

Example 2

Problem: Find the IQR of 3, 5, 7, 9, 11, 13, 15.

Substitution: The median is 9 and is excluded from the halves. Q₁ = median(3, 5, 7) = 5; Q₃ = median(11, 13, 15) = 13.

Result: IQR = 13 − 5 = 8.

This demonstrates the odd-count split used by the calculator.

Example 3

Problem: Check for an outlier in 2, 3, 4, 5, 6, 7, 8, 30.

Substitution: Q₁ = 3.5, Q₃ = 7.5, and IQR = 4. The upper fence is 7.5 + 1.5(4) = 13.5.

Result: 30 is above the upper fence and is flagged as a potential outlier.

The fence is a statistical flag for investigation, not a claim that the value is wrong.

Method knowledge

Rules, edge cases, and related ideas

Quartile conventions vary

Different methods may include or exclude the overall median, or interpolate between positions. This calculator explicitly uses median-of-halves and excludes the median from both halves for odd n.

IQR cannot be negative

Q₃ is at or above Q₁ in sorted data, so Q₃ − Q₁ is nonnegative.

Outlier flags are exploratory

A point outside a fence deserves context and review; the rule alone does not justify deleting data.

Edge cases and limitations

  • At least two observations are needed to form lower and upper halves.
  • For two observations, each quartile is the single value in its half.
  • If all observations are equal, IQR is zero and both fences equal that common value.
  • When IQR is zero, values different from the quartile value fall outside the zero-width fences.
  • Repeated and negative observations remain in their sorted positions.

How this differs from a related concept

The range uses the minimum and maximum; IQR uses Q₁ and Q₃ and ignores the outer quarters when measuring spread. Standard deviation uses every observation's distance from the mean and is more sensitive to outliers.

Interpretation

Understand the result

The IQR focuses on the center half of the observations, so it often gives a more representative spread than the range for skewed data. In a box plot, the box extends from Q₁ to Q₃ and the line inside marks the median. The 1.5 × IQR fences are a common rule for identifying potential outliers; they do not establish whether a value is an error or whether it should be removed.

Common mistakes

  • Using Q₃ − Q₁ in the wrong order.
  • For an odd count, mixing quartile conventions without stating which one is used.
  • Confusing the IQR with the full range.
  • Treating a value beyond an outlier fence as automatically invalid.
  • Assuming the box plot's whiskers always reach the minimum and maximum when outliers are marked separately.

Frequently asked questions

How do you calculate the interquartile range?

Find Q₁ and Q₃ from the ordered data, then subtract: IQR = Q₃ − Q₁.

How does this calculator find quartiles?

It uses the median-of-halves method. If there is an odd number of values, the overall median is excluded from both halves.

What are the 1.5 × IQR fences?

The lower fence is Q₁ − 1.5 × IQR and the upper fence is Q₃ + 1.5 × IQR. Values beyond them are commonly flagged as potential outliers.

Does an outlier have to be removed?

No. An outlier flag is a prompt to investigate the data and context, not an instruction to remove the observation.

References & technical sources

Keep calculating

Related calculators