Percentile & Quartile Calculator

Compute quartiles (Q1, Q2, Q3) and the interquartile range (IQR), or find any percentile of your data using linear interpolation. Includes a box-plot visual.

Quartiles & percentiles explained, step by step

Percentiles rank values against the rest of the data. Being in the 90th percentile on a test means you outscored 90% of the group — the raw score itself might be 78/100. Quartiles are just the three named percentiles (25th, 50th, 75th) that split sorted data into quarters. Each card below walks through one piece of the workflow this calculator runs.

1. Quartiles — Q1, Q2, Q3 split the data into four equal groups

Sort ascending, then split. Q2 is the median. Q1 is the median of the lower half (25% of the data falls below it); Q3 is the median of the upper half (75% falls below it). Together they carve the sorted data into four groups of roughly equal size.

Q1 = 25th pct · Q2
= median · Q3
= 75th pct
Example
Given
3, 5, 7, 8, 12, 13, 14, 18, 21 (n = 9)
Substitute
Q1 = med{3,5,7,8} · Q2
= 12 · Q3
= med{13,14,18,21}
Answer
Q1 = 6
Q2 = 12
Q3 = 16

2. Arbitrary percentile — linear interpolation

For any P between 0 and 100, compute the fractional rank r = (P/100)·(n − 1). If r isn't an integer, slide between the two neighbouring sorted values proportionally. This is what NumPy percentile and Excel PERCENTILE.INC use by default.

rank = (P / 100)·(n − 1) value = sorted[⌊r⌋] + f·(sorted[⌈r⌉] − sorted[⌊r⌋])
Ptarget percentile 0–100·nsample size·ffractional part of r
Example
Given
n = 10
P = 90
Substitute
rank = 0.9·9
= 8.1 → between sorted[8]
sorted[9]
Answer
value = sorted[8] + 0.1·(sorted[9] − sorted[8])

3. IQR — spread of the middle 50%

IQR = Q3 − Q1 captures the spread of the middle half of the data. Unlike range (max − min), a single stray value can't distort it. Tukey's rule flags values beyond Q1 − 1.5·IQR or Q3 + 1.5·IQR as candidate outliers.

IQR = Q3 − Q1 fences = [Q1 − 1.5·IQR
Q3 + 1.5·IQR]
Example
Given
Q1 = 46.5
Q3 = 59.5
Substitute
IQR = 13 · upper fence
= 59.5 + 1.5·13
= 79
Answer
value 240 > 79 → outlier

4. Reading a box plot

The box spans Q1 to Q3 — its width is the IQR. The line inside is the median. Whiskers reach to the extreme non-outlier values. Dots beyond the whiskers are outliers. A lopsided box or a median stuck near one end signals skew.

box = [Q1
Q3] · whiskers within 1.5·IQR fences
Example
Given
median near left edge of the box
Substitute
long right whisker
short left whisker
Answer
right-skewed distribution

For a full outlier workflow across the whole data set, pair this with the Outlier Detector Calculator, which applies Tukey's 1.5·IQR and 3·IQR fences and highlights every flagged value.

Common mistakes

  • Not sorting first. Quartiles are always computed on the sorted data — the original order tells you nothing.
  • Confusing percentile with percentage. A test score is a percentage of possible marks; a percentile is a rank against other people.
  • Expecting every tool to agree. Different quartile methods legitimately give slightly different Q1 and Q3 on small samples. Always state which method you used.
  • Treating any outlier as bad data. Tukey's fences flag candidates. Investigate — an outlier can be a data-entry error or the most interesting point in your sample.
  • Using IQR on tiny samples. With fewer than about 8 values, quartiles are jumpy — a single point can move them a lot.

Features of this calculator

  • Two sub-tools: full quartile breakdown, or any specific percentile from 0 to 100
  • Quartiles use the exclusive median-of-halves method (matches this site's Median calculator)
  • Arbitrary percentiles use linear interpolation between closest ranks (same as NumPy & Excel PERCENTILE.INC)
  • Box plot showing min, Q1, median, Q3 and max — with potential outliers marked separately
  • Automatic outlier detection using Tukey's 1.5·IQR fences
  • Full step-by-step working — sorted data, rank, interpolation, IQR and outlier fences
  • Copy the result summary or download the whole panel — box plot and steps — as an image

Frequently asked questions

+What's the difference between a percentile and a percentage?

A percentage measures how much of something you got; a percentile measures how you rank against others. Scoring 87% on a test means 87 marks out of 100. Being in the 87th percentile means you outscored 87% of the people who took it.

+Why do different tools give different quartile values?

There are multiple defined ways to compute quartiles (nine, in R's convention). The two most common are the exclusive method (median-of-halves, excluding the median for odd n) and the inclusive method. Excel's PERCENTILE.INC uses linear interpolation across the full data. All are correct — they just cut slightly differently, mainly on small samples.

+Which method does this calculator use?

Q1, Q2, Q3 use the exclusive median-of-halves method, matching this site's Mean/Median/Mode calculator. Arbitrary percentiles use linear interpolation between closest ranks (rank = (P/100)·(n−1)) — NumPy's and Excel PERCENTILE.INC's default.

+How is IQR used to detect outliers?

Tukey's rule flags values below Q1 − 1.5·IQR or above Q3 + 1.5·IQR as potential outliers, and beyond ±3·IQR as extreme outliers. This calculator highlights any it finds.

+Can a percentile equal one of my data points?

Yes — whenever the fractional rank lands on a whole number, the percentile equals the value at that sorted position exactly, with no interpolation needed.

Related calculators