← Back to guides
Cheat sheetLiquid BasicsLiquid · Published 2026-11-20 · 4 min read

Shopify Liquid Filters Cheat Sheet: 30 Filters With Copy-Paste Examples

The Shopify Liquid filters you use most, grouped by purpose: text, numbers, money, arrays, images and URLs, each with a short example.

Share with Shopify developers — useful guides spread faster in theme dev communities.

What filters do

A filter changes an output value. Chain them with a pipe: {{ product.title | upcase | truncate: 30 }}. Filters run left to right. Keep the Liquid cheat sheet open for tags and objects.

Text filters

{{ 'hello world' | capitalize }}        Hello world
{{ 'Hello' | upcase }}                  HELLO
{{ 'Hello' | downcase }}                hello
{{ product.description | strip_html | truncate: 120 }}
{{ product.description | strip_html | truncatewords: 20 }}
{{ 'a-b-c' | replace: '-', ' ' }}       a b c
{{ 'Sale!' | remove: '!' }}             Sale
{{ 'shop' | append: '.com' }}           shop.com
{{ 'now' | prepend: 'Buy ' }}           Buy now
{{ 'Hello World' | handleize }}         hello-world
{{ user_input | escape }}               escapes HTML, use on plain text

Number filters

{{ 4 | plus: 2 }}            6
{{ 10 | minus: 3 }}          7
{{ 3 | times: 4 }}           12
{{ 10 | divided_by: 4.0 }}   2.5
{{ 2.567 | round: 1 }}       2.6
{{ -5 | abs }}               5
{{ cart.item_count | pluralize: 'item', 'items' }}

Money and date

{{ product.price | money }}                  $19.00
{{ product.price | money_with_currency }}    $19.00 USD
{{ product.price | money_without_trailing_zeros }}
{{ article.published_at | date: '%B %d, %Y' }}   March 04, 2026
{{ 'now' | date: '%Y' }}                         current year

Prices are stored in the smallest currency unit (cents), so always output them with a money filter.

Fallbacks

{{ section.settings.title | default: 'Welcome' }}
{{ product.metafields.custom.size | default: 'One size' }}

Array filters

{{ product.tags | join: ', ' }}
{{ 'a,b,c' | split: ',' | first }}
{{ collection.products | map: 'title' | join: ' | ' }}
{% assign sale = collection.products | where: 'available', true %}
{{ product.images | size }}
{{ product.tags | sort | uniq | join: ', ' }}

Image and URL filters

{{ product.featured_image | image_url: width: 600 | image_tag: loading: 'lazy', alt: product.title }}
{{ 'theme.css' | asset_url | stylesheet_tag }}
{{ 'app.js' | asset_url | script_tag }}
{{ product.url | within: collection }}
{{ 'hello world' | url_encode }}
{{ product | json }}

Translation

{{ 'general.search.title' | t }}

Takeaway

Memorize money, default, escape, image_url, truncate and where. For objects see Shopify Liquid Objects Cheat Sheet. New to Liquid? Start at Shopify Liquid for beginners.

Try it with our free tools

Paste your HTML into the HTML to Liquid converter to generate a section with schema, or pick a layout from Ready Sections. Questions? Use the contact form.

Filters you will use every week

{{ product.price | money }}                      // $19.99
{{ product.title | truncate: 40 }}               // shortens long titles
{{ product.title | upcase }}                     // PRODUCT TITLE
{{ article.published_at | date: "%b %d, %Y" }}   // Nov 21, 2026
{{ "a,b,c" | split: "," | join: " / " }}        // a / b / c
{{ section.settings.heading | default: "Welcome" }}
{{ product.featured_image | image_url: width: 600 }}

Working with lists

{% assign sorted = collection.products | sort: "price" %}
{% assign in_stock = collection.products | where: "available", true %}
{{ in_stock.size }} items in stock

Filters can be chained left to right, and each one receives the result of the previous. When something looks wrong, remove filters one at a time from the right to find which one changes the value.

Tips

  • Prefer image_url with an explicit width so Shopify serves a correctly sized image.
  • Use escape when printing text from merchants into an HTML attribute.
  • Keep a section's formatting inside the section so it is easy to change in one place.

Topic cluster

Liquid Basics

Objects, tags, filters, loops, and beginner Liquid workflows.

Convert your HTML to Shopify Liquid

Paste a module, generate Liquid + schema, then copy the result into your theme. Free to try—no signup required for a sample conversion.

Share

Share this guide

Found this guide useful? Share it with other Shopify developers on LinkedIn, X, or Reddit.