# median() Function & Examples

Use the median() statistics function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## median

#### median(a, b, c, ...)

#### median(A)

Try it yourself:

```calculio
median(5, 2, 7)
median([3, -1, 5, 7])
```

[max](https://calcul.io/function/max/index.md)

[mean](https://calcul.io/function/mean/index.md)

[min](https://calcul.io/function/min/index.md)

[prod](https://calcul.io/function/prod/index.md)

[std](https://calcul.io/function/std/index.md)

[sum](https://calcul.io/function/sum/index.md)

[variance](https://calcul.io/function/variance/index.md)

---

## Find the middle value with median

**median** returns the central value of ordered numeric data, or the average of the two central values for an even number of observations. It is a robust measure of typical value.

## Why use median

For 1, 3, and 100, the median is 3 while the [mean](https://calcul.io/function/mean/index.md) is pulled upward. Use [sort](https://calcul.io/function/sort/index.md) to inspect ordering, [quantileSeq](https://calcul.io/function/quantileSeq/index.md) for other percentiles, and [mad](https://calcul.io/function/mad/index.md) for robust spread.

## Caveats

Median needs comparable numeric values and a non-empty collection. It does not describe multimodal data; use [mode](https://calcul.io/function/mode/index.md) when the most frequent value is the question.

[All functions](https://calcul.io/functions/index.md)
