What Are Quartiles?

Quartiles are the three values that split a sorted dataset into four groups of equal size. The first quartile (Q1) marks the boundary below which 25% of your data falls. The second quartile (Q2), also known as the median, separates the lower and upper halves. The third quartile (Q3) indicates the point where 75% of the data lies below and 25% above.

This approach is particularly powerful when datasets contain outliers or skewed distributions. For example, if you're examining student test scores, the mean might be distorted by one extremely high or low performer. Quartiles instead focus on where most students cluster, giving a clearer picture of typical performance.

The distance between Q1 and Q3 is called the interquartile range (IQR), which captures the spread of the central 50% of your data.

Quartile Formulas

To calculate quartiles, use these position-based formulas where n is the number of data points:

Q1 position = (n + 1) ÷ 4

Q2 position = (n + 1) ÷ 2

Q3 position = 3(n + 1) ÷ 4

IQR = Q3 − Q1

  • n — Total count of data points in your dataset
  • Q1 — First quartile—the value at the 25th percentile
  • Q2 — Second quartile or median—the value at the 50th percentile
  • Q3 — Third quartile—the value at the 75th percentile
  • IQR — Interquartile range—the spread of the middle 50% of data

How to Calculate Quartiles Manually

Start by arranging your data in ascending order. For a dataset with 24 values, follow these steps:

  • Find the median: With an even count (24), average the two middle values (positions 12 and 13). If your ordered data has values 30 and 30 in those positions, the median is 30.
  • Locate Q1: Find the median of the lower half—all values below the overall median. This becomes Q1.
  • Locate Q3: Find the median of the upper half—all values above the overall median. This becomes Q3.
  • Calculate IQR: Subtract Q1 from Q3 to get the interquartile range.

Different methods exist (Tukey's hinges, linear interpolation, etc.), and slight variations may occur depending on the algorithm used. Most statistical software applies consistent, reproducible methods.

Real-World Example

Imagine a high school class with 24 test scores out of 50 points: 9, 12, 17, 19, 21, 21, 22, 22, 25, 27, 29, 30, 30, 32, 33, 36, 37, 38, 40, 42, 42, 44, 45, 48.

After ordering (already done above), you find:

  • Median (Q2) = (30 + 30) ÷ 2 = 30
  • Q1 (median of lower 12 values) = (21 + 22) ÷ 2 = 21.5
  • Q3 (median of upper 12 values) = (38 + 40) ÷ 2 = 39
  • IQR = 39 − 21.5 = 17.5

This tells the teacher that half the class scored between 21.5 and 39, with typical scores clustering around 30. The relatively tight IQR suggests consistent performance across the middle range.

Key Considerations When Using Quartiles

Avoid common pitfalls when interpreting quartile analysis:

  1. Don't confuse quartiles with quadrants — Quartiles refer to data positions, not chart regions. When presenting a scatter plot, mention 'quartile thresholds' clearly if using them to divide the display, since many interpret 'quadrants' as visual chart regions.
  2. Watch for tied values at quartile boundaries — If multiple data points share the same value near Q1 or Q3, different calculation methods may yield slightly different results. Always note which methodology your analysis software employs.
  3. Ensure data is sorted before calculating — Quartiles require ordered data. Missing this step is a common mistake that invalidates all subsequent calculations. Double-check your dataset is arranged from smallest to largest.
  4. Remember quartiles don't show absolute values — Quartiles describe relative position and spread, not magnitude. A dataset with values 1–10 and another with 1,000–10,000 may have identical quartile structures but very different real-world implications.

Frequently Asked Questions

What's the difference between quartiles and percentiles?

Quartiles are specific percentiles: Q1 = 25th percentile, Q2 = 50th percentile, Q3 = 75th percentile. Percentiles are more granular—they divide data into 100 equal parts, so any value from the 1st to 99th percentile can be calculated. Quartiles are simpler to communicate and commonly used in box plots and statistical summaries.

Why is the interquartile range useful for detecting outliers?

The IQR captures where most of your data concentrates. Values falling below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are typically flagged as outliers. This method works well because it's not affected by extreme values themselves, unlike detection methods based on standard deviation.

Can I use quartiles with non-numeric data?

Quartiles require ordered, numeric data to calculate meaningful positions. If you have categorical data (like colors or city names), you cannot compute quartiles directly. However, you can assign numeric ranks or codes and then analyze quartile distribution by category.

What sample size do I need for reliable quartiles?

While mathematically you can compute quartiles with as few as 4 values, reliability improves significantly with 20+ observations. Smaller samples produce quartiles that may be overly sensitive to individual data points. For robust statistical conclusions, aim for at least 30 observations when possible.

How do quartiles relate to box plots?

Box plots use quartiles as their foundation. The 'box' spans from Q1 to Q3, the line inside shows Q2 (median), and 'whiskers' typically extend to Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Any points beyond the whiskers appear as individual dots representing suspected outliers.

Are there different methods for calculating quartiles?

Yes. The most common include the Tukey method (used in box plots), linear interpolation (common in spreadsheet software), and the nearest rank method. Results may differ slightly, especially with small samples. Excel, R, and Python may produce slightly different values; the differences are usually negligible for larger datasets.

More statistics calculators (see all)