|truncatechars Filter

truncates a value to n characters and appends an ellipsis (…).

String As Markdown

Argument
n (required) – number of characters to truncate to.

Documentation

Truncates a value to n characters and appends an ellipsis (…).

Variable

blurb_text = 'You are pretty smart!'

Template

{{ blurb_text|truncatechars:15 }}

Result

You are pretty…

Commentary

You should not use the truncatechars filter on HTML pages. Use truncatechars_html instead.

More String Filters

All String Filters


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

Send Feedback

Official Documentation
This page last updated on August 2, 2026