# hex() Function & Examples

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

## hex

#### hex(value)

Try it yourself:

```calculio
hex(240)
```

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

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

---

## Convert integers to hexadecimal with hex

**hex(value)** represents an integer in base 16. Hexadecimal uses digits 0–9 and letters A–F, and is common in programming, binary inspection, colors, and memory-oriented work.

## Examples and related bases

Decimal 255 becomes `FF` in hexadecimal. Use [bin](https://calcul.io/function/bin/index.md) for base 2 and [oct](https://calcul.io/function/oct/index.md) for base 8. Bitwise operations such as [bitAnd](https://calcul.io/function/bitAnd/index.md) are often easier to understand when their results are displayed in hex.

## Input notes

Hex is intended for integer values. Fractional input should be converted deliberately rather than assuming a meaningful digit-for-digit representation; use [floor](https://calcul.io/function/floor/index.md) or [round](https://calcul.io/function/round/index.md) only when that rounding rule is truly intended. The result is a textual/base representation, not a new quantity to add directly without conversion.

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