# To Hex Content

Converts special characters in a string to hexadecimal. This format is used by SNORT for representing hex within ASCII text. For example, `foo=bar` becomes `foo|3d|bar`. To Hex Content 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.                                   |
| Convert                    | string  | no       | `Only special chars` | Choose one of: `Only special chars`, `Only special chars including spaces`, `All chars`. |
| Print spaces between bytes | boolean | no       | `false`              | Disabled by default.                                                                     |

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

## Returned value

| Type     | Description                                  |
| -------- | -------------------------------------------- |
| `string` | Result of the To Hex Content 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>Run To Hex Content</summary>

Converts special characters in a string to hexadecimal. Adjust optional parameters when the defaults do not match your payload.

1. Set **Input** to the value to transform. Paste:

   ```text title="Input"
   foo=bar
   ```

2. Review **Convert**, **Print spaces between bytes** and keep defaults unless your format requires otherwise.

3. Confirm **Output value** matches the expected result (for example `foo|3d|bar.`).

</details>
