ZPL commands list and reference
Complete ZPL commands list grouped by task: format and position, text and fonts, barcodes, graphics, media setup. Syntax, parameter ranges, runnable examples.
How a ZPL format is built
Every label starts with ^XA and ends with ^XZ. In between, each field is three parts: a position (^FO x,y), the content (^FD…^FS) and an optional format command (font ^A, barcode ^BC). Coordinates are printer dots, not millimetres — at 203 DPI one inch is 203 dots.
^XA
^FO50,50^A0N,40,40^FDHello^FS
^FO50,110^BY2^BCN,80,Y,N,N^FD12345678^FS
^XZZPL commands list by task
The commands each job needs, one per line. Every link opens the command's own page with syntax, parameter ranges and an example; the printable version of this list is the ZPL cheat sheet.
Format and position
Open and close a label, end each field and place it: ^FO from the top-left corner, ^FT from the text baseline; ^LH, ^LS and ^LT shift the whole label.
^XAStart Format^XZEnd Format^FSField Separator^FOField Origin^FTField Typeset^LHLabel Home^LSLabel Shift^LTLabel Top^FXComment
Text and fonts
Field data, font and size, the default font, the character set (^CI28 for UTF-8), wrapping text blocks, hex escapes, rotation and reverse print.
^FDField Data^AFont Selection^CFChange Default Font^CICharacter Set^FBField Block^TBText Block (width and height)^FHField Hexadecimal Indicator^FWField Orientation^FRField Reverse Print^FVField Variable^PAAdvanced Text Properties^CWFont Identifier
Barcodes
^BY sets the module width and default height for the barcode that follows; then one command per symbology, 1D and 2D.
^BYBarcode Field Defaults^BCCode 128^BEEAN-13^BQQR Code^BXData Matrix^B3Code 39^B7PDF417^B1Code 11^B2Interleaved 2/5^B8EAN-8^B9UPC-E^BACode 93^BIIndustrial 2/5^BJStandard 2/5^BKCodabar^BMMSI^BUUPC-A^BRGS1 DataBar^B0Aztec^BOAztec^BFMicroPDF417^BDMaxiCode
Graphics and images
Boxes and lines (^GB), circles, ellipses, diagonal lines, embedded bitmaps (^GF) and graphics stored in printer memory.
^GBGraphic Box^GCGraphic Circle^GDGraphic Diagonal Line^GEGraphic Ellipse^GFGraphic Field^IMImage Move~DGDownload Graphic^XGRecall Graphic
Media and printer setup
Label width and length, print orientation, reversing the whole label, units of measurement and how many copies to print.
^PWPrint Width^LLLabel Length^POPrint Orientation^PMPrinting Mirror Image of Label^LRLabel Reverse^MUSet Units of Measurement^PQPrint Quantity
For a printable one-page summary see the ZPL cheat sheet; to try a command right now, the online ZPL viewer. ZPL cheat sheet · online ZPL viewer
Format control
Start Format
Marks the beginning of a label format. Every label starts with ^XA.
^XZEnd Format
Ends the label format and prints or renders the label.
^FSField Separator
Ends a field. Every ^FD, ^GB or barcode field is closed with ^FS.
^FXComment
A comment. It has no effect on rendering and is skipped.
^CFChange Default Font
Sets the default font, height and width for the ^FD fields that follow.
^CICharacter Set
Selects the international character encoding. The engine assumes UTF-8 (^CI28).
^PWPrint Width
Sets the print width of the label in dots.
^LLLabel Length
Sets the label length in dots.
^LHLabel Home
Moves the top-left (home) reference point of the label.
^LTLabel Top
Shifts the whole label vertically.
^POPrint Orientation
Selects the print orientation: ^POI prints the whole label rotated 180°. The preview draws it rotated too.
^LRLabel Reverse
Prints following fields reversed (negative); ^LRN turns it off.
^LSLabel Shift
Shifts ALL fields horizontally. Shipping labels usually carry ^LS0 (no effect); a non-zero value moves every field.
^PMPrinting Mirror Image of Label
Mirrors the whole printable area from left to right; stays active until ^PMN. The preview draws the mirror image too.
^CCChange Caret
Changes the format command prefix (^) to another character (~CC works too); the preview and the validator apply the new prefix.
^CTChange Tilde
Changes the control command prefix (~) to another character; also written ~CT. The preview and the validator apply the change.
Positioning and text
Field Origin
Places the next field at position x,y measured from the top-left corner.
^FTField Typeset
Positions the next field from the baseline of the text rather than its top edge.
^FDField Data
Carries the text or barcode data to be printed.
^FHField Hexadecimal Indicator
Enables _XX hex escapes inside the following ^FD (for special characters).
^A ·Font Selection
Selects the font, orientation and size. ^A0 is the scalable font.
^FBField Block
Lays text out as a word-wrapped block of a given width, with justification.
^FWField Orientation
Sets the default rotation for the fields that follow (N/R/I/B).
^FRField Reverse Print
Prints the next field in reverse: light on a dark background.
^FVField Variable
Carries field data as a variable; the engine treats it the same way as ^FD.
^TBText Block (width and height)
Places text in a block of the given width and height with word wrap; text that does not fit is truncated, not overprinted as with ^FB.
^PAAdvanced Text Properties
Sets how missing characters print and switches bidirectional layout, shaping and OpenType; the preview applies the last three together.
^CWFont Identifier
Binds a font letter (A-Z, 0-9) to a downloaded font. The preview only uses a TrueType font sent with ~DU in the same ZPL.
Graphics
Graphic Box
Draws a rectangular box or a line (width, height, thickness).
^GCGraphic Circle
Draws a circle (diameter, thickness).
^GDGraphic Diagonal Line
Draws a diagonal line.
^GEGraphic Ellipse
Draws an ellipse (width, height, thickness).
^GFGraphic Field
Prints a bitmap graphic (logo or image) embedded in the label.
^IMImage Move
Places a graphic from memory at the current ^FO position (does the same job as ^XG).
Barcodes
Barcode Field Defaults
Sets the module width, ratio and height for the barcodes that follow.
^BCCode 128
A Code 128 barcode — the most common linear barcode in shipping and logistics.
^BEEAN-13
An EAN-13 retail product barcode (the last digit is calculated automatically).
^BQQR Code
A QR code. The data is normally given with the ^FDQA,... prefix.
^BXData Matrix
A Data Matrix 2D barcode — a lot of data in a very small area.
^B3Code 39
Code 39 — a linear barcode encoding uppercase letters and digits.
^B7PDF417
A PDF417 stacked barcode — high data capacity across multiple rows.
^B1Code 11
Code 11 (USD-8) — telecom and laboratory labels.
^B2Interleaved 2/5
Interleaved 2 of 5 — numeric data in digit pairs.
^B8EAN-8
EAN-8 — short retail code for small packaging.
^B9UPC-E
UPC-E — compressed UPC for small packaging.
^BACode 93
Code 93 — the denser successor to Code 39.
^BIIndustrial 2/5
Industrial 2 of 5 — numeric only, industrial use.
^BJStandard 2/5
Standard 2 of 5 — numeric only.
^BKCodabar
Codabar — blood banks, libraries, courier labels.
^BMMSI
MSI Plessey — shelf and inventory labels.
^BUUPC-A
UPC-A — the North American retail standard.
^BRGS1 DataBar
GS1 DataBar (RSS Expanded) — small retail and fresh food.
^B0Aztec
Aztec Code — 2D, needs no quiet zone.
^BOAztec
Aztec Code (^BO spelling) — produces the same symbology as ^B0.
^BFMicroPDF417
MicroPDF417 — PDF417 compressed for narrow space.
^BDMaxiCode
MaxiCode — the symbology on UPS shipping labels.
Advanced
Serialisation Data
Serialises the field data across a batch with a start value, an increment and padding.
^PQPrint Quantity
Sets how many copies of the same label are produced.
^MU ·Set Units of Measurement
Selects the unit used by the commands that follow; with a base and target dot density the printer rescales the format between resolutions.
^FNField Number
A variable field placeholder in templates (used with ^DF and ^XF).
^DFDownload Format
Stores a label format in memory as a template.
^XFRecall Format
Recalls a stored template and fills its ^FN fields with values.
^XGRecall Graphic
Recalls a graphic loaded into memory (~DG or ^GF) and prints it.
~DGDownload Graphic
Loads a bitmap graphic into printer memory (a control command with the ~ prefix).
~DUDownload Font
Loads a TrueType font into virtual printer memory; fields bound to it with ^A@ use this data.
~DYDownload Object
Loads a graphic or font object into virtual printer memory (the general form of ~DG).
~EGErase Graphics
Erases ALL graphics from virtual printer memory.
^IDDelete Object
Deletes a SINGLE object from memory (~EG erases all).
^SFSerialization Field
Increments field data automatically according to a mask (the mask-based form of ^SN).
Labelixa extension (preview)
RFID
RFID Read/Write
Writes data to or reads data from the RFID tag. It does not affect the preview image; encoding is done by a real RFID printer.
^RS ·RFID Setup
Configures RFID tag type, programming position and error handling.
^RB ·EPC Bit Partitions
Defines the bit partitions of the EPC data; subsequent ^RF writes use this layout.
^RR ·RFID Retries
Sets the number of retries for failed RFID read/write operations.
Printer settings
Set ZPL Mode
Selects whether the printer interprets ZPL or ZPL II. A printer setting; it does not affect the preview.
~TA ·Tear-off Adjust Position
Moves where the media stops after printing (tear or cut position) in dot rows, written as three digits. No effect on the preview.
^ML ·Maximum Label Length
Sets the maximum label length calibration searches for; it must be equal to or greater than the real label length. It does not affect the preview.
^MC ·Map Clear
^MCN keeps the bitmap, so this label prints behind the next one. The preview draws every label clean and warns on ^MCN.
~PS ·Print Start
Makes a paused printer resume printing (the same as pressing PAUSE on the panel). It does not affect the preview.
~JO ·Head Test Non-Fatal
A failed head test shows an error and stops printing, but no power cycle is needed (unlike ~JN). No effect on the preview.
^SP ·Start Print
On complex labels, starts printing from the given dot row before the whole format is ready (a throughput setting). It does not affect the preview.
^ZZ ·Printer Sleep
Shuts a battery-powered printer down after the given idle time (PA400/PT400 only). It does not affect the preview.
~EF ·Erase Stored Formats (legacy)
Legacy ZPL II command that erases formats stored on the printer; the current Zebra guide uses ^ID instead. No effect on the preview.
Full Zebra command catalog
Every other command in Zebra's ZPL programming guide, with syntax and what it does. Commands that change the label have their own page; printer settings, network, memory, RFID and font downloads are grouped by task.
Commands with their own page
^A@Use Font Name to Call Font^B4Code 49 Barcode^B5Planet Code Barcode^BBCODABLOCK Barcode^BLLOGMARS Barcode^BPPlessey Barcode^BSUPC/EAN Extensions^BTTLC39 Barcode^BZPOSTAL Barcode^CDChange Delimiter^CVCode Validation^FCField Clock^FEField Concatenation^FMMultiple Field Origin Locations^FPField Parameter^GSGraphic Symbol^JMSet Dots per Millimeter
Commands grouped by task
- ZPL status, query and diagnostic commands — 23 commands
- ZPL media, darkness and print speed commands — 27 commands
- ZPL printer control and configuration commands — 24 commands
- ZPL memory and stored object commands — 12 commands
- ZPL network and wireless commands — 25 commands
- ZPL RFID commands: lock, serialise, power and log — 7 commands
- ZPL font and encoding download commands — 9 commands