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

# Encode Text

> Encode text using standard encoding formats

The **Encode Text** action allows you to encode text into various different formats. Encoding is useful when a service (such as an external API) is only compatible with certain encoding formats.

<Frame>
  <img src="https://mintcdn.com/avicenna-a10e7e50/tMBjg72aWj8Ra2sj/Screenshot2026-01-27at10.15.16PM.png?fit=max&auto=format&n=tMBjg72aWj8Ra2sj&q=85&s=3aa346df07bad89bc003b3bb1faa7336" alt="Screenshot of the Encode Text action block" width="864" height="410" data-path="Screenshot2026-01-27at10.15.16PM.png" />
</Frame>

***

### Input Text

The **input text** is the base text value that will be encoded. This may be static text or a variable.

### Encoding Method

The **encoding method** is the format of encoding that will be used on your text value. Below are listed the available formats that can be used to encode a text value using the Encode Text action:

| **Format** | **Description**                                                                     | **Example Output**                                                                                   |
| ---------- | ----------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- |
| Base64     | Helps prevent data corruption in JSON, HTTP Headers, etc.                           | `SGVsbG8gVGhlcmU=`                                                                                   |
| Base64URL  | URL-safe version of Base64 that prevents corruption in URLs, query parameters, etc. | `SGVsbG8gVGhlcmU`                                                                                    |
| Hex        | Converts to hexadecimal with a base-16 format for compacting and safety             | `48656c6c6f205468657265`                                                                             |
| UTF-8      | Efficient endocing format used for web services and multilingual compatibility      | `Hello There`                                                                                        |
| ASCII      | Standard binary integer used to represent English characters                        | `Hello There`                                                                                        |
| Binary     | Foundational 2-bit encoding format used at the deepest levels of computing          | `01001000 01100101 01101100 01101100 01101111 00100000 01010100 01101000 01100101 01110010 01100101` |

### Reference Variable

<Frame>
  <img src="https://mintcdn.com/avicenna-a10e7e50/tMBjg72aWj8Ra2sj/Screenshot2026-01-28at7.07.31PM.png?fit=max&auto=format&n=tMBjg72aWj8Ra2sj&q=85&s=e4f8cf13a76fe834ed8105526b64ccb4" alt="Screenshot of reference variable settings" width="730" height="217" data-path="Screenshot2026-01-28at7.07.31PM.png" />
</Frame>

This variable allows you to refer to the result of the text encoding in future action blocks down your endpoint's flow. This variable must be assigned a custom name.

<Tip>
  Make your reference variable names as descriptive and unique as possible to prevent your endpoint flow from becoming cluttered. If a future variable is assigned the same name, the value of your reference variable will be overriden.
</Tip>
