Definition
Liquid is the open-source template language Shopify created to build its online store themes. Liquid code runs on Shopify's servers and combines a theme's HTML with store data, such as products, prices and the cart, using three building blocks: objects that output data, tags that add logic, and filters that format values.
How Liquid works
Liquid is a template language created by Shopify and published as an open-source project on GitHub[1]. A Shopify theme is a set of Liquid files plus CSS and JavaScript. When someone opens a product page, Shopify's storefront renderer, a server-side renderer that handles storefront requests, runs the Liquid code, fills in the store's data and sends finished HTML to the browser[2]. The shopper never sees Liquid, only the HTML it produced.
Liquid was built to be safe for people who edit templates but should not be able to run arbitrary code on the server. The project README says the language had to be "non evaling and secure"[3]. That is why Liquid has no file access, no database queries and no network calls. It can only read the objects Shopify gives it and transform them.
Inside a theme, Liquid lives in a few places. Layouts such as theme.liquid hold the markup that repeats on every page, and a theme can't be uploaded without that file. Sections are reusable modules of content, and snippets are small pieces of Liquid rendered wherever they are needed[4]. Most templates in a modern theme are JSON files that only list which sections to show. JSON templates act as a wrapper for sections, while the Liquid code sits in the sections themselves[4]. A JSON template can render up to 25 sections, each with up to 50 blocks, and merchants can add, remove and reorder them in the theme editor[5].
The three building blocks: objects, tags and filters
Everything in Liquid is one of three things[1]:
| Building block | Syntax | What it does | Example |
|---|---|---|---|
| Objects | {{ }} | Output a value from the store's data | {{ product.title }} |
| Tags | {% %} | Logic: conditions, loops, variables. Tags print nothing themselves | {% if product.available %} |
| Filters | | | Change the output of an object or variable | {{ product.price | money }} |
A short product snippet uses all three:
<h1>{{ product.title }}</h1>
<p>{{ product.price | money }}</p>
{% if product.available %}
<button type="submit">Add to cart</button>
{% else %}
<p>Sold out</p>
{% endif %}
A few rules catch developers coming from JavaScript or PHP. Adding a hyphen to a tag, as in {%- or -%}, strips the whitespace the tag would otherwise leave in the HTML. Operators in a condition are evaluated from right to left and parentheses are not allowed. Only nil and false are falsy, so an empty string counts as true and has to be checked with blank[6].
Shopify's Liquid is an extended version of the open-source language, with store objects such as product, cart and collection and filters such as money. Notification emails, Shopify Flow and order printer templates use their own Liquid variants, which the theme reference does not cover[1].
Example: a free delivery bar in dinars
Take a hypothetical Serbian store that offers free delivery on orders over 6,000 dinars and wants a message in the cart telling shoppers how far they are from it. Liquid's cart.total_price returns the cart total after discounts in the currency's subunit, so 6,000 dinars is 600,000 in Liquid, and the money filter formats the result[7].
{%- assign threshold = 600000 -%}
{%- assign remaining = threshold | minus: cart.total_price -%}
{% if remaining > 0 %}
<p>Spend {{ remaining | money }} more for free delivery.</p>
{% else %}
<p>Your order ships free.</p>
{% endif %}
A shopper with a 4,200-dinar cart has cart.total_price of 420,000. The remaining amount is 180,000, which the money filter prints as 1,800 dinars in the store's money format. Add a 2,000-dinar item and the total becomes 620,000, the remainder is negative and the message switches to "Your order ships free". All of this happens on the server, so the message is in the HTML on first load, with no script and no layout shift. If the store sells in several currencies, the threshold has to be converted too, because the cart total comes in the shopper's currency[7].
In a real theme the threshold would not be hard-coded. It would be a section setting, so the store owner can change it in the theme editor without a developer.
Liquid vs Hydrogen (React)
| Liquid theme | Hydrogen storefront | |
|---|---|---|
| Language | Liquid templates, HTML, CSS, JavaScript | React and TypeScript |
| Where it runs | Shopify's servers | Your app, hosted on Oxygen or elsewhere |
| Data | Liquid objects, no API calls | Storefront API queries |
| Editing by the merchant | Theme editor, sections and blocks | Depends on what the developers build |
| Typical use | Most Shopify stores | Headless builds with custom frontends |
If you are weighing the two, our guide to Shopify Hydrogen explains when the React route is worth it.
FAQ
Is Liquid a programming language?
Liquid is a template language, not a general programming language. It has variables, conditions and loops, but it cannot read files, call APIs or write to a database. It only reads the data Shopify provides and turns it into HTML[3].
Is Liquid hard to learn?
If you know HTML, the basics take a few days. Objects, tags and filters cover almost everything. The harder part is knowing Shopify's objects and theme architecture: sections, blocks, JSON templates and settings[4].
Does Liquid run in the browser?
No. Liquid runs on Shopify's servers before the page is sent, and the browser only receives the HTML[2]. Anything that must change after the page loads, such as a cart drawer updating without a reload, needs JavaScript.
Can Liquid be used outside Shopify?
Yes. The open-source version is MIT-licensed[3] and used by other software projects and companies[1]. Shopify-specific objects such as product and filters such as money exist only in Shopify's version.
Do I need to know Liquid to run a Shopify store?
No. Online Store 2.0 themes let you change content, sections and settings in the theme editor without code[5]. You need Liquid, or a developer who knows it, when you want something the theme's settings do not offer.
The bottom line
Liquid is the template layer of every standard Shopify theme: it takes store data and turns it into the HTML a shopper sees. Objects print data, tags add logic and filters format the output. It is deliberately limited, which keeps it safe and predictable. When a theme needs a custom feature, our Shopify theme development work usually starts in Liquid, and our custom theme development guide shows the whole process.
Article sources
We use primary sources only: official documentation, product pages and laws. Each link was checked on the date shown.
- Shopify. Liquid reference. Accessed 17th Nov 2026.
- Shopify. The Shopify platform (theme performance). Accessed 17th Nov 2026.
- Shopify. Shopify/liquid: Liquid markup language (GitHub repository). Accessed 17th Nov 2026.
- Shopify. Theme architecture. Accessed 17th Nov 2026.
- Shopify. JSON templates. Accessed 17th Nov 2026.
- Shopify. Liquid basics. Accessed 17th Nov 2026.
- Shopify. Liquid objects: cart. Accessed 17th Nov 2026.
- Shopify. Render essential content in Liquid and HTML, not JavaScript. Accessed 17th Nov 2026.
Need this on your store?
See the serviceThe checklist we run before touching a client's code
Get it by email, plus a few short notes over the next two weeks: what we see most often on Shopify stores and what actually fixes it.