---
title: "Format.nl2br ViewHelper <f:format.nl2br>"
manual: "Fluid Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/fluid:typo3fluid-fluid-format-nl2br"
source: "ViewHelpers/Fluid/Format/Nl2br.rst"
rendered: "2026-09-26T08:24:58+00:00"
---

# Format.nl2br ViewHelper `<f:format.nl2br>` {#typo3fluid-fluid-format-nl2br}

> [!NOTE]
> This reference is part of the documentation of Fluid Standalone.
> If you are working with Fluid in TYPO3 CMS, please refer to
> [TYPO3's ViewHelper reference](https://docs.typo3.org/other/typo3/view-helper-reference/14.3/en-us/Global/Format/Nl2br.html) instead.

Wrapper for PHPs `nl2br` function.
See [https://www.php.net/manual/function.nl2br.php](https://www.php.net/manual/function.nl2br.php).

## Examples {#examples}

### Default {#default}

```php
<f:format.nl2br>{text_with_linebreaks}</f:format.nl2br>

```

Text with line breaks replaced by `<br />`

### Inline notation {#inline-notation}

```php
{text_with_linebreaks -> f:format.nl2br()}

```

Text with line breaks replaced by `<br />`

Go to the source code of this ViewHelper: [Format\\Nl2brViewHelper.php (GitHub)](https://github.com/TYPO3/Fluid/blob/main/src/ViewHelpers/Format/Nl2brViewHelper.php).

**Arguments**

The following arguments are available for the format.nl2br ViewHelper:

-   **value**

    -   *Type:* string

    string to format
