Sign In
Products
ZPL ViewerBarcode GeneratorImage → ZPLZPL cheat sheetLabel DesignerTemplate Gallery
Developers
API QuickstartAPI ReferenceMCP ServerBulk GenerationWebhooksSDKs & ExamplesLimitsDirectPrint agent NewGitHub ActionVS Code extensionOn-Premise
Solutions
Logistics & ShippingE-CommerceERP & WMSManufacturingRetailHealthcare & LaboratoryAll solutions
Tools
ZPL Diagnostics HubZPL DebuggerSize & DPI AnalyzerDPI ConverterBarcode fit calculatorShipping Label AnalyzerFont InspectorOrientation DebuggerCalibration AssistantPrinter Compatibility CheckerBarcode Readability CheckerPrinter Language DetectorThermal Printer Test PackZPL ToolsEPL ToolsTSPL ToolsCPCL ToolsPrinter Language ConverterAll ToolsGuidesPricing
Language
EnglishTürkçeDeutsch
Home›Guides›What is ZPL?

What is ZPL?

Published: · Updated:

ZPL (Zebra Programming Language) is the standard way of telling a thermal label printer "print this, here". You do not send an image file; you send text, and the printer does the drawing.

The skeleton of a ZPL label

Every label starts with ^XA and ends with ^XZ. Everything in between belongs to that label. The smallest meaningful label looks like this:

^XA
^FO50,50^A0N,40,40^FDHello^FS
^XZ

Open this label in the ZPL viewer →

Reading it piece by piece:

Dots, dpmm and label size

Coordinates in ZPL are dots, and the physical size of a dot depends on the printer's density. The common values are 8 dpmm (203 dpi) and 12 dpmm (300 dpi). The same ZPL that looks right on an 8 dpmm printer comes out small on a 12 dpmm one, because the same number of dots covers fewer millimetres. This is the most common "it worked on my machine" problem in ZPL.

^PW sets the label width and ^LL its length. If you set neither, the printer falls back to its own defaults and your output varies from machine to machine.

The three most common mistakes

  1. A missing ^FS. The field never closes, so the following commands write into it — you get a label with "half of it gone".
  2. A field outside the label bounds. When an ^FO coordinate exceeds ^PW/^LL, the content is silently clipped: the printer reports no error, it simply does not print it.
  3. Wrong barcode parameters. Every symbology accepts a different character set and length; giving EAN-13 twelve digits, or Code 39 a lowercase letter, produces a barcode that will not scan.

The six commands you will use first — and where each is explained

You do not learn ZPL by reading the whole programming guide. Six commands cover the skeleton above; each has a reference page with syntax, an example and what our renderer does with it.

CommandWhat it doesReference
^XA … ^XZOpens and closes one label ^XA
^FOField origin in dots from the top-left corner ^FO
^AFont, orientation and size of the next field ^A
^FD / ^FSThe data of a field and its end ^FD, ^FS
^PW / ^LLLabel width and length in dots ^PW, ^LL
^BCThe Code 128 barcode most shipping and product labels use ^BC

From here the usual path is: keep the ZPL cheat sheet open while writing, look up anything else in the command reference, and when a file lands on your desk, read how to open a ZPL file and how to send ZPL to a network printer. The dot-versus-millimetre question above has its own walkthrough with measured numbers in dots, mm, inches and DPI migration. ZPL is Zebra's language; TSC printers speak TSPL and Zebra mobile printers CPCL — the ZPL hub lists the tools, the printers that run it and the comparisons with the other languages.

Seeing it before you print it

The hard part of ZPL is that seeing the result normally requires a physical printer and a roll of labels: one attempt equals one label. Labelixa's preview draws the ZPL at its real size in the browser and points out structural problems — overflowing fields, a missing ^FS — with the line number. No printer required.

Frequently asked questions

Is ZPL the same on every Zebra printer?

The language is shared, but the output depends on the printer's dot density: positions are given in dots, so the same ZPL prints at different physical sizes on a 203 dpi and a 300 dpi printer.

Do I need a printer to learn ZPL?

No. An online viewer or a rendering API draws the label from the code, so you can read, write and fix ZPL before any printer is involved.

What do ^XA and ^XZ mean?

They open and close one label. Everything between them describes that label; commands outside the frame are ignored, which is one of the most common beginner mistakes.

Is ZPL a format or a language?

A language. ZPL describes a label as commands the printer executes, so the same file can print at different physical sizes on different printers — a fixed format like PNG could not do that.

Which ZPL commands should I learn first?

Six cover most labels: ^XA/^XZ to frame the label, ^FO for position, ^A for font and size, ^FD with ^FS for the data, ^PW/^LL for the label size and ^BC for a Code 128 barcode. Everything else is a variation on these.

Related guides

How to open a ZPL file

A .zpl file opens in any text editor, because ZPL is plain text. What the file contains, how to read it, and how to see the label it describes.

Can ChatGPT or Claude Render ZPL?

Language models write and explain ZPL but cannot see the printed label. How a render and validation tool closes that loop — browser, API or MCP — with prompts.

How to preview a ZPL file without a printer

A ZPL file is just text — the label only exists once something draws it. Four ways to see and test a ZPL label without a printer, including CI.

Embed a ZPL Label Viewer in Your Own Site

Show rendered ZPL labels inside your own pages with one iframe — no server code, no libraries. How the embed works, the URL format, and its honest limits.

Try your own ZPL code →