# To HTML Entity

Converts characters to HTML entities For example, `&` becomes `&amp;`. To HTML Entity lives in the **Data format** category of the `fx` menu. See [HTML character references](https://html.spec.whatwg.org/multipage/named-characters.html) for format details.

## Parameters

| Parameter              | Type    | Required | Default          | Description                                                          |
| ---------------------- | ------- | -------- | ---------------- | -------------------------------------------------------------------- |
| Input                  | string  | yes      | —                | Value to transform. Previous step output or a literal.               |
| Convert all characters | boolean | no       | `false`          | Disabled by default.                                                 |
| Convert to             | string  | no       | `Named entities` | Choose one of: `Named entities`, `Numeric entities`, `Hex entities`. |

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

## Returned value

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

## Example

<details>
<summary>Encode HTML entities</summary>

Convert characters that are special in HTML into entities so they render as text instead of markup.

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

   ```text title="Input"
   A & B < C
   ```

2. Confirm **Output value** uses entities (for example `&` becomes `&amp;`).

</details>
