Percentile and Quartile Calculator

Percentile & Quartile Calculator

Paste your numbers to get quartiles, the interquartile range, outlier fences, any percentiles you want, and the percentile rank of a specific value. Choose the calculation method to match Excel, R or your textbook. Everything runs in your browser and nothing is uploaded.

A list of numbers separated by commas, spaces or new lines. Or paste a table with a header row and choose the column.

Summary

Percentiles

Percentile rank of your value

Percentile curve

The line shows the data value at every percentile from 0 to 100. Diamonds mark the quartiles, circles mark your requested percentiles, and the dashed line marks your value.

Percentiles, quartiles and percentile rank

A percentile is a value below which a given share of the data falls. The 90th percentile is the value that about 90% of observations do not exceed. The quartiles are three special percentiles: Q1 is the 25th, Q2 (the median) the 50th and Q3 the 75th. They split the sorted data into four parts with roughly equal numbers of values. The interquartile range (IQR) is Q3 − Q1, the span of the middle half of the data.

A percentile rank asks the reverse question: given a value, what share of the data lies below it? If a student scored 72 and 85% of the class scored lower, the percentile rank of 72 is 85. A percentile is a value in your data’s units. A percentile rank is a percentage between 0 and 100.

Why calculators disagree

For a finite sample there is no single agreed definition of a percentile, because the position you want usually falls between two data points. Hyndman and Fan (1996) list nine common definitions, and Langford (2006) shows that textbooks and software give different quartiles for the same data. This tool offers the three you are most likely to need:

MethodPosition in sorted data (1 = smallest)Used by
Inclusive (type 7)1 + (n − 1) × p, with interpolationExcel PERCENTILE.INC and QUARTILE.INC, R and NumPy defaults, pandas, Google Sheets
Exclusive (type 6)(n + 1) × p, with interpolation. Undefined if p < 1/(n+1) or p > n/(n+1)Excel PERCENTILE.EXC and QUARTILE.EXC, Minitab, SPSS
Nearest rankThe value at rank ⌈p × n⌉, no interpolationMany introductory courses; the result is always a value from the dataset

For large samples the methods give nearly identical answers. For small samples the differences can be noticeable, so always state the method alongside your results.

Worked example you can check by hand

Take the 15 sorted values 15, 20, 35, 40, 42, 45, 50, 52, 60, 65, 70, 72, 80, 85, 90 (n = 15).

Inclusive: Q1 is at position 1 + 14 × 0.25 = 4.5, halfway between 40 and 42, so Q1 = 41. The median is the 8th value, 52. Q3 is at position 11.5, halfway between 70 and 72, so Q3 = 71. IQR = 30.
Exclusive: Q1 is at position 16 × 0.25 = 4, so Q1 = 40. Q3 is at position 12, so Q3 = 72. IQR = 32.
Nearest rank: Q1 is rank ⌈3.75⌉ = 4, so 40; Q3 is rank ⌈11.25⌉ = 12, so 72.

The 90th percentile is 83 (inclusive), 87 (exclusive) or 85 (nearest rank).

For the percentile rank of 50: six values are below it (15, 20, 35, 40, 42, 45) and one equals it. The share strictly below is 6/15 = 40%, the share at or below is 7/15 = 46.7%, and the mid-rank (counting ties as half) is 6.5/15 = 43.3%.

Percentile rank: three common definitions

  • Strictly below: the percentage of values less than yours. This is the simplest definition.
  • At or below: the percentage of values less than or equal to yours. It is the empirical cumulative distribution and matches many test-score reports.
  • Mid-rank: values below plus half of the values equal to yours. It treats ties fairly and is the one most statistical packages call “percentile rank”. When no values tie with yours, the first and last definitions differ by 1/n.

This tool shows all three so you can quote the one your source uses.

Using quartiles to find outliers

Tukey’s fences flag a value as unusual when it lies below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. The tool reports the fences and any values outside them. A flagged value deserves a look, but it is not automatically an error. Check the source before removing it.

Common mistakes

  • Mixing methods. Comparing your hand calculation with Excel or R can show a difference that comes only from the definition, not from an error.
  • Confusing percentile with percentage. Scoring in the 80th percentile does not mean scoring 80%. It means doing better than about 80% of the group.
  • Forgetting to sort. Percentiles come from sorted data. The tool sorts for you, but sort first when calculating by hand.
  • Using extreme percentiles on small samples. The 99th percentile of 20 values is basically the maximum. Treat tail percentiles from small data as rough.
  • Ignoring ties. Repeated values make percentile rank ambiguous, which is why there are several definitions.

Frequently asked questions

Which method matches Excel?

Inclusive matches PERCENTILE.INC, QUARTILE.INC and the older PERCENTILE and QUARTILE functions. Exclusive matches PERCENTILE.EXC and QUARTILE.EXC. Both are shown with their Excel names in the method menu.

Why does the exclusive method sometimes say “undefined”?

Exclusive percentiles are only defined between 1/(n+1) and n/(n+1) of the way through the data. With 15 values that is between 6.25% and 93.75%, so asking for the 5th or 99th percentile has no answer. Excel returns an error in the same situation.

Is the median the same as the 50th percentile?

Yes, in the inclusive and exclusive methods. With nearest rank and an even number of values, the median here is the lower of the two middle values, so it can differ from the usual middle-value average.

How do I find a percentile that is not a whole number, such as 97.5?

Type it into the percentiles box, for example 2.5, 97.5. Any number from 0 to 100 is accepted, separated by commas or spaces.

How many values do I need?

The calculation works with as few as one value, but quartiles are not meaningful below about 8 values, and the tool warns you. Percentiles beyond the 5th and 95th need many more.

Is my data uploaded anywhere?

No. The calculation runs as JavaScript on this page, and nothing is sent to a server.

Further reading

  • Hyndman, R. J., & Fan, Y. (1996). Sample quantiles in statistical packages. The American Statistician, 50(4), 361–365.
  • Langford, E. (2006). Quartiles in elementary statistics. Journal of Statistics Education, 14(3).
  • Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley.

Percentile & Quartile Calculator by Xcelario, part of the Academic Tools collection. Inclusive results match Excel’s PERCENTILE.INC and R’s quantile type 7; exclusive results match PERCENTILE.EXC and type 6. This tool supports learning and exploratory analysis; for publication or high-stakes decisions, confirm results in dedicated statistical software. Last updated November 2026.