ZPL Explained: A Practical Guide to Zebra's Label Language

What ZPL is, how a Zebra label command actually works, and how to write, preview and print your first ZPL label — with a worked example.

ZPL By ThermalDraw · · 3 min read · Updated

ZPL (Zebra Programming Language) is the text-based command language that Zebra thermal printers read to lay out and print a label. Instead of sending a picture, you send a short script of commands — where to put text, how to draw a barcode, what data to encode — and the printer rasterises it. Once you can read a few commands, ZPL stops looking cryptic.

Anatomy of a ZPL label

Every label is wrapped between two commands and made of “field” blocks:

^XA
^FO50,50^A0N,40,40^FDHello world^FS
^FO50,110^BCN,80,Y,N,N^FD12345678^FS
^XZ

That’s the whole mental model: ^XA … a series of ^FO (position) + a field type (^A0 text, ^BC barcode, ^GB box, ^GF graphic) + ^FD data ^FS … ^XZ.

Dots, DPI and why size “changes”

ZPL measures everything in dots, and a dot’s physical size depends on the printer’s resolution:

ResolutionDots per mm1 mm =
203 dpi88 dots
300 dpi~1212 dots
600 dpi~2424 dots

So ^FO400,0 is 50 mm from the left on a 203 dpi printer, but ~33 mm on a 300 dpi one. If you design in millimetres and convert to dots using the target DPI, the same label prints at the correct physical size everywhere.

Common commands you’ll actually use

A worked example: a small product label

^XA
^PW400
^LL240
^FO20,20^A0N,30,30^FDAcme Coffee 250g^FS
^FO20,70^A0N,50,50^FD$12.90^FS
^FO20,140^BY2^BCN,70,Y,N,N^FD7891234567895^FS
^XZ

This prints a 50 × 30 mm label (at 203 dpi) with a product name, a price, and an EAN/Code 128 barcode with its human-readable digits.

How to preview ZPL without wasting labels

You don’t need to burn paper to check a layout. Labelary renders ZPL to an image via a web viewer and a REST API — paste your ZPL, pick the DPI and label size, and see exactly what will print. (ThermalDraw uses Labelary under the hood so its on-screen preview matches the printed result.)

Getting ZPL to the printer

ZPL vs the other label languages

Do you even need to write ZPL?

For one-off tweaks, hand-writing ZPL is fine. For real work — dynamic data, many SKUs, multiple printers — design the label visually and let a tool emit the ZPL. That’s exactly what ThermalDraw does: drag elements onto a to-scale canvas, bind {{variables}}, and export ZPL (or DPL, or ESC/POS) that’s byte-for-byte what the printer needs.

Try the free editor →

Frequently asked questions

What does ZPL stand for?

ZPL stands for Zebra Programming Language — the command language Zebra thermal printers use to describe and print labels.

Is ZPL the same as EPL?

No. EPL (Eltron Programming Language) is an older, simpler Zebra language. ZPL (specifically ZPL II) is the modern standard with more features. Most current Zebra printers default to ZPL.

How do I preview ZPL without a printer?

Use a ZPL renderer such as the Labelary online viewer or API, which turns ZPL into a PNG/PDF image of the label so you can check the layout before printing.

What units does ZPL use?

ZPL positions everything in dots, not millimetres. The dot size depends on the printer's resolution (203 dpi ≈ 8 dots/mm, 300 dpi ≈ 12 dots/mm), so the same ZPL prints at different physical sizes on different printers unless you account for DPI.

Design your label — free

Drag-and-drop in the browser, preview it, export ZPL / DPL / ESC/POS. Pay only to print at scale.

Open the editor →