How to Calculate Percentiles and Quartiles

Learn how to calculate percentiles and quartiles from a dataset. This guide explains the percentile rank formula, the interquartile range, and how these measures describe data distribution.

What Are Percentiles?

A percentile indicates the value below which a given percentage of observations in a dataset falls. The 80th percentile, for example, is the value below which 80% of the data lies. Percentiles divide a distribution into 100 equal parts and are widely used in standardized testing (SAT scores), growth charts (pediatric height and weight), and income distribution reporting.

How to Find a Percentile

To find the Pth percentile of a dataset with n values: Step 1: Sort the data in ascending order. Step 2: Compute the rank L = (P/100) × n. Step 3: If L is not an integer, round up to the next whole number — the value at that position in the sorted list is the Pth percentile. If L is an integer, average the values at positions L and L+1. Different software packages use slight variations of this algorithm, so results may differ slightly across tools.

What Are Quartiles?

Quartiles divide a sorted dataset into four equal parts. The first quartile Q1 is the 25th percentile, the second quartile Q2 (the median) is the 50th percentile, and the third quartile Q3 is the 75th percentile. Together they provide a quick summary of the center and spread of a distribution, and they form the basis of the five-number summary: minimum, Q1, median, Q3, maximum.

Calculating Q1, Q2, and Q3

To find the quartiles: sort the data, identify the median Q2 (middle value if n is odd; average of two middle values if n is even), then find Q1 as the median of the lower half of data (values below Q2) and Q3 as the median of the upper half (values above Q2). For the dataset [3, 5, 7, 8, 9, 11, 13, 15], Q2 = (8+9)/2 = 8.5, Q1 = median of [3,5,7,8] = (5+7)/2 = 6, Q3 = median of [9,11,13,15] = (11+13)/2 = 12.

The Interquartile Range (IQR)

The interquartile range is IQR = Q3 − Q1. It measures the spread of the middle 50% of the data and is resistant to outliers, unlike the range. For the example above, IQR = 12 − 6 = 6. The IQR is used to construct box-and-whisker plots and to define outlier fences: a value is typically considered an outlier if it falls below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR.

Percentile Rank vs. Percentile Value

The percentile value is a specific data value corresponding to a given percentile (e.g., Q1 = 6). The percentile rank is the percentage of data points that fall at or below a given value, computed as: Percentile Rank = (Number of values ≤ x) / n × 100. These are inverse operations: you either start with a percentage and find the value, or start with a value and find the percentage.

Applications in Practice

Percentiles and quartiles are used in descriptive statistics, box plots, and exploratory data analysis to understand distribution shape, skewness, and outliers without assuming a normal distribution. In finance, the Value at Risk (VaR) at the 5th percentile tells you the loss level that will not be exceeded 95% of the time. In medicine, growth charts plot a child's height or weight against age-group percentiles to assess development.

Try These Calculators

Put what you learned into practice with these free calculators.