^XZ End Format
Closes a label format. When the printer receives it, a label prints.
^XZ
^XZ parameters
This command takes no parameters.
^XZ notes and gotchas
-
Interaction
The guide's scripting-shortcuts section says
pp. 1766, 1767^XZcloses the last field in the same way^FSdoes, so the^FSbefore^XZcan be left out. Its later examples leave it out. -
Interaction
A format that starts with
pp. 174, 1754^DFis stored, not printed. In the guide's stored-format walk-through such a format ends with^XZlike any other, yet no label comes out; the data indicator goes on and then off. A second format that recalls it with^XFis the one that prints. -
Interaction
The tutorial says to add
pp. 54, 324, 1766^PQjust before^XZto print several labels, and the scripting examples end the same way, with^PQ10directly before^XZ. -
Interaction
pp. 344, 375^SPlets a label start printing before it has been completely formatted. The^XZentry says a label prints when^XZis received, and the guide does not say how the two statements fit together. -
Interaction
A control command, the ~ form, is acted on as soon as it is received. The guide's
pp. 413, 1754^HLand~HLentry shows the contrast:~HLis processed immediately, while^HLwaits until all earlier formats, each written from^XAto^XZ, have been processed. -
Interaction
The format prefix, the caret by default, can be changed with
p. 152^CC. After that change the guide's example closes the format with /XZ, using the new prefix. -
Note
p. 375^XZis the closing bracket of a label format. According to the guide, a label prints when this command is received. It can also be sent as the single ASCII control character ETX (control-C, hexadecimal 03). -
Note
The guide states that label formats must start with
pp. 370, 375^XAand end with^XZto be valid ZPL II. -
Note
Not stated by the guide: what the printer does with a format that is missing its
pp. 370, 375^XZor that contains a second^XZ. The only rule given is that a valid ZPL II format starts with^XAand ends with^XZ.
^XZ example
^XA ^FO40,40^A0N,28,28^FDLine one^FS ^PQ2 ^XZ ^XA ^FO40,40^A0N,28,28^FDLine two^FS ^XZ
Two complete formats sent one after the other. Each one is closed by its own ^XZ, and the guide says a label prints when ^XZ is received. The first format asks for a quantity of 2 with ^PQ placed just before its ^XZ, the position the tutorial uses; the second leaves the quantity at its default of 1.
Guides that use ^XZ
BarcoderX is a .NET SDK for thermal labels and barcodes. See how it prints and exports labels.
Source Zebra, ZPL II, ZBI 2, Set-Get-Do, Mirror, WML Programming Guide, P1134473-11EN Rev A, 2026/07/05, pages 54, 60, 152, 174, 190, 201, 204, 324, 344, 370, 375, 413, 1754, 1766, 1767.
Written by BarcoderX in its own words. Checked against the guide on 2026-11-14.
ZPL and ZPL II are trademarks of Zebra Technologies Corporation. This reference is written by BarcoderX in its own words from Zebra's published programming guide. BarcoderX is an independent product and is not affiliated with, endorsed by or sponsored by Zebra Technologies.