# To Hex

Converts the input string to hexadecimal bytes separated by the specified delimiter. For example, The UTF-8 encoded string `Γειά σου` becomes `ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a`. To Hex lives in the **Data format** category of the `fx` menu.

## Parameters

| Parameter      | Type   | Required | Default | Description                                                                                 |
| -------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------- |
| Input          | string | yes      | —       | Value to transform. Previous step output or a literal.                                      |
| Delimiter      | string | no       | `Space` | Choose one of: `Space`, `Percent`, `Comma`, `Semi-colon`, `Colon`, `Line feed`, and 5 more. |
| Bytes per line | number | no       | `0`     | Numeric value. Default `0`.                                                                 |

`Input` is the primary value (previous step output or a literal).

## Returned value

| Type     | Description                          |
| -------- | ------------------------------------ |
| `string` | Result of the To Hex transformation. |

## Limitations

- This operation treats Input as raw bytes (binary-capable). Non-text payloads may display differently after decoding.
- Invalid or mismatched encoding for the chosen options typically raises an evaluation error — fix the Input or options before re-running.

## Example

<details>
<summary>Convert text to hex bytes</summary>

Encode the input as hexadecimal bytes with a delimiter. Useful when an API or log expects a hex dump of a string.

1. Set **Input** to the text to encode. Paste:

   ```text title="Input"
   Hi
   ```

2. Leave **Delimiter** on `Space` and **Bytes per line** on `0`.

3. Confirm **Output value** looks like space-separated hex bytes (for example `48 69`).

</details>
