---
title: "Filters"
slug: "liquid-tags-filters"
description: "Explains Liquid syntax, variables, tags, filters, operators, conditional logic, and personalization patterns with examples for Insider One campaigns."
updated: 2026-09-24T11:52:41Z
published: 2026-09-24T11:52:41Z
canonical: "academy.insiderone.com/liquid-tags-filters"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://academy.insiderone.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Filters
Filters are used to modify or format a variable's value at the point of output. They are applied using the pipe operator (|) and are supported only within {{ }} output blocks or {% assign %} statements.
## String Filters
Below you can see the supported string filters.
| Filter | Description |
| --- | --- |
| upcase / downcase | Converts a string to uppercase or lowercase. |
| capitalize | Uppercases the first character of a string. By default, no other characters are changed. |
| titleize | Capitalizes the first letter of every word and lowercases all other characters. |
| append / prepend | Adds text to the end or beginning of a string. |
| strip / lstrip / rstrip | Removes whitespace from both sides, from the left only, or from the right only. |
| replace / replace_first | Replaces all occurrences, or only the first occurrence, of a substring with another string. |
| remove / remove_first | Removes all occurrences, or only the first occurrence, of a substring. |
| truncate | Shortens a string to a maximum total length. The ellipsis is included in that count. |
| truncatewords | Shortens a string to a maximum number of words. |
| split | Splits a string into a list using a separator. |
| slice | Extracts a substring by position. A negative index counts from the end. |
| size | Returns the number of characters in a string, or the number of items in a list. |
| escape / escape_once | Converts HTML special characters in a string to entities. |
| url_encode / url_decode | URL-encodes or decodes a string. |
| strip_html | Removes all HTML tags from a string. |
| strip_newlines / newline_to_br | Removes line breaks from a string, or replaces them with
tags. |
| slugify | Lowercases text and joins the words with hyphens, keeping only ASCII letters and digits. |
| last_words | Returns the last words of a text string, split on a single space. |
| format | Fills the placeholders in a format string with the values you pass. |
| regex_search | Returns the first match of a regular expression, or a capture group when you pass its number. |
| list | Splits text into its individual characters. A list passes through unchanged. |
| parse_json | Reads a JSON string into values you can reference. |
upcase / downcase: Converts a string to uppercase or lowercase.
```plaintext
{{ "hello" | upcase }} → HELLO
{{ "HELLO" | downcase }} → hello
{{ name | upcase }} → ALICE (when name is "Alice")
```
full option
Pass "full" as an argument to apply full Unicode case mapping, where one character can become two.
```plaintext
{{ "straße" | upcase }} → STRAßE
{{ "straße" | upcase: "full" }} → STRASSE
```
**Language** option
Pass a language tag as an argument to apply that language's case rules.
```plaintext
{{ "istanbul" | upcase }} → ISTANBUL
{{ "istanbul" | upcase: "tr" }} → İSTANBUL
```
capitalize: Uppercases the first character of the string. By default, it does not change the case of any other characters.
```plaintext
{{ "hello world" | capitalize }} → Hello world
{{ "HELLO" | capitalize }} → HELLO
{{ "aLiCe SmItH" | capitalize }} → ALiCe SmItH
```
downcase_rest option
Pass “downcase_rest” as an argument to also lowercase all characters after the first. This matches Shopify Liquid's default capitalize behavior.
```plaintext
{{ "ALICE SMITH" | capitalize: "downcase_rest" }} → Alice smith
{{ "alice smith" | capitalize: "downcase_rest" }} → Alice smith
{{ "aLiCe SmItH" | capitalize: "downcase_rest" }} → Alice smith
```
capitalize: "downcase_rest" produces sentence case. Only the first character of the entire string is uppercased. To capitalize the first letter of every word, use titleize.
titleize
Capitalizes the first letter of every word and lowercases all other characters. Use this filter to format full names, product titles, or any multi-word attribute stored in a non-standard case.
```plaintext
{{ "alice smith" | titleize }} → Alice Smith
{{ "ALICE SMITH" | titleize }} → Alice Smith
{{ "aLiCe SmItH" | titleize }} → Alice Smith
```
titleize is Unicode-aware and correctly handles accented and multi-byte characters such as **ğ**, **ş**, **é**, and **ü**. Word boundaries are defined by spaces; hyphens and underscores are not treated as word separators. An empty string input returns an empty string with no error.
titleize does not apply smart title case rules. Words like "and", "of", and "the" are capitalized like any other word.
| Filter | "ALICE SMITH" | When |
| --- | --- | --- |
| capitalize | ALICE SMITH | Only the very first character should change |
| capitalize: "downcase_rest" | Alice smith | Sentence case (Shopify-compatible) |
| titleize | Alice Smith | Every word capitalized |
append / prepend
Add text to the end or beginning of a string.
```plaintext
{{ "photo" | append: ".jpg" }} → photo.jpg
{{ name | append: " Bey" }} → Alice Bey
{{ "World" | prepend: "Hello " }} → Hello World
{{ city | prepend: "City: " }} → City: Istanbul
```
strip / lstrip / rstrip
Remove whitespace from both sides, from the left only, or from the right only.
```plaintext
{{ " hello " | strip }} → hello
{{ " hello " | lstrip }} → hello
{{ " hello " | rstrip }} → hello
```
replace / replace_first: Replaces all occurrences, or only the first occurrence, of a substring with another string.
```plaintext
{{ "aaa" | replace: "a", "b" }} → bbb
{{ email | replace: "@", " [at] " }} → user [at] example.com
{{ "aaa" | replace_first: "a", "b" }} → baa
```
remove / remove_first: Removes all occurrences, or only the first occurrence, of a substring.
```plaintext
{{ "hello world" | remove: "o" }} → hell wrld
{{ "hello world" | remove_first: "o" }} → hell world
```
truncate: Shortens to a maximum total length. The ellipsis is included in that count.
```plaintext
{{ "This is a long sentence" | truncate: 10 }} → This is...
{{ "This is a long sentence" | truncate: 15 }} → This is a lo...
{{ "This is a long sentence" | truncate: 5 }} → Th...
{{ "This is a long sentence" | truncate: 10, "" }} → This is a
```
The default ellipsis is ... (3 characters). truncate: 10 = up to 7 content characters + ... = 10 total.
words option
Pass "words" as an argument to back up to the last whole word instead of cutting mid-word.
```plaintext
{{ "This is a long sentence" | truncate: 15, "words" }} → This is a...
```
leeway option
Pass "leeway" as an argument to leave the text unchanged when it overshoots the limit by 5 characters or fewer. Use "leeway=N" to set a different allowance.
```plaintext
{{ "abcdefghijklmno" | truncate: 10 }} → abcdefg...
{{ "abcdefghijklmno" | truncate: 10, "leeway" }} → abcdefghijklmno
{{ "abcdefghijklmno" | truncate: 10, "leeway=3" }}
```
These options occupy the same slot as the existing custom-ellipsis argument, and the filter tells them apart by name. truncate: 10, "" still sets an empty ellipsis, while truncate: 10, "words" selects the mode. To use a custom ellipsis and a mode together, pass the ellipsis first.
truncatewords: Shortens to a maximum number of words.
```plaintext
{{ "One two three four five" | truncatewords: 3 }} → One two three...
{{ "One two three four five" | truncatewords: 3, "" }} → One two three
```
split: Splits a string into a list using a separator.
```plaintext
{{ "a,b,c" | split: "," | first }} → a
{{ "a,b,c" | split: "," | last }} → c
{{ "a,b,c" | split: "," | join: " - " }} → a - b - c
{{ "a,b,c" | split: "," | size }} → 3
```
slice: Extracts a substring by position. Negative index counts from the end.
```plaintext
{{ "hello" | slice: 0, 3 }} → hel
{{ "hello" | slice: -3, 3 }} → llo
```
slice works on strings only. It cannot be used to extract sub-arrays from a list.
size: Number of characters in a string, or number of items in a list.
```plaintext
{{ "hello" | size }} → 5
{{ items | size }} → number of items in the list
```
escape / escape_once: Converts HTML special characters to entities.
```plaintext
{{ "bold" | escape }} → <b>bold</b>
{{ "<b>" | escape_once }} → <b> (not double-escaped)
```
url_encode / url_decode: URL-encodes or decodes a string.
```plaintext
{{ "hello world" | url_encode }} → hello+world
{{ "hello+world" | url_decode }} → hello world
```
strip_html: Removes all HTML tags.
```plaintext
{{ "Bold and italic" | strip_html }} → Bold and italic
```
strip_newlines / newline_to_br: Removes line breaks from a string, or replaces them with
tags.
```plaintext
{{ multiline_text | strip_newlines }} → line1line2
{{ multiline_text | newline_to_br }} → line1
line2
```
newline_to_br produces
(**XHTML** style), not
.
slugify: Lowercases the text and joins the words with hyphens. Only ASCII letters and digits are kept, so "Größe Änderung" becomes "gre-nderung".
```plaintext
{{ "Big Sale Today" | slugify }} → big-sale-today
```
last_words: Returns the last words of the text. Words are split on a single space, and a count of 0 returns the whole text.
```plaintext
{{ "one two three four" | last_words: 2 }} → three four
```
format: Fills the placeholders in a format string with the values you pass.
```plaintext
{{ "%s has %d items" | format: "Cart", 3 }} → Cart has 3 items
```
regex_search: Returns the first match of a regular expression, or a capture group when you pass its number.
```plaintext
{{ "order-12345" | regex_search: "order-([0-9]+)", 1 }} → 12345
```
Patterns that use lookahead (?=...) or backreferences are not supported and return an error, so the template is flagged instead of rendering the wrong text. Rewrite those patterns by hand.
list: Splits text into its individual characters. A list passes through unchanged.
```plaintext
{{ "abc" | list | join: "," }} → a,b,c
```
parse_json: Reads a JSON string into values you can reference. Text that is not valid JSON returns an empty result.
```plaintext
{{ payload | parse_json | map: "city" }}
```
## Number filters
Below are the supported number filters.
| Filter | Description |
| --- | --- |
| plus / minus / times / divided_by | Adds, subtracts, multiplies, or divides a number. divided_by performs integer division unless the divisor has a decimal or the "float" option is passed. |
| modulo | Divides a number and returns the remainder. |
| abs | Returns the absolute value of a number. |
| ceil / floor / round | Rounds a number up, down, or to the nearest value (optionally to a set number of decimals). |
| at_least / at_most | Clamps a value to a minimum or maximum. |
| number_format | Formats a number with custom thousand and decimal separators. Insider-specific. |
| money_format | Formats a number as currency with an optional symbol and separator style. Insider-specific. |
| format_price | Formats a number as money, with control over the currency symbol, digit grouping, decimals, and symbol position. |
plus / minus / times / divided_by: Adds, subtracts, multiplies, or divides a number. divided_by performs integer division unless the divisor has a decimal or the "float" option is passed.
```plaintext
{{ 10 | plus: 5 }} → 15
{{ 10 | minus: 3 }} → 7
{{ 5 | times: 3 }} → 15
{{ 10 | divided_by: 3.0 }} → 3.333...
{{ 10 | divided_by: 3 }} → 3 ← integer division
{{ 100 | times: 1.18 }} → 118
```
When the **divisor** is a whole number, divided_by performs integer division and drops the decimal. Use a decimal divisor (3.0) to get a decimal result. The input type does not matter. Only the divisor controls whether the result is **integer** or a **decimal**.
float option
Pass "float" as an argument to divided_by to keep the decimal part even when the divisor is a whole number.
```plaintext
{{ 5.0 | divided_by: 2 }} → 2
{{ 5.0 | divided_by: 2, "float" }} → 2.5
```
modulo: Divides a number and returns the remainder.
```plaintext
{{ 10 | modulo: 3 }} → 1
```
abs: Returns the absolute value of a number.
```plaintext
{{ -50 | abs }} → 50
```
ceil / floor / round: Rounds a number up, down, or to the nearest value (optionally to a set number of decimals).
```plaintext
{{ 4.1 | ceil }} → 5
{{ 4.9 | floor }} → 4
{{ 4.56 | round }} → 5
{{ 4.56 | round: 1 }} → 4.6
{{ 4.56 | round: 2 }} → 4.56
```
at_least / at_most: Clamps a value to a minimum or maximum.
```plaintext
{{ 3 | at_least: 5 }} → 5 (below minimum, returns minimum)
{{ 8 | at_least: 5 }} → 8 (above minimum, returns itself)
{{ 10 | at_most: 5 }} → 5 (above maximum, returns maximum)
{{ 3 | at_most: 5 }} → 3 (below maximum, returns itself)
```
Combine to clamp a value within a range.
```plaintext
{{ score | at_least: 0 | at_most: 100 }}
→ always returns a value between 0 and 100
```
number_format: Formats a number with custom thousand and decimal separators. This is an Insider-specific filter.
```plaintext
{{ price | number_format: "dot, comma" }} → 1.234,56 (Turkish/German)
{{ price | number_format: "comma, dot" }} → 1,234.56 (US/UK)
{{ price | number_format: "space, comma" }} → 1 234,56 (French/Norwegian)
{{ price | number_format: "apostrophe, dot" }} → 1'234.56 (Swiss)
{{ count | number_format: "comma" }} → 1,234 (no decimals)
```
money_format: Formats a numeric value as currency with an optional currency symbol and separator style. This is an Insider-specific filter.
Use this filter to render raw numeric profile attributes such as wallet balances, credit amounts, or order totals as formatted money strings in email templates. The first optional argument sets the currency symbol, and the second optional argument sets the separator style. When no arguments are passed, the output uses the default currency style.
You can position this similarly to Shopify’s money filter concept, but Insider’s money_format is custom and more explicit because it supports a custom symbol, separator style, and symbol position.
```plaintext
//Assuming data = 5000000 (integer)
{{ data | money_format }} → $5,000,000.00 (default)
{{ data | money_format: "$" }} → $5,000,000.00
{{ data | money_format: "€", "dot, comma" }} → €5.000.000,00
{{ data | money_format: "£", "comma, dot" }} → £5,000,000.00
```
> [!WARNING]
> money_format rounds to **2 decimal places**, it does not truncate. Values like 11.999 become $12.00, and 0.001 becomes $0.00. If you need truncation instead of rounding, use **floor** before the filter.
```plaintext
{% assign truncated = price | times: 100 | floor | divided_by: 100.0 %}
{{ truncated | money_format: "$" }}
```
**Example: Round up**
```plaintext
{{ 11.999 | money_format: "$" }} → $12.00
{{ 99.999 | money_format: "€" }} → €100.00
```
The input is 11.999, but the output is $12.00 because money_format rounds to 2 decimal places, it does not truncate.
**Example: Round down**
```plaintext
{{ 0.001 | money_format: "$" }} → $0.00
{{ 0.004 | money_format: "€" }} → €0.00
```
Small fractions below 0.005 round down to .00 and effectively disappear.
### Separator keywords
| Keyword | Character |
| --- | --- |
| comma | , |
| dot | . |
| space | |
| apostrophe | ‘ |
**Two separators** **(thousands, decimal):** The output always shows exactly 2 decimal places.
```plaintext
{{ 1234 | number_format: "dot, comma" }} → 1.234,00
{{ 1234.5 | number_format: "dot, comma" }} → 1.234,50
{{ 1234.567 | number_format: "dot, comma" }} → 1.234,57 (rounded)
```
**One separator (thousands only):** Decimal handling depends on the input value.
If the input is an **integer** (no fractional part), **no decimals** are shown.
```plaintext
{{ 1234 | number_format: "comma" }} → 1,234
```
If the input already has a fractional part, 2 decimal places are shown using the default decimal separator (.).
```plaintext
{{ 1234.5 | number_format: "comma" }} → 1,234.50
```
If the value is not a number, number_format returns an empty string silently.
format_price
Formats a number as money, with control over the currency symbol, digit grouping, decimals and symbol position. Pass the symbol as the first argument, then any of the options below. With no arguments, it uses **$**, a **comma** for thousands, a **dot** for decimals and two decimal places.
```plaintext
{{ 1234.56 | format_price }} → $1,234.56
{{ 1234.56 | format_price: "€" }} → €1,234.56
```
after: Places the symbol after the amount instead of before it. Include a leading space in the symbol if you want one.
```plaintext
{{ 1234.56 | format_price: "€", "after" }} → 1,234.56€
```
thousands=X and decimals=X: Set the thousands and decimal separators.
```plaintext
{{ 1234.56 | format_price: "€", "thousands=.", "decimals=," }} → €1.234,56
```
hide_decimals: Drops the decimal part. The value is rounded, not truncated.
```plaintext
{{ 1234.56 | format_price: "$", "hide_decimals" }} → $1,235
```
rupees: Groups digits in the Indian style. This mode uses its own "Rs. " prefix and keeps the value's own decimals, so the symbol argument and the decimal options do not apply.
```plaintext
{{ 1234.56 | format_price: "$", "rupees" }} → Rs. 1,234.56
{{ 123456789 | format_price: "$", "rupees" }} → Rs. 12,34,56,789
```
## Array filters
Below are the supported array filters.
| Filter | Description |
| --- | --- |
| first / last | Returns the first or last element of a list. |
| join | Joins the elements of a list into a single string using a separator. |
| sum | Returns the sum of a numeric field across all items in a list. |
| sort / sort_natural | Sorts a list by an attribute, optionally case-insensitively; supports "numeric" and "case_insensitive" options. |
| reverse | Reverses the order of the items in a list. |
| uniq | Removes duplicate values from a list. |
| map | Pulls a single top-level field from a list of objects. |
| where | Filters a list, keeping only items where a top-level field matches a value. |
| compact | Removes nil values from a list. |
| concat | Merges two lists. |
| mode | Returns the value that appears most often in a field, with an optional rank argument. |
| any_match / all_match | Returns true when at least one item, or every item, matches the given condition. |
| reject / rejectattr | Keeps the items that do not match a value or condition. |
| groupby | Groups the items in a list by a field. |
| random / random_sort | Returns one random item from a list, or the list in shuffled order. |
first / last: Returns the first or last element of a list.
```plaintext
{{ items | first }}
{{ items | last }}
{{ "a,b,c" | split: "," | first }} → a
```
join: Joins the elements of a list into a single string using a separator.
```plaintext
{{ items | join: ", " }} → apple, banana, cherry
{{ items | join: " | " }} → apple | banana | cherry
```
sum: Returns the sum of a numeric field across all items in a list. Pass the field name as a string argument.
```plaintext
{{ products | sum: "price" }}
→ total of all product prices
{{ cart_items | sum: "quantity" }}
→ total number of items in the cart
```
If any item is missing the specified field or the field value is not a number, that item is **skipped**. sum does not throw an error on missing or non-numeric values.
sort / sort_natural: Sorts a list by an attribute, optionally case-insensitively; supports "numeric" and "case_insensitive" options.
```plaintext
{{ tags | sort }}
{{ products | sort: "price" }}
{{ names | sort_natural }} (case-insensitive)
```
numeric option
Sorts numbers stored as text by their value, so "9" comes before "10".
```plaintext
{{ items | sort | join: "," }} → 10,9
{{ items | sort: "numeric" | join: "," }} → 9,10
{{ products | sort: "price", "numeric" }}
```
case_insensitive option
Ignores letter case, so "A" and "a" sit together. Plain sort puts all capitals before lowercase letters; this option interleaves them and leaves equal keys in their original order.
```plaintext
{{ letters | sort | join: "," }} → A,B,a,b
{{ letters | sort: "case_insensitive" | join: "," }} → A,a,b,B
{{ products | sort: "name", "case_insensitive" }}
```
For a list of plain values, the option goes in the first slot. For a list of objects, the property name stays first, and the option follows it. A list of objects sorted by an option alone returns an error, since there is no value to compare.
reverse: Reverses the order of the items in a list.
```plaintext
{{ items | reverse }}
```
uniq: Removes duplicate values from a list.
```plaintext
{{ "a,b,a,c,b" | split: "," | uniq | join: "," }} → a,b,c
```
map: Pulls a single top-level field from a list of objects:
```plaintext
{{ products | map: "name" }} → ShirtPantsShoes
{{ orders | map: "total" }}
```
Only top-level fields are supported, e.g., "name", not "category.name".
where: Filters a list keeping only items where a top-level field matches a value.
```plaintext
{{ products | where: "active", true }}
{{ orders | where: "status", "shipped" }}
{{ products | where: "featured" }} (keeps items where featured is truthy)
```
Only top-level fields are supported, e.g., "status", not "order.status".
compact: Removes nil values from a list.
```plaintext
{{ items | compact }}
```
concat: Merges two lists.
```plaintext
{% assign all = list_a | concat: list_b %}
```
mode: Returns the value that appears most often in a field. When two values tie, the one that appears first in the list wins. An optional second argument picks a rank, so 1 returns the second most frequent value.
```plaintext
{{ products | mode: "brand" }} → TestBrand
{{ products | mode: "category", 1 }}
```
Items with a missing or empty field are counted as their own group, and that group can win. When it does, the filter returns an empty string.
any_match / all_match: Returns true when at least one item (any_match) or every item (all_match) matches the condition. On an empty list, all_match returns true.
```plaintext
{{ products | any_match: "name", "=", "Product 1" }} → true
{{ products | all_match: "brand", "=", "TestBrand" }} → true
```
Supported operators are =, ==, !=, <>, >, <, >=, <=, in, and not in. Pass "case_insensitive" as a final argument to ignore letter case. Any other operator returns an error rather than silently answering false, so a mistyped condition cannot quietly decide the email content.
reject / rejectattr: Keeps the items that do not match. reject is the opposite of where. rejectattr keeps the items whose field does not pass the test.
```plaintext
{{ products | reject: "name", "Product 0" }}
{{ products | rejectattr: "name", "equalto", "Product 0" }}
```
groupby: Groups the items by a field. Each group has a grouper and a list, and the groups are ordered by grouper.
```plaintext
{{ products | groupby: "brand" }}
```
random / random_sort: random returns one item from the list. random_sort returns the list in shuffled order.
```plaintext
{{ products | random: "seed-a" }}
{{ products | random_sort: "seed-a" }}
```
Without a seed, both filters return a different result on every render. Pass a seed when the preview and the delivered message should match, or when a resend should keep the same order.
## Date and time filters
Below are the supported date and time filters.
| Filter | Description |
| --- | --- |
| time_format | Formats a date using Moment.js-style tokens. Insider-specific. |
| add_time | Adds a specified amount of time to a date value. |
| date_is_between | Returns true if a date falls within a specified range (inclusive). |
| timezone | Converts a date to a different time zone before formatting. |
| date | Standard Liquid date filter using Ruby strftime format codes. |
| newer_than / older_than | Returns true when a date is more recent, or further back, than a given amount of time before now (or a given reference date). |
time_format: Formats a date using Moment.js-style tokens. This is an Insider-specific filter.
```plaintext
{{ birthday | time_format: "DD MMMM YYYY" }} → 15 March 1992
{{ c_membership_date | time_format: "DD/MM/YYYY" }} → 15/01/2022
{{ c_membership_date | time_format: "YYYY-MM-DD HH:mm:ss" }}
{{ c_membership_date | time_format: "dddd, DD MMMM YYYY" }} → Monday, 15 January 2024
```
add_time: Adds a specified amount of time to a date value. The first argument is the quantity (integer) and the second is the unit.
Supported units are "seconds", "minutes", "hours", "days", "weeks", "months", and "years".
```plaintext
{{ event_date | add_time: 3, "days" }}
→ event_date + 3 days
{{ membership_start | add_time: 1, "years" }}
→ membership_start + 1 year
{{ appointment | add_time: 30, "minutes" }}
→ appointment + 30 minutes
```
Use add_time with time_format to render the result:
```plaintext
{{ event_date | add_time: 7, "days" | time_format: "DD MMMM YYYY" }}
→ date 7 days after event_date, formatted
```
date_is_between: Returns *true* if a date falls within the specified range (inclusive). Pass the start and end dates as strings.
```plaintext
{% if birthday | date_is_between: "2000-01-01", "2009-12-31" %}
You are a 2000s kid.
{% endif %}
{% if c_membership_date | date_is_between: "2024-01-01", "2024-12-31" %}
Member joined in 2024.
{% endif %}
```
Both bounds are inclusive. The start and end arguments accept the same date formats supported by time_format: **RFC3339**, **ISO** datetime, date-only (YYYY-MM-DD), and **Unix** timestamps.
### Accepted input formats
| Format | Example |
| --- | --- |
| RFC3339 | 2024-01-15T10:30:00Z |
| RFC3339 with offset | 2024-01-15T10:30:00+03:00 |
| ISO datetime | 2024-01-15T10:30:00 |
| Datetime | 2024-01-15 10:30:00 |
| Date only | 2024-01-15 |
| Unix timestamp | 1705315800 |
time_format accepts the same date values as timezone. When the input is **empty** or **cannot be parsed**, the output renders **empty**, and the rest of the content is sent as usual.
Avoid passing dates already in a slash format, such as 10/08/2026, into time_format. A slash-separated date reads as MM/DD/YYYY, which turns 10 August into 8 October. Send the raw value in one of the accepted formats and let time_format produce the display format.
### Format token reference
| Token | Output | Example |
| --- | --- | --- |
| YYYY | 4-digit year | 2024 |
| YY | 2-digit year | 24 |
| MMMM | Full month name | January |
| MMM | Short month name | Jan |
| MM | Month, zero-padded | 01 |
| M | Month, no padding | 1 |
| DD | Day, zero-padded | 05 |
| D | Day, no padding | 5 |
| dddd | Full weekday name | Monday |
| ddd | Short weekday name | Mon |
| HH | Hour 24h, zero-padded | 14 |
| hh | Hour 12h, zero-padded | 02 |
| mm | Minutes, zero-padded | 05 |
| ss | Seconds, zero-padded | 30 |
| A | AM / PM | PM |
| X | Unix timestamp (seconds) | 1705315800 |
| Z | UTC offset | +03:00 |
Month and weekday names are always in English. If the input cannot be parsed, time_format returns an empty string silently, and no error is thrown. Formats using dots (15.01.2024) are **not** **recognized**.
timezone
Convert a date to a different time zone before formatting. Always apply time zone before time_format, so you format the already-converted time in the target time zone.
```plaintext
{{ birthday | timezone: "Europe/Istanbul" | time_format: "DD MMMM YYYY" }}
{{ c_membership_date | timezone: "America/New_York" | time_format: "hh:mm A" }}
{{ c_membership_date | timezone: "UTC" | time_format: "YYYY-MM-DD HH:mm:ss" }}
```
### Common IANA timezone names
| Name | Location |
| --- | --- |
| Europe/Istanbul | Turkey (UTC+3) |
| UTC | Universal Time |
| America/New_York | US East |
| America/Chicago | US Central |
| America/Los_Angeles | US West |
| America/Sao_Paulo | Brazil |
| Europe/London | UK |
| Europe/Berlin | Germany |
| Europe/Paris | France |
| Asia/Dubai | UAE |
| Asia/Tokyo | Japan |
| Asia/Singapore | Singapore |
| Asia/Kolkata | India |
| Australia/Sydney | Australia East |
- Use the full IANA name. "Istanbul", "TR", and "+03:00" are **not** **valid** and will cause an error.
- Unlike time_format, an invalid time zone name breaks the template. It does not silently return empty.
- Using time zone without chaining time_format produces a raw internal time representation, but not a human-readable one.
### Accepted date values
The value passed into timezone must be a **parseable** **date**. The following formats are accepted:
- ISO 8601/RFC 3339 with an offset: 2026-08-10T00:00:00-03:00
- ISO 8601/RFC 3339 in UTC: 2026-08-10T03:00:00Z
- Date and time: 2026-08-10 00:00:00
- Date only: 2026-08-10
- Unix timestamp
### Accepted timezone values
- IANA timezone names, e.g., America/Sao_Paulo
- UTC or GMT
- Offsets, e.g., UTC-3 or GMT-03:00
**If the value cannot be parsed**
Unlike most filters, timezone does not fall back to an empty output. When its input is empty or in a format outside the list above, rendering fails for that user, and the message is **not sent**. Keep the value populated and in an accepted format, or use time_format on its own when you do not need a time zone conversion.
```plaintext
{{ data_vencimento | timezone: "America/Sao_Paulo" | time_format: "DD/MM/YYYY" }}
```
date
Standard liquid date filter using Ruby strftime format codes.
```plaintext
{{ birthday | date: "%Y-%m-%d" }} → 1992-03-15
{{ birthday | date: "%d/%m/%Y" }} → 15/03/1992
{{ birthday | date: "%B %d, %Y" }} → March 15, 1992
{{ "now" | date: "%Y-%m-%d" }} → today's date
```
Prefer time_format over date. It accepts more input formats and uses the more familiar Moment.js token style.
newer_than / older_than
Returns true when the date is more recent (newer_than) or further back (older_than) than the given amount of time before now.
```plaintext
{{ signup_date | newer_than: 10, "days" }} → true
{{ signup_date | older_than: 10, "days" }} → true
```
Supported units are "seconds", "minutes", "hours", "days", "weeks", "months", and "years". Any other unit returns an error. An optional third argument compares against a fixed date instead of now. Month steps stop at the end of the month, so one month before 31 March is 28 February.
```plaintext
{{ "2020-01-01" | older_than: 10, "days", "2020-06-01" }} → true
{{ "2020-05-30" | newer_than: 10, "days", "2020-06-01" }} → true
```
## Hashing and encoding filters
These filters are Insider-specific and are intended for use cases such as analytics integrations, audience matching, and data obfuscation. They operate on string inputs only.
| Filter | Description |
| --- | --- |
| sha256_hash | Returns the SHA-256 hex digest of a string. |
| md5_hash | Returns the MD5 hex digest of a string. |
| b64encode | Encodes a string as Base64. |
| truthy | Returns false for 0, an empty string, an empty list, and an empty object, and true for everything else. |
sha256_hash: Returns the SHA-256 hex digest of a string.
```plaintext
{{ email | sha256_hash }}
→ 64-character lowercase hex string
{{ user_id | sha256_hash }}
→ SHA-256 digest of the user ID
```
md5_hash: Returns the MD5 hex digest of a string.
```plaintext
{{ email | md5_hash }}
→ 32-character lowercase hex string
```
**MD5** is provided for compatibility with third-party systems that require it (e.g., audience matching APIs). Do not use MD5 for security-sensitive purposes.
b64encode: Encodes a string as Base64.
```plaintext
{{ email | b64encode }}
→ Base64-encoded string
{{ user_id | b64encode }}
→ Base64 representation of the user ID
```
Common use case: Hashed email for ad audience matching:
```plaintext
{{ email | downcase | sha256_hash }}
→ lowercase + SHA-256 hash, as required by Meta and Google audience upload formats
```
truthy: Returns false for 0, an empty string, an empty list, and an empty object, and true for everything else.
```plaintext
{{ 0 | truthy }} → false
{{ "x" | truthy }} → true
```
In Liquid, only nil and false count as false in a condition, so 0, an empty string, an empty list, and an empty object all count as true. Templates brought over from a Python-based system, where these values count as false, take the opposite branch without any error. For example, on an empty list this renders "0 items":
```plaintext
{% if products %}{{ products | size }} items{% else %}nothing{% endif %}
```
Filters **cannot be used** inside a condition, so assign the truthy result first. On an empty list, this renders "nothing":
```plaintext
{% assign has_products = products | truthy %}
{% if has_products %}{{ products | size }} items{% else %}nothing{% endif %}
```
The empty and blank keywords do not replace truthy. In Insider One's Liquid, they equal nil only.
## Tips
- Filters cannot be applied directly within conditional tags. To evaluate a filtered value in a condition, first assign the result to an intermediate variable using {% assign %}, then reference that variable in the {% if %} statement.
- When multiple filters are chained, they are evaluated left to right. Each filter receives the output of the preceding one as its input.
```plaintext
{{ name | strip | upcase | default: "GUEST" }}
```
Filters that operate on field names, including map, where, and sort, are restricted to top-level fields only (e.g., "name"). Nested dot notation, such as "category.name", is not supported and will produce empty results.
These filters run on the shared Liquid engine, so they are available in [Architect Liquid](/v1/docs/liquid-in-architect) elements as well as in Email.
## Related
- [Liquid Tags](/liquid-tags.md)