MakeZPL

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.

The ZPL label coordinate system A label with its origin at the top-left corner. ^PW sets the width in dots, ^LL the length, ^LH moves the origin, and ^FO positions each field as an x,y offset in dots from that origin. 0,0 — ^LH home ^PW 812 dots ^LL 406 ^FO140,60 HEX BOLT M12 140 dots 60
Every position on a ZPL label is an x,y offset in dots from label home. Change the printer resolution and every one of those numbers changes with it.

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.

ZPL commands that define the label and the print job.
CommandSyntaxWhat it doesMakeZPL
^XAStarts a label format. Every label begins with it.Import + export
^XZEnds the format and tells the printer to print.Import + export
^PW^PWwPrint width in dots. Sets how wide the printable area is.Import + export
^LL^LLnLabel length in dots. With ^PW this is the label size.Import + export
^LH^LHx,yLabel home. Shifts the origin every later ^FO is measured from.Import + export
^CI^CInCharacter encoding. ^CI28 selects UTF-8 — use it for any non-ASCII text.Ignored on import; MakeZPL always exports ^CI28
^FX^FXcommentA comment. The printer ignores everything up to the next caret command.Ignored on import; optional on export
^PQ^PQq,p,r,oPrint quantity: how many copies of this label to print.Export only
^MD^MDnMedia darkness adjustment, relative to the printer setting.Export only
^PR^PRp,s,bPrint 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.

Commands that position fields and carry their data.
CommandSyntaxWhat it doesMakeZPL
^FO^FOx,yField origin: the top-left corner of the next field, in dots from label home.Import + export
^FT^FTx,yField typeset: like ^FO, but y is the text baseline rather than the top.Imported as ^FO, with a warning
^FD^FDdataField data — the text, barcode value or graphic payload.Import + export
^FSField separator. Ends the current field so the next one can start.Import + export
^FH^FHaEnables hex escapes in ^FD. The default indicator is _, so _5E prints a literal ^.Import + export
^FRField reverse: the next field prints white where the label is black and vice versa.Import + export
^FB^FBw,lines,gap,just,indentField 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.

Commands that select a font.
CommandSyntaxWhat it doesMakeZPL
^A^Af,o,h,wSets 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,wChanges the default font for every following field until the next ^CF.Import + export
^A@^A@o,h,w,fontUses 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×.

The built-in fonts MakeZPL offers, and how it previews them.
FontReferenceTypeMakeZPL preview font
0^A0Scalable (CG Triumvirate Bold Condensed)Arial Narrow
A^AABitmap, 9 dot base heightMonospace
B^ABBitmap, 11 dot base heightMonospace
D^ADBitmap, 18 dot base heightMonospace
E^AEBitmap, OCR-BMonospace
F^AFBitmap, 26 dot base heightMonospace

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.

Commands that draw graphics.
CommandSyntaxWhat it doesMakeZPL
^GB^GBw,h,t,c,rGraphic 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,oGraphic diagonal line. Orientation R leans right, L leans left.Import + export
^GE^GEw,h,t,cGraphic ellipse.Import + export
^GF^GFa,b,c,d,dataGraphic 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.

ZPL barcode commands supported by MakeZPL.
CommandSyntaxSymbologyMakeZPL
^BY^BYw,r,hSets narrow-bar width in dots, wide:narrow ratio and default height for the barcodes that follow.Import + export
^BC^BCo,h,f,g,e,mCode 128 — the general-purpose choice for alphanumeric data.Import + export
^B3^B3o,e,h,f,gCode 39. Note the parameter order differs from ^BC: the check digit comes before the height.Import + export
^BU^BUo,h,f,g,eUPC-A retail barcode.Import + export
^BE^BEo,h,f,gEAN-13 retail barcode.Import + export
^B8^B8o,h,f,gEAN-8 retail barcode.Import + export
^B2^B2o,h,f,g,eInterleaved 2 of 5 — digits only, in even-numbered lengths.Import + export
^BQ^BQa,b,c,dQR code. The magnification is the third parameter, and the error-correction level is carried in ^FD.Import + export
^BX^BXo,h,s,c,rData 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 ^FD in 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 — ^POI flips 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.

Try a command in the designer See complete labels