Reference
ZPL Command Reference
76 commands with syntax, parameter tables, defaults and a live example rendered right on the page. Every example opens in the viewer with one click.
Label format
- ^XAStart FormatPreview: partial
Opens a label format. Every ZPL label begins with ^XA, and the printer ignores field commands that arrive before it.
- ^XZEnd FormatPreview: partial
Closes a label format and tells the printer to image and feed the label. Without it, nothing prints.
- ^PWPrint WidthPreview: exact
Sets the printable width in dots. Anything to the right of it is clipped, which is the usual cause of labels cut off on one side.
- ^LLLabel LengthPreview: exact
Sets the label length in dots. On continuous media it is what defines where one label ends and the next begins.
- ^LHLabel HomePreview: exact
Moves the label origin. Every later ^FO and ^FT is measured from this point rather than from the top-left corner.
- ^LRLabel Reverse PrintPreview: not drawn
Prints every field in the format reversed — white on black — without putting ^FR on each one.
- ^MCMap ClearPreview: partial
Enables or disables the printer's variable-data mode, used with ^FV to update a field without sending the full format again.
- ^DFDownload FormatPreview: partial
Stores a named ZPL template on the printer so later labels can recall its layout and provide only variable data.
- ^XFRecall FormatPreview: partial
Recalls a named stored format and fills its numbered fields with data in the current print job.
- ^LSLabel ShiftPreview: partial
Offsets all following field origins horizontally, providing a format-wide left/right print adjustment in dots.
- ^LTLabel TopPreview: partial
Offsets all following field origins vertically, providing a format-wide up/down print adjustment in dots.
- ^POPrint OrientationPreview: partial
Selects normal or inverted print orientation for the label image.
Fields
- ^FOField OriginPreview: partial
Places the top-left corner of the next field. It is the command you will use more than any other.
- ^FTField TypesetPreview: partial
Places a field by its baseline rather than its top-left corner, so text of different sizes lines up.
- ^FDField DataPreview: exact
Supplies the content of a field — the text, the barcode payload or the QR data.
- ^FNField NumberPreview: partial
Marks a field by number so a stored format can receive its data when the printer recalls it.
- ^FSField SeparatorPreview: exact
Ends the current field. Every field needs one, and a missing ^FS makes the rest of the label print as part of it.
- ^FHField Hexadecimal IndicatorPreview: exact
Lets ^FD carry bytes written as _XX escapes — the only way to print a literal ^ or ~ in field data.
- ^FRField Reverse PrintPreview: exact
Inverts the next field against its background: black becomes white, so text can be knocked out of a filled box.
- ^FWField OrientationPreview: partial
Turns every following field a quarter, half or three-quarter turn, so a template can be rotated without touching each command.
- ^FXCommentPreview: exact
Adds a non-printing comment. Convenient for labelling sections of a template, with one sharp edge around carets.
- ^FPField ParameterPreview: not drawn
Prints a field's characters down the label instead of across it, with control over the space between them.
- ^FVField VariablePreview: partial
Supplies one variable-data field for a printer format that uses ^MC, avoiding a full format download for every label.
- ^SNSerialized DataPreview: partial
Places a serial value that the printer can increment between labels in a print run.
Text and fonts
- ^AScalable / Bitmap FontPreview: partial
Selects the font, size and rotation for the next field. ^A0 is the scalable font used by most modern templates.
- ^CFChange Alphanumeric Default FontPreview: partial
Sets the font and size used by every following field that does not specify its own, so you can stop repeating ^A.
- ^CWFont IdentifierPreview: not drawn
Binds a font stored on the printer to a single letter, so labels can select it the way they select a built-in font.
- ^FBField BlockPreview: partial
Wraps field data into a fixed-width text block with a line limit, justification and an optional hanging indent.
- ^CIChange International Font/EncodingPreview: partial
Selects the printer character set or Unicode encoding used to interpret later field data.
Barcodes
- ^BYBar Code Field DefaultPreview: partial
Sets the module width, ratio and height that following barcodes inherit. Module width is the main lever on whether a barcode scans.
- ^BCCode 128 Bar CodePreview: partial
Draws a Code 128 barcode — the symbology almost every shipping label uses for tracking numbers.
- ^BQQR Code Bar CodePreview: partial
Draws a QR code. The data field takes a mode prefix that is easy to get wrong and is a frequent source of unreadable symbols.
- ^B3Code 39 Bar CodePreview: partial
The workhorse of industrial labelling: uppercase letters, digits and a handful of symbols, readable by every scanner ever made.
- ^BACode 93 Bar CodePreview: partial
A denser, continuous relative of Code 39 that carries the full ASCII set — when the scanner is configured to read it.
- ^BEEAN-13 Bar CodePreview: partial
The retail bar code used everywhere outside North America. Twelve digits in, and the printer works out the thirteenth.
- ^B8EAN-8 Bar CodePreview: partial
The short EAN, for products too small to carry a full EAN-13: seven digits plus a check digit.
- ^BUUPC-A Bar CodePreview: partial
The North American retail bar code: eleven digits plus a check digit, in a fixed 95-module symbol.
- ^B2Interleaved 2 of 5 Bar CodePreview: partial
A very dense numeric symbology — and the one most likely to be misread if you use it without a check digit.
- ^BKANSI Codabar Bar CodePreview: partial
An older numeric symbology kept alive by libraries, blood banks and courier systems, with letters A–D marking where the data starts and stops.
- ^B7PDF417 Bar CodePreview: partial
A stacked 2D symbology that holds a paragraph rather than a number — the code on driving licences and shipping manifests.
- ^BXData Matrix Bar CodePreview: partial
The compact square 2D code: a lot of data in a few millimetres, readable even when part of it is damaged.
- ^B1Code 11 Bar CodePreview: partial
A numeric-only symbology built for telecommunications equipment labels, where it is still the house standard.
- ^B4Code 49 Bar CodePreview: partial
A stacked symbology from before 2D codes existed: two to eight rows of bars in the footprint of a short linear code.
- ^B5PLANET Code Bar CodePreview: partial
The USPS tracking code that rides alongside POSTNET, encoding its digits in the height of each bar rather than the width.
- ^B9UPC-E Bar CodePreview: partial
The compressed six-digit UPC, for retail packages too small to carry a full UPC-A.
- ^BBCODABLOCK Bar CodePreview: partial
Code 128 stacked into a block of rows, for when a linear code would be too long to fit the label.
- ^BDMaxiCode Bar CodePreview: not drawn
The UPS symbol: a bullseye surrounded by hexagons, always one fixed size, carrying the routing data for a parcel.
- ^BFMicroPDF417 Bar CodePreview: partial
PDF417 shrunk for small labels, trading capacity for a footprint that fits on a vial or a circuit board.
- ^BIIndustrial 2 of 5 Bar CodePreview: partial
A numeric-only symbology where only the bars carry data and the spaces just separate them — wide, sturdy and largely obsolete.
- ^BJStandard 2 of 5 Bar CodePreview: partial
The other numeric-only 2 of 5: same idea as Industrial, a different bar pattern, and the two are not interchangeable.
- ^BLLOGMARS Bar CodePreview: partial
Code 39 with the US Department of Defense rules applied: the human-readable line is not optional.
- ^BMMSI Bar CodePreview: partial
A numeric symbology built for shelf labels in retail warehouses, and still found on them.
- ^BOAztec Bar CodePreview: partial
A 2D code with a bullseye at its centre and no quiet zone requirement, which is why transport tickets use it.
- ^BPPlessey Bar CodePreview: partial
The ancestor of MSI: a numeric symbology from 1970s library and retail systems, kept in ZPL for the installations that still run them.
- ^BRGS1 DataBar Bar CodePreview: partial
Six symbologies behind one command, built to put a full GTIN on items too small for a UPC — fresh produce most of all.
- ^BSUPC/EAN ExtensionsPreview: partial
The two- or five-digit add-on that rides beside a UPC or EAN, carrying an issue number or a suggested price.
- ^BTTLC39 Bar CodePreview: not drawn
The TCIF linked bar code: a Code 39 for the ECI number with a MicroPDF417 beside it for everything else.
- ^BZPOSTNET Bar CodePreview: partial
The USPS address code that encodes its digits in bar height, printed along the bottom of an envelope.
Graphics
- ^GBGraphic BoxPreview: partial
Draws a box or a line. With thickness equal to the height it becomes a solid bar — the basis of every reversed header.
- ^GCGraphic CirclePreview: partial
Draws a circle with a diameter, border thickness and colour at the current field origin.
- ^GDGraphic Diagonal LinePreview: partial
Draws a diagonal line across a rectangular field, with selectable rising or falling lean.
- ^GEGraphic EllipsePreview: partial
Draws an ellipse inside a width and height, with a configurable border thickness and colour.
- ^GFGraphic FieldPreview: partial
Embeds a bitmap directly in the label — the command every PDF-to-ZPL and image-to-ZPL conversion produces.
- ^XGRecall GraphicPreview: partial
Draws a bitmap that was downloaded to the printer once, instead of resending it with every label.
- ~DGDownload GraphicPreview: partial
Stores an ASCII-hex bitmap in printer memory under a name, so later labels can recall it with ^XG instead of carrying the whole image.
Printer setup
- ^PQPrint QuantityPreview: not drawn
How many copies of this label the printer produces, and whether it pauses or cuts between them.
- ^PRPrint RatePreview: not drawn
How fast the printer runs — and the first thing to turn down when a barcode stops scanning.
- ^MDMedia DarknessPreview: not drawn
A relative darkness adjustment for this format, on top of whatever the printer is already set to.
- ~SDSet DarknessPreview: not drawn
Sets the printer's darkness outright, from outside any label format.
- ^MMPrint ModePreview: not drawn
What the printer does with a label once it is printed: tear it off, peel it, cut it, or hand it to an applicator.
- ^MNMedia TrackingPreview: not drawn
How the printer finds where one label ends and the next begins — and the usual cause of blank or drifting labels.
- ^MTMedia TypePreview: not drawn
Whether the printer uses a ribbon or burns the media directly — the difference between a printed label and a blank one.
- ~JCSet Media Sensor CalibrationPreview: not drawn
Tells the printer to measure the media it is loaded with, which is the fix for most feeding and blank-label problems.
- ~JLSet Label LengthPreview: not drawn
Makes the printer measure the label in front of it and adopt that length.
- ^JUConfiguration UpdatePreview: not drawn
Saves the printer's current settings so they survive a power cycle — or throws them away and starts from the defaults.
- ^SZSet ZPL ModePreview: not drawn
Switches the printer between the original ZPL and ZPL II. Almost everything written today assumes ZPL II.