# Median and percentiles

> The middle value of a list, and the values that mark off the slowest or biggest slice.

- Level: Basic
- Topics: Data
- URL: https://tidbit.legios.com.ar/median-and-percentiles/
- In Spanish: [Mediana y percentiles](https://tidbit.legios.com.ar/es/median-and-percentiles/)

Line up a set of numbers from smallest to largest. The **median** is the one in the middle: half the values are below it and half above. It answers "what is typical?" better than the average when a few values are extreme. If nine people earn modest salaries and a tenth is a millionaire, the average salary jumps, but the median barely moves.

A **percentile** generalizes the same idea. The 90th percentile is the value that 90% of the data falls below. The median is simply the 50th percentile, often written p50. Pediatricians use percentiles on growth charts: a baby at the 75th percentile for height is taller than 75% of babies the same age.

In technology, percentiles are how teams talk about speed. Saying a website responds in 200 milliseconds on average hides the people who waited five seconds. So teams watch the **p95** or **p99**: the response time that 95% or 99% of requests beat. If p99 is two seconds, one request in a hundred takes longer than that, and on a busy site that is a lot of annoyed people. Percentiles keep the unlucky tail visible.

## An analogy

Like lining up a class by height. The median is the kid standing exactly in the middle of the line. The 90th percentile is the kid nine tenths of the way toward the tall end.

## Keep in mind

- The median is the middle value once the data is sorted.
- Unlike the average, the median ignores a few extreme values.
- The Nth percentile is the value N% of the data falls below; the median is p50.
- p95 and p99 are the standard way to measure slow requests.

## Go deeper

- [Median on Wikipedia](https://en.wikipedia.org/wiki/Median)
- [Percentile on Wikipedia](https://en.wikipedia.org/wiki/Percentile)

## Related terms

- [Website](https://tidbit.legios.com.ar/website/): A set of web pages under one address, stored on a server and opened in a browser.
