---
title: "Format.htmlentities ViewHelper <f:format.htmlentities>"
manual: "Fluid ViewHelper Reference"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-format-htmlentities@main"
source: "Global/Format/Htmlentities.rst"
modified: "2026-09-17T05:12:06+00:00"
---

# Format.htmlentities ViewHelper `<f:format.htmlentities>`

ViewHelper to apply `htmlentities()` escaping to a value, transforming all HTML special characters to entity representations (like `"` to `&quot;`).

Go to the source code of this ViewHelper: [Format\\HtmlentitiesViewHelper.php (GitHub)](https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlentitiesViewHelper.php).

**Table of contents**

-   [Examples](https://docs.typo3.org/permalink/t3viewhelper:examples@main)
-   [Arguments of the <f:format.htmlentities> ViewHelper](https://docs.typo3.org/permalink/t3viewhelper:arguments-of-the-f-format-htmlentities-viewhelper@main)

## Examples

### Default notation

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
<f:format.htmlentities>{text}</f:format.htmlentities>
```

Text containing the following signs `&` `"` `'` `<` `>` will be processed by `htmlentities()`.
These will result in: `&amp;` `&quot;` `&#039;` `&lt;` `&gt;`.

### Inline notation

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
{text -> f:format.htmlentities(encoding: 'ISO-8859-1')}
```

Text containing the following signs `&` `"` `'` `<` `>` will be processed by `htmlentities()`.
These will result in: `&amp;` `&quot;` `&#039;` `&lt;` `&gt;`.

But encoded as ISO-8859-1.

## Arguments of the `<f:format.htmlentities>` ViewHelper

-   **doubleEncode**

    -   *Type:* bool
    -   *Default:* true

    If FALSE existing html entities won't be encoded, the default is to convert everything.

-   **encoding**

    -   *Type:* string

    Define the encoding used when converting characters (Default: UTF-8

-   **keepQuotes**

    -   *Type:* bool
    -   *Default:* false

    If TRUE, single and double quotes won't be replaced (sets ENT_NOQUOTES flag).

-   **value**

    -   *Type:* string

    string to format
