# random() Function & Examples

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

## random

#### random()

#### random(max)

#### random(min, max)

#### random(size)

#### random(size, max)

#### random(size, min, max)

Try it yourself:

```calculio
random()
random(10, 20)
random([2, 3])
```

---

## random(): Generating Random Values

**random()** generates pseudo-random numeric values, commonly in a specified range. It is useful for simulations, sampling, test data, and randomized visual effects.

## Randomness and reproducibility

A generated value is not a guarantee of fairness or cryptographic security. For simulation results, record the seed or generated inputs when reproducibility matters. Use [randomInt()](https://calcul.io/function/randomInt/index.md) when outcomes must be integers, and [round()](https://calcul.io/function/round/index.md) only for display rather than to simulate a uniform integer.

Validate lower and upper bounds, especially when bounds may be reversed or equal. Combine random values with [min()](https://calcul.io/function/min/index.md) and [max()](https://calcul.io/function/max/index.md) for clamping only when that distributional effect is intentional.

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