# Encode text

Encodes text into the chosen character encoding. Encode text 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.                                                                                       |
| Encoding  | string | no       | `UTF-8 (65001)` | Choose one of: `UTF-8 (65001)`, `UTF-7 (65000)`, `UTF-16LE (1200)`, `UTF-16BE (1201)`, `UTF-32LE (12000)`, `UTF-32BE (12001)`, and 146 more. |

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

## Returned value

| Type     | Description                               |
| -------- | ----------------------------------------- |
| `string` | Result of the Encode text transformation. |

## Limitations

- Not every charset can represent every Unicode character; unsupported characters may be substituted or cause errors depending on the encoding.

## Example

<details>
<summary>Encode text as UTF-8 bytes</summary>

Encode text into a chosen character encoding. Start with UTF-8 unless a legacy system requires another charset.

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

   ```text title="Input"
   Hello
   ```

2. Leave **Encoding** on `UTF-8 (65001)` unless you need another charset.

3. Confirm **Output value** is the encoded byte representation.

</details>
