Liquid filters are used to modify the output of strings, numbers, variables, and objects. They are separated from the value to which they are being applied by a |.

It is important that site authors properly encode liquid output to ensure that XSS vulnerabilities are not inadvertently exposed.

 

{{ 'hal 9000' | upcase }} <!-- Output: HAL 9000 -->

Some filters accept parameters. Filters can also be combined, and are applied in order from left to right.

{{ 2 | times: 2 | minus: 1 }}  <!-- Output: 3 -->

{{ "Hello, " | append: user.firstname }} <!-- Output: Hello, Dave -->

In addition to being used within an output tag {{ }}, they can also be used within an assign tag.

{% assign n = 2 | times: 2 %}