DigitHelm

Quartile Calculator | Q1, Q2, Q3 & IQR

Calculate Q1, Q2 (median), Q3, interquartile range (IQR), and detect outliers from data.

0 valid numbers

What Is the Quartile Calculator | Q1, Q2, Q3 & IQR?

Quartiles divide a sorted dataset into four equal parts. Q1 (25th percentile) splits the lower half, Q2 (50th percentile) is the median, and Q3 (75th percentile) splits the upper half. The IQR measures the spread of the middle 50% of data and is robust against outliers. This calculator uses the Tukey (inclusive) method.

  • Paste or type any set of numbers separated by commas, spaces, or semicolons
  • Generates box-and-whisker plot with mean dot and outlier indicators
  • Computes five-number summary, IQR, variance, standard deviation, and skewness
  • Identifies outliers automatically using Tukey's 1.5×IQR fence rule

Formula

Five-Number Summary

Min

x₁

Q1

25th %ile

Q2

Median

Q3

75th %ile

Max

xₙ

  • IQR = Q3 − Q1, interquartile range (middle 50% spread)
  • Lower fence = Q1 − 1.5 × IQR, values below are outliers
  • Upper fence = Q3 + 1.5 × IQR, values above are outliers
  • Skewness = (1/n) Σ((xᵢ − x̄)/σ)³, measures asymmetry

How to Use

  1. 1Enter your dataset, numbers separated by commas, spaces, or semicolons
  2. 2At least 4 numbers are required; the more the better for the box plot
  3. 3Click "Calculate Quartiles" or use Ctrl+Enter
  4. 4The box plot appears first (for 5+ values) showing the distribution visually
  5. 5Scroll down to see the five-number summary, IQR, and extended statistics
  6. 6Outliers (if any) are flagged in red with the fence values shown

Example Calculation

Dataset: 2, 5, 7, 9, 12, 15, 18, 21, 25, 30

Sorted: 2, 5, 7, 9, 12, 15, 18, 21, 25, 30
n = 10
Q1 = median of [2,5,7,9,12] = 7
Q2 = (12 + 15) / 2 = 13.5
Q3 = median of [15,18,21,25,30] = 21
IQR = 21 − 7 = 14
Fences: [7 − 21, 21 + 21] = [−14, 42] → no outliers

Outlier detection

Add 100 to the dataset above. The upper fence is 42, so 100 exceeds it and is flagged as an outlier. The whisker extends to 30 (the highest non-outlier), and 100 appears as a red dot beyond it.

Understanding Quartile | Q1, Q2, Q3 & IQR

Quartile Methods

Several methods exist for computing quartiles. This calculator uses the Tukey (inclusive) method, which is the most common in statistics textbooks and Excel. The three main methods differ in how they handle the median when computing Q1 and Q3.

MethodQ1 / Q3 based onUsed in
Tukey (inclusive)Halves include the medianTextbooks, this calculator
ExclusiveHalves exclude the medianSome software (Minitab)
Weighted averageInterpolates between valuesExcel QUARTILE.INC

Frequently Asked Questions

What are quartiles?

Quartiles split a sorted dataset into four equal groups, each containing 25% of the data. They are a core tool in descriptive statistics for understanding data spread and shape.

  • Q1 (first quartile): 25% of data falls below this value
  • Q2 (second quartile / median): 50% of data falls below this value
  • Q3 (third quartile): 75% of data falls below this value
  • The IQR (Q3 − Q1) represents the spread of the central 50%

What is the IQR and why does it matter?

The IQR is one of the most useful measures of spread because it is not affected by outliers or extreme values. Unlike the standard deviation, it focuses on the central bulk of the data.

  • A small IQR indicates the middle data is tightly clustered
  • A large IQR indicates high variability in the central portion
  • Used in the Tukey fence rule to identify outliers
  • Preferred over range when outliers are present

How does outlier detection work?

The Tukey fence rule is the most widely used method for identifying potential outliers in a dataset. It defines "fences" beyond which data points are considered unusual.

  • Lower fence = Q1 − 1.5 × IQR
  • Upper fence = Q3 + 1.5 × IQR
  • Values outside these fences appear as dots beyond the box plot whiskers
  • The 1.5 multiplier was chosen by Tukey to flag about 0.7% of a normal distribution
  • For extreme outliers, some methods use 3×IQR instead

What is a box plot?

Box plots provide a compact visual summary of data distribution, showing center, spread, skewness, and outliers at a glance. Invented by John Tukey in 1970.

  • Box spans Q1 to Q3 (the IQR)
  • Vertical line inside the box marks Q2 (median)
  • Whiskers extend to the furthest non-outlier data points
  • Outlier dots appear beyond the whiskers
  • Orange dot shows the mean, its position relative to Q2 indicates skewness

What is the difference between mean and median?

Both the mean and median measure the center of a dataset, but they behave differently when outliers are present.

  • Mean = Σxᵢ / n, affected by every value including outliers
  • Median = middle value, unaffected by extreme values
  • For symmetric distributions, mean ≈ median
  • For right-skewed data (e.g. income), mean > median
  • For left-skewed data, mean < median

What does skewness indicate?

Skewness quantifies how much a distribution departs from symmetry. It is computed as the third standardised moment of the data.

  • Skewness ≈ 0: roughly symmetric (e.g. heights in a population)
  • Skewness > 0: right-skewed, long tail toward larger values (e.g. income)
  • Skewness < 0: left-skewed, long tail toward smaller values (e.g. exam scores)
  • Rule of thumb: |skewness| < 0.5 is roughly symmetric, 0.5–1 is moderately skewed

How many values do I need?

The calculator requires a minimum of 4 numbers. With more data, the statistics become more reliable and the box plot more informative.

  • 4–9 values: basic five-number summary only (no box plot)
  • 10–30 values: good box plot and reasonable outlier detection
  • 30+ values: reliable skewness and standard deviation estimates
  • Large datasets (100+): paste comma-separated or space-separated lists

Related Calculators