# `TO_HEX`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Converts data to its equivalent hexadecimal representation.

## Syntax

```sql
to_hex(<data>)
```

## Arguments

### Required

- `<data>`: The data to encode (int, bigint, or bytea).

## Returns

Returns a text value containing the hexadecimal representation of the data.

## Considerations

- Output is lowercase hexadecimal without a '0x' prefix.

## Examples

### Convert to Hex

Encode an integer to hexadecimal.

```sql
SELECT to_hex(2147483647) AS result;
```

Returns `'7fffffff'`.

## Related Documentation

- [String Types](/docs/data/data-cloud-query-guide/references/dc-sql-reference/string.md)
