Skip to content
Zotonic
  • Start
  • Cookbook
  • Reference
  • Releases

Live search

Search across all Zotonic content

Type at least two characters

Results are matched against titles, summaries and topics as you type.

Filters · mod_base
  • Reference
  • Frontend developer
  • Template filter
  • Transform
  • Text

to_binary

Module

mod_base

Convert the input to a binary value.

Example:

{{ 42|to_binary }}

Results in the binary value <<"42">>.

This filter uses the z_convert:to_binary/1 function.

Edit on GitHub

Related documentation

Filters

truncatechars

Truncate a text to a maximum length in characters.

Filters

truncate_html

Truncate a HTML text to a maximum length.

Filters

replace

Regular expression replacement of a pattern with a string.

Filters

truncate

Truncate a text to a maximum length.

Filters

replace_args

Replace $N placeholders in string from a list of replacement values.

Filters

fix_ampersands

Replaces ampersands in the value with “&amp;” entities.

Filters

append

Appends the argument to the value.

Filters

brlinebreaks

Translate HTML <br/> elements into ASCII newlines ( \n ).

Filters

split

Splits the filter value into a list of values.

GitHub © 2026 Zotonic