ZPL Commands Reference
Reference for every Zebra Programming Language (ZPL) II command, with renderer support status
ZPL Commands Reference
Every command in Labelary's command table has a page here, with its syntax, its full parameter table, a rendered example, and the measured differences between the renderer, Labelary and the specification.
Documentation is not support: the renderer implements the most-used subset. Renderer support states what renders today, and how the renderer reports an unsupported command.
Renderer support
The renderer behaves like a physical Zebra printer. It renders best-effort,
and never fails a label because of a command it does not implement. It also
reports every ignored command and silent default as a
diagnostic. The diagnostic appears
inline in the online viewer and the desktop app, and in
the
X-Warnings header
on the API.
Renders today (verified against the engine):
- label structure and fields (
^XA^XZ^FS^FX^FO^FT^FB^FD^FV^FH^FR^FW) - fonts and text (
^A^CF,^CIpartially) - barcodes (
^BY^BCCode 128 / GS1-128,^B2Interleaved 2-of-5,^B3Code 39,^B7PDF417,^BQQR Code,^BXData Matrix,^BDMaxiCode) - graphics (
^GB^GF~DG^XG^ID) - layout (
^LH^PW^CC^CT)
Everything else falls into two buckets, one per diagnostic code on the diagnostics reference:
-
Recognized but not implemented — documented ZPL that changes the rendered label, and that the renderer does not implement yet: for example
^PM(print mirror image). The renderer ignores it and reportswarningseverity, which reaches the API'sX-Warningsheader:UNSUPPORTED_COMMAND: command "^PM" is valid ZPL but is not supported by this renderer yet; it was skipped -
Recognized and intentionally ignored — commands that cannot affect a rendered label at all. The set covers printer, job, device and network configuration, host status queries, sensor calibration, and RFID, for example
^PR,^MMand^MN. Labelary ignores the same set. These commands reportIGNORED_COMMANDatinfoseverity, which does not reachX-Warnings. The skip policy gives the full list and the reasons.
The renderer reports anything that is not ZPL (a typo, wrong case) as:
UNKNOWN_COMMAND: This ZPL command does not exist and was ignoredQuick start commands
The first ZPL commands to learn:
- ^XA - Start Format - Begins a label format (required)
- ^XZ - End Format - Ends a label format (required)
- ^FO - Field Origin - Sets field position
- ^FD - Field Data - Specifies text content
- ^FS - Field Separator - Ends field definition
- ^A - Scalable Font - Selects font and size
Command categories
The reference has 231 commands in 16 categories. The sidebar links to every command page. Each category below links to its section of the command support matrix, which gives the per-command status and a note wherever the renderer differs.
"Renders" counts commands that draw something: supported plus partial.
"Ignored" counts commands that cannot affect a rendered label. The renderer and
Labelary both ignore them. "Not yet" counts planned plus unsupported.
| Category | Commands | Renders | Ignored | Not yet |
|---|---|---|---|---|
| Format control | 9 | 7 | 2 | 0 |
| Fields | 16 | 14 | 2 | 0 |
| Fonts and text | 13 | 6 | 0 | 7 |
| Bar codes | 29 | 26 | 0 | 3 |
| Graphics and images | 17 | 15 | 2 | 0 |
| Label geometry | 10 | 8 | 2 | 0 |
| Print control | 17 | 5 | 9 | 3 |
| Media and sensors | 16 | 1 | 15 | 0 |
| Serialisation | 2 | 2 | 0 | 0 |
| Real-time clock | 4 | 3 | 1 | 0 |
| Memory and storage | 4 | 3 | 1 | 0 |
| Printer configuration | 31 | 2 | 23 | 6 |
| Host status and queries | 16 | 3 | 13 | 0 |
| Network and wireless | 23 | 1 | 22 | 0 |
| RFID | 22 | 0 | 21 | 1 |
| Labelary extensions | 2 | 0 | 0 | 2 |
Common command patterns
The three blocks below are annotated, not runnable. ZPL has no comment syntax, so
a printer reads everything after # as field data and warns about the rest. For
runnable examples, use any command page.
Basic label structure
^XA # Start format
^FO50,50 # Position at (50,50)
^ADN,50,50 # Font: Arial, Normal, 50x50
^FDHello World^FS # Data and separator
^XZ # End formatWith barcodes
^XA
^FO50,50
^BCN,100,Y,N,N # Code 128 barcode
^FD123456789^FS
^FO50,200
^ADN,40,40
^FDProduct Code^FS
^XZWith multiple fields
^XA
^LH0,0 # Label home
^LL812 # Label height
^FO50,50
^ADN,50,50
^FDField 1^FS
^FO50,150
^ADN,40,40
^FDField 2^FS
^XZParameter notation
Throughout ZPL documentation:
- Required parameters must have a value
- Optional parameters can be absent
- Comma delimiters separate parameters
- Trailing commas are optional with the defaults
Orientation values
For fields and bar codes:
- N = Normal (0°)
- R = Rotated 90° clockwise
- I = Inverted 180°
- B = Read from bottom up (270°)
Device designations
Storage locations:
- R: = RAM (volatile memory)
- E: = Permanent storage (EPROM, Flash)
- B: = Optional memory (Flash card)
- A: = All memory devices
Quick access by use case
Build a label
- Start with
^XA(Start Format) - Set label dimensions with
^LLand^LH - Position with
^FO - Select font with
^Aor^CF - Add text with
^FDand^FS - End with
^XZ(End Format)
Add a barcode
Work with graphics
Printer control
Troubleshoot and set up
- Configuration:
~WC(Print Configuration Label) - Memory status:
~HM - Reset printer:
~JR - Calibrate sensors:
~JC
Tips and best practices
- Always end with ^XZ - Every label format must end with this command
- Position before content - Use ^FO before ^FD and barcode commands
- Set fonts early - Use ^A or ^CF at the beginning to avoid repetition
- Test before production - Verify labels look correct before large print jobs
- Use comments - Add ^FX comments to document complex formats
- Consider reuse - Use ^DF to store frequently used formats
- Optimize for speed - Minimize command size for faster transmission
- Check memory - Use ~HM to verify available memory before large downloads
- Validate codes - Enable code validation with ^CV for quality assurance
- Document configuration - Print configuration labels with ~WC for reference