# Percentile Calculator

URL: https://hifreetools.com/calculators/percentile-calculator

> Find the value at any percentile of a list of numbers using the linear-interpolation method, with the sorted data, interpolated rank, and full arithmetic shown for every result.

## Quick answer

A percentile is the value below which a given percentage of a data set falls. To compute the p-th percentile by linear interpolation, sort the data ascending, find the rank with rank = (p ÷ 100) · (N − 1), then interpolate between the two surrounding values. For example, the 50th percentile (median) of 10, 20, 30, 40, 50 has rank = (50 ÷ 100) · (5 − 1) = 2, so the answer is the value at sorted index 2, which is 30.

## Formula

- Interpolated rank: rank = (p / 100) × (N − 1)
- Linear interpolation: Pₚ = x[k] + (x[k+1] − x[k]) × f

## Examples

- Median (50th percentile) of 10, 20, 30, 40, 50: Data = 10, 20, 30, 40, 50; p = 50 → 30
- 25th percentile (Q1) of 1 through 10: Data = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10; p = 25 → 3.25
- 90th percentile of ten test scores: Data = 55, 62, 68, 71, 74, 77, 80, 83, 88, 95; p = 90 → 88.7
- Median of an unsorted, odd-length list: Data = 3, 7, 8, 5, 12, 14, 21, 13, 18; p = 50 → 12

## FAQ

**What is the formula for a percentile?**
Sort the data ascending, then compute the interpolated rank as rank = (p ÷ 100) × (N − 1), where p is the percentile and N is the number of values. If the rank is a whole number, the percentile is the value at that 0-based sorted index. If it falls between two indices, interpolate linearly: Pₚ = x[k] + (x[k+1] − x[k]) × f, where k is the floor of the rank and f is its fractional part.

**How do I calculate the 25th, 50th, and 75th percentile (quartiles)?**
Use p = 25 for the first quartile (Q1), p = 50 for the median (Q2), and p = 75 for the third quartile (Q3). For the data 1–10: Q1 = 3.25, Q2 = 5.5, and Q3 = 7.75 with the linear-interpolation method. The inter-quartile range is Q3 − Q1 = 4.5, a common measure of spread.

**Why do different tools give slightly different percentile values?**
There is no single agreed definition. This calculator uses linear interpolation between closest ranks — the same method as Excel's PERCENTILE.INC and NumPy's default — while other tools may use the nearest-rank method, the exclusive method (PERCENTILE.EXC), or Tukey's hinges. The differences are largest in small data sets and shrink as N grows.

**What is the difference between a percentile and a percentile rank?**
A percentile is a value: the 90th percentile is the data point below which 90% of values fall. A percentile rank is the inverse — given a value, it tells you the percentage of the data that lies at or below it. This tool computes the percentile (the value) from a percentage you supply.

**Does this percentile calculator handle decimals and negative numbers?**
Yes. You can enter decimals (e.g. 3.5, 7.25) and negative numbers (e.g. −10, −2). Values can be separated by commas, semicolons, spaces, tabs, or new lines, and the tool sorts them automatically before computing the percentile.

**What percentile is the minimum and maximum?**
With this method the 0th percentile equals the minimum value and the 100th percentile equals the maximum, because rank = 0 lands on the first sorted value and rank = N − 1 lands on the last. The median (middle) corresponds to the 50th percentile.


## Sources

- [Wikipedia — Percentile (linear interpolation methods)](https://en.wikipedia.org/wiki/Percentile)
- [NumPy — numpy.percentile (default 'linear' method)](https://numpy.org/doc/stable/reference/generated/numpy.percentile.html)
- [NIST/SEMATECH e-Handbook — Percentiles](https://www.itl.nist.gov/div898/handbook/prc/section2/prc252.htm)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Percentile Calculator", https://hifreetools.com/calculators/percentile-calculator
