> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TO_HEX

> Returns uppercase hexadecimal text.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

NULL input returns NULL.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
to_hex(value)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | STRING | Yes | Text whose UTF-8 bytes are encoded as hexadecimal. |

## Returns

* Type: STRING
* Possible values: Uppercase hex digits.
* NULL behavior: NULL input returns NULL.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT to_hex('A') AS "value";
```

| value |
| - |
| 41 |

### Encode multibyte text

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT to_hex('é') AS encoded;
```

| encoded |
| - |
| C3A9 |

## Limitations

* TO\_HEX takes one STRING argument. Use HEX for integer or BINARY values. A second TO\_HEX argument is not supported.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.