Write Liquid
Back to all builders

Liquid Reference

Every subscriber variable, filter, and control flow tag available in Kit emails. Search, filter, and copy what you need.

First Name

{{ subscriber.first_name }}

The subscriber's first name. May be blank if not provided. Use with the default filter for a fallback.

Email Address

{{ subscriber.email_address }}

The subscriber's email address. Always available for active subscribers.

Tags

subscriber.tags contains "Tag Name"

Used inside conditionals to check if a subscriber has a specific tag. Tag names are case-sensitive and must match exactly.

Created At

{{ subscriber.created_at | date: "%B %d, %Y" }}

The date the subscriber was added to your account. Combine with the date filter to format it.

Custom Field

{{ subscriber.custom_field_name }}

Any custom field you've created in Kit. The field name is auto-converted to lowercase with underscores (e.g., "Last Name" becomes "last_name").

default

{{ subscriber.first_name | default: "friend" }}

Provides a fallback value when the variable is blank or empty. Essential for first name personalization.

capitalize

{{ subscriber.first_name | capitalize }}

Capitalizes the first letter of the string. Useful when subscribers may have entered their name in all lowercase.

downcase

{{ subscriber.first_name | downcase }}

Converts the entire string to lowercase.

upcase

{{ subscriber.first_name | upcase }}

Converts the entire string to UPPERCASE.

url_encode

{{ subscriber.email_address | url_encode }}

Encodes special characters for safe use in URLs. Converts @ to %40, spaces to +, etc. Great for pre-filling forms.

replace

{{ "Hello World" | replace: "World", "there" }}

Replaces all occurrences of the first string with the second string.

remove

{{ "Hello World" | remove: "World" }}

Removes all occurrences of the specified string.

truncate

{{ "Long text here" | truncate: 10 }}

Truncates the string to the specified number of characters and appends "..." by default.

strip

{{ "  hello  " | strip }}

Removes all leading and trailing whitespace from a string.

split

{{ "a,b,c" | split: "," }}

Splits a string into an array based on a delimiter. Often used with join or iteration.

join

{{ array | join: ", " }}

Joins an array of strings with the specified separator.

size

{{ "hello" | size }}

Returns the number of characters in a string, or the number of items in an array.

slice

{{ "hello" | slice: 0, 3 }}

Returns a substring starting at the first index for the specified length. Returns "hel" in this example.

date

{{ "now" | date: "%A, %B %d, %Y" }}

Formats a date using strftime codes. Use "now" for the current date/time. Common codes: %A (day name), %B (month name), %d (day), %Y (year), %m (month number).

days_until

{{ "2026-12-25" | days_until }}

Kit-specific filter. Returns the number of days between now and the specified date. Great for countdowns.

advance_date_to_next

{{ "now" | advance_date_to_next: "monday" | date: "%A, %B %d" }}

Kit-specific filter. Advances the date to the next occurrence of the specified weekday. Chain with the date filter to format the result.

Format: Day Name (%A)

{{ "now" | date: "%A" }}

Full day name, e.g., "Tuesday". Useful for day-specific greetings.

Format: Month Name (%B)

{{ "now" | date: "%B" }}

Full month name, e.g., "January". Great for monthly newsletters.

Format: Year (%Y)

{{ "now" | date: "%Y" }}

Four-digit year, e.g., "2026". Perfect for copyright notices in footers.

Format: Unix Timestamp (%s)

{{ "now" | date: "%s" }}

Seconds since epoch. Used for date math — add seconds with the plus filter, then format back to a readable date.

plus

{{ 5 | plus: 3 }}

Adds a number to the input. Often used with dates: convert to Unix timestamp, add seconds, then format back.

minus

{{ 10 | minus: 3 }}

Subtracts a number from the input.

times

{{ 5 | times: 3 }}

Multiplies the input by the specified number.

divided_by

{{ 10 | divided_by: 2 }}

Divides the input by the specified number. Integer division by default.

modulo

{{ 10 | modulo: 3 }}

Returns the remainder of dividing the input by the specified number.

abs

{{ -5 | abs }}

Returns the absolute value of the input.

ceil

{{ 4.2 | ceil }}

Rounds the input up to the nearest integer.

floor

{{ 4.8 | floor }}

Rounds the input down to the nearest integer.

round

{{ 4.5 | round }}

Rounds the input to the nearest integer.

if / else / endif

{% if subscriber.tags contains "Tag" %}
Content for tagged
{% else %}
Content for untagged
{% endif %}

The most common conditional. Shows different content based on whether a condition is true or false.

elsif

{% if subscriber.tags contains "A" %}
Content A
{% elsif subscriber.tags contains "B" %}
Content B
{% else %}
Fallback
{% endif %}

Add multiple conditions to an if statement. Checked in order — first match wins.

unless / endunless

{% unless subscriber.tags contains "Tag" %}
Show to everyone EXCEPT tagged
{% endunless %}

The inverse of if. Runs the block when the condition is false. Cleaner than if/else when you only need the "else" content.

assign

{% assign greeting = "Hello" %}

Creates a variable you can reference later in the email. Useful for reusing values or storing intermediate results.

capture

{% capture full_name %}{{ subscriber.first_name }} {{ subscriber.last_name }}{% endcapture %}

Captures rendered content into a variable. Unlike assign, it can include dynamic Liquid output.

contains

subscriber.tags contains "Tag Name"

Checks if an array (like tags) includes a specific value. Case-sensitive. Used inside if/unless statements.

Comparison: == and !=

{% if subscriber.plan == "pro" %}

Equals (==) and not-equals (!=) operators. Compare custom field values against specific strings or numbers.

Logic: and / or

{% if subscriber.tags contains "A" and subscriber.tags contains "B" %}

Combine multiple conditions. With "and", all must be true. With "or", any one is enough. Liquid evaluates left-to-right (no parentheses).

blank

{% if subscriber.field_name == blank %}

Tests if a value is empty or undefined. Use "!= blank" to check that a field has been filled in. Note: blank is an unquoted keyword.