Reference
ZPL command reference
The ZPL II commands you actually meet on a label, what each parameter does, and whether MakeZPL can read it, write it, or both. Written against the behaviour of our own parser and code generator, so what you read here is what the tool really does.
Anatomy of a ZPL field
ZPL is a stream of caret commands. A label is one ^XA …
^XZ block, and inside it every visible thing follows the same shape: say
where it goes, say what kind of thing it is, give it data, end the field.
^XA start the label
^PW812 ^LL406 4 x 2 in at 203 dpi
^FO30,28 where
^A0N,44,44 what kind (font 0, 44 dots tall)
^FDHEX BOLT M12 the data
^FS end of field
^XZ print
Coordinates are always in printer dots, never millimetres or points, and
they are measured from the label home set by ^LH —
^LH0,0 puts the origin at the top-left corner.
Converting sizes to dots is the other half of
getting a label right.
Label structure and print settings
These frame the label and tell the printer how to print it. ^PW and
^LL are the two you will change most often.
| Command | Syntax | What it does | MakeZPL |
|---|---|---|---|
^XA | — | Starts a label format. Every label begins with it. | Import + export |
^XZ | — | Ends the format and tells the printer to print. | Import + export |
^PW | ^PWw | Print width in dots. Sets how wide the printable area is. | Import + export |
^LL | ^LLn | Label length in dots. With ^PW this is the label size. | Import + export |
^LH | ^LHx,y | Label home. Shifts the origin every later ^FO is measured from. | Import + export |
^CI | ^CIn | Character encoding. ^CI28 selects UTF-8 — use it for any non-ASCII text. | Ignored on import; MakeZPL always exports ^CI28 |
^FX | ^FXcomment | A comment. The printer ignores everything up to the next caret command. | Ignored on import; optional on export |
^PQ | ^PQq,p,r,o | Print quantity: how many copies of this label to print. | Export only |
^MD | ^MDn | Media darkness adjustment, relative to the printer setting. | Export only |
^PR | ^PRp,s,b | Print rate in inches per second. | Export only |
A label with no ^PW or ^LL still prints — the printer
falls back to its configured media size. MakeZPL always writes both so the file is
self-describing, and on import it grows the canvas to fit the content when they are
missing.
Fields and data
^FO positions, ^FD carries the content, ^FS closes
the field. Everything else in this group modifies how the data is treated.
| Command | Syntax | What it does | MakeZPL |
|---|---|---|---|
^FO | ^FOx,y | Field origin: the top-left corner of the next field, in dots from label home. | Import + export |
^FT | ^FTx,y | Field typeset: like ^FO, but y is the text baseline rather than the top. | Imported as ^FO, with a warning |
^FD | ^FDdata | Field data — the text, barcode value or graphic payload. | Import + export |
^FS | — | Field separator. Ends the current field so the next one can start. | Import + export |
^FH | ^FHa | Enables hex escapes in ^FD. The default indicator is _, so _5E prints a literal ^. | Import + export |
^FR | — | Field reverse: the next field prints white where the label is black and vice versa. | Import + export |
^FB | ^FBw,lines,gap,just,indent | Field block: wraps ^FD text inside a box w dots wide, over at most lines lines. | Import + export |
Escaping data with ^FH
^ and ~ are ZPL control characters. If your data contains one,
the printer will read it as the start of a command and the label will break. Turn on
^FH and write the character as an underscore followed by its two-digit hex
code:
^FO30,30^A0N,30,30^FH^FDPART _5E 12 — 40% off^FS
_5E is ^ and _7E is ~. Once
^FH is active the underscore itself is special, so a literal underscore has
to be written _5F. MakeZPL applies this automatically: it only emits
^FH when your data actually needs it.
Wrapping text with ^FB
^FD on its own prints one long line that runs off the edge of the label.
^FB gives the field a width and a maximum number of lines, and the printer
wraps on word boundaries inside it:
^FO30,30
^A0N,28,28
^FB360,3,0,L,0
^FDStainless steel hex bolt, M12 x 60 mm, grade 8.8, zinc plated^FS
The parameters are width in dots, maximum lines, extra line spacing, justification
(L, C, R, J) and hanging indent. Text
beyond the line limit is dropped by the printer — which is why MakeZPL measures
your text before export and warns you instead.
Text and fonts
^A sets the font for one field; ^CF sets it for everything that
follows. Height and width are given in dots, not points.
| Command | Syntax | What it does | MakeZPL |
|---|---|---|---|
^A | ^Af,o,h,w | Sets the font, orientation, height and width for this field only. ^A0N,40,40 is font 0, normal rotation, 40 dots tall. | Import + export |
^CF | ^CFf,h,w | Changes the default font for every following field until the next ^CF. | Import + export |
^A@ | ^A@o,h,w,font | Uses a downloaded font by file name from printer memory. | Not handled — skipped with a warning |
The built-in fonts
Zebra printers ship with a set of built-in fonts. Font 0 is the one to reach for: it is the only fully scalable built-in, so any height you ask for is the height you get. The letter fonts are bitmaps at a fixed cell size, and the printer scales them by whole-number multiples — ask for 1.5× and you get 1×.
| Font | Reference | Type | MakeZPL preview font |
|---|---|---|---|
0 | ^A0 | Scalable (CG Triumvirate Bold Condensed) | Arial Narrow |
A | ^AA | Bitmap, 9 dot base height | Monospace |
B | ^AB | Bitmap, 11 dot base height | Monospace |
D | ^AD | Bitmap, 18 dot base height | Monospace |
E | ^AE | Bitmap, OCR-B | Monospace |
F | ^AF | Bitmap, 26 dot base height | Monospace |
The browser preview approximates these with web fonts, so a line of text can measure a dot or two differently from the printed result. For layouts where that matters, leave a little slack rather than fitting text to the exact dot.
Rotation
The orientation parameter appears in almost every format command:
N normal, R rotated 90° clockwise, I inverted
180°, B read from the bottom up (270°). ^A0B,40,40
prints a 40-dot line of text running up the side of the label.
Shapes and images
There is no line command in ZPL. A rule is just a very thin box — which is exactly how MakeZPL exports one.
| Command | Syntax | What it does | MakeZPL |
|---|---|---|---|
^GB | ^GBw,h,t,c,r | Graphic box. With a thickness equal to its height it draws a rule; with rounding 0–8 it draws a rounded box. | Import + export |
^GD | ^GDw,h,t,c,o | Graphic diagonal line. Orientation R leans right, L leans left. | Import + export |
^GE | ^GEw,h,t,c | Graphic ellipse. | Import + export |
^GF | ^GFa,b,c,d,data | Graphic field: a bitmap. ^GFA carries the rows as ASCII hex, one bit per dot. | Export only — skipped on import with a warning |
^FO30,140^GB360,3,3^FS a 360 x 3 dot rule
^FO30,160^GB360,120,2^FS a 2-dot outlined box
^FO30,300^GB40,40,40^FS a solid 40 x 40 square
^FO30,360^GB360,60,60,B,4^FS a filled box with rounded corners
For images, ^GFA carries the bitmap inline as ASCII hex, one bit per printer
dot. It is verbose — a logo can easily be tens of kilobytes — but it needs
nothing stored on the printer.
Converting a logo to ^GFA covers the details.
Barcode commands
Every barcode is a format command followed by ^FD data, with
^BY setting the module width and height that the following barcodes inherit.
| Command | Syntax | Symbology | MakeZPL |
|---|---|---|---|
^BY | ^BYw,r,h | Sets narrow-bar width in dots, wide:narrow ratio and default height for the barcodes that follow. | Import + export |
^BC | ^BCo,h,f,g,e,m | Code 128 — the general-purpose choice for alphanumeric data. | Import + export |
^B3 | ^B3o,e,h,f,g | Code 39. Note the parameter order differs from ^BC: the check digit comes before the height. | Import + export |
^BU | ^BUo,h,f,g,e | UPC-A retail barcode. | Import + export |
^BE | ^BEo,h,f,g | EAN-13 retail barcode. | Import + export |
^B8 | ^B8o,h,f,g | EAN-8 retail barcode. | Import + export |
^B2 | ^B2o,h,f,g,e | Interleaved 2 of 5 — digits only, in even-numbered lengths. | Import + export |
^BQ | ^BQa,b,c,d | QR code. The magnification is the third parameter, and the error-correction level is carried in ^FD. | Import + export |
^BX | ^BXo,h,s,c,r | Data Matrix. The second parameter is the module size in dots. | Import + export |
Each symbology has its own rules about what data is legal — UPC-A wants 11 or 12 digits, Interleaved 2 of 5 needs an even count, Code 39 accepts a restricted character set. Barcodes in ZPL lists the rules per symbology, with a working example of each.
Commands MakeZPL does not handle
These are real ZPL and your printer understands them, but MakeZPL has no canvas equivalent. On import they are skipped and named in a warning; they are never silently dropped.
^FN— Field number — a numbered placeholder filled in later by^FDin a recalled format.^DF / ^XF— Download a format to printer memory and recall it, so only the data is sent per label.^SN— Serialised data field: the printer increments a number across a print run.^PO— Print orientation —^POIflips the whole label 180°.^LS— Label shift: moves the whole format left or right.^LT— Label top: moves the format up or down by a number of dot rows.^MM— Print mode — tear-off, peel, cutter, rewind.^MN— Media tracking — gap, black mark or continuous stock.~DG— Download a graphic to printer memory for later recall by name.
On ^FN and stored formats: the classic ZPL way to handle
variable data is to download a format with numbered fields once
(^DF / ^FN) and then send only
^XF plus the values per label. MakeZPL takes the simpler route —
text placeholders such as {{item_number}} left inside ^FD
— because that is what host systems like RF-SMART and NetSuite substitute into.
You can convert a MakeZPL template to the ^FN style by hand afterwards.