|wordwrap Filter

inserts newline after every n characters.

String As Markdown

Argument
n (required) – the number of characters per line.

Documentation

Implements word wrapping by inserting a newline character every n characters. Useful for plain text, but not typically for HTML.

Variable

blurb_text = 'You are pretty smart!'

Template

{{ blurb_text|wordwrap:10 }}

Result

You are
pretty
smart!

In a browser, whitespace is condensed, so the output would be:

You are pretty smart!

Commentary

Useful for plain text, but not typically for HTML.

More String Filters

All String Filters


Did we get something wrong? Is there a use case for the wordwrap filter that we should add? Please let us know.

Send Feedback

Official Documentation
This page last updated on August 2, 2026