🧮
🧮 Math & statistics

Quartile, IQR & Box Plot Calculator (outliers)

Results update as you type.

Your numbers

Understanding the quartile and IQR calculator — concept and principle

Quartiles cut a sorted data set into four parts, each holding about a quarter of the values. From them you get the interquartile range (IQR), the five-number summary used to draw a box plot, and the 1.5 × IQR fences that flag possible outliers. They suit skewed data such as incomes or response times.

Quartiles and box plot of ten sorted valuesSorted data 11 to 25: Q1 = 14.25, median = 15.5, Q3 = 18.75, IQR = 4.5. Fences at 7.5 and 25.5 enclose every value, so there are no outliers.Sort, then cut into four quarters11121415151618192225Q114.25median15.5Q318.75gold = middle 50% of the data510152025fence 7.5fence 25.5min 11max 25IQR 4.5IQR = 18.75 − 14.25= 4.51.5 × 4.5 = 6.75outliers: none
The box holds the middle half (IQR 4.5); every value lies inside the 7.5–25.5 fences.

How it is calculated

  1. Sort the n values from smallest to largest.
  2. For a proportion p (0.25 for Q1, 0.5 for the median, 0.75 for Q3), compute the position h = (n − 1) × p + 1.
  3. If h falls between two values, interpolate linearly: Q = x₍⌊h⌋₎ + (h − ⌊h⌋) × (x₍⌊h⌋+1₎ − x₍⌊h⌋₎).
  4. IQR = Q3 − Q1. Lower fence = Q1 − 1.5 × IQR, upper fence = Q3 + 1.5 × IQR.
  5. Five-number summary = minimum, Q1, median, Q3, maximum.

This is the same method as Excel QUARTILE.INC and R's default quantile type 7. Results share the unit of your data.

The principle

The middle 50% of the data lies between Q1 and Q3, so the IQR measures spread without being pulled by the extremes. Changing the largest value from 25 to 250 would not change it at all. John Tukey proposed the 1.5 × IQR rule for box plots as a simple screening rule. For normally distributed data the fences sit at about ±2.7 standard deviations, so only about 0.7% of values fall outside by chance.

Worked example

  1. Data: 12, 15, 11, 19, 22, 15, 18, 25, 14, 16 (n = 10). Sorted: 11, 12, 14, 15, 15, 16, 18, 19, 22, 25.
  2. Q1: h = 9 × 0.25 + 1 = 3.25, so Q1 = 14 + 0.25 × (15 − 14) = 14.25.
  3. Median: h = 5.5, so (15 + 16) ÷ 2 = 15.5.
  4. Q3: h = 7.75, so Q3 = 18 + 0.75 × (19 − 18) = 18.75.
  5. IQR = 18.75 − 14.25 = 4.5. Fences: 14.25 − 6.75 = 7.5 and 18.75 + 6.75 = 25.5.
  6. No value is below 7.5 or above 25.5, so outliers: none. Five-number summary: 11, 14.25, 15.5, 18.75, 25.

How to read the result

Compare the IQR with the median: here the middle half spans 4.5 units around 15.5. If the median is closer to Q1 than to Q3 (15.5 is 1.25 above Q1 and 3.25 below Q3), the data are right-skewed. A point beyond the fences is a candidate outlier to investigate, not automatically an error.

Common mistakes

Keep in mind: With fewer than about 10 values, quartiles and outlier fences are unstable, and the 1.5 × IQR rule is a heuristic, not a statistical test.

Frequently asked questions

Why does my textbook give a different Q1?

Many textbooks take the median of the lower half (here 14) instead of interpolating. Both are valid conventions; just use one consistently.

Is the IQR the same as the range?

No. The range is maximum − minimum (25 − 11 = 14 here) and depends entirely on the two extreme values; the IQR covers only the middle half.

What does a box plot show?

The box runs from Q1 to Q3 with a line at the median; whiskers extend to the most extreme values inside the fences, and points beyond them are drawn individually.

Sources: Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley. · Hyndman, R. J. & Fan, Y. (1996). Sample quantiles in statistical packages. The American Statistician, 50(4), 361–365.

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →