^XA Start Format
Opens a label format. A valid ZPL II format starts with ^XA and ends with ^XZ.
^XA
^XA parameters
This command takes no parameters.
^XA notes and gotchas
-
Gotcha
Files prepared for the printer's Mirror update feature are an exception: the guide says each file may hold only one format and that
pp. 1705, 1706^XAand^XZmust be taken out of it, because the printer adds them back itself. -
Interaction
A stored format starts like any other. The
p. 174^DFcommand goes directly after^XA, and the commands to be stored follow it. -
Interaction
The Real-Time Clock mode set with
pp. 339, 1617^SLreads the time for a label when formatting begins, which the guide ties to the moment^XAis received. The guide adds that in this mode the first label carries the same time as the last one. -
Interaction
The format prefix, the caret by default, can be changed with
p. 152^CC. After that change the guide's example writes the start of the format with the new prefix, as /XA, in place of^XA. -
Note
p. 370^XAis the opening bracket of a label format. It can also be sent as the single ASCII control character STX (control-B, hexadecimal 02). -
Note
The guide states that a valid ZPL II format starts with
pp. 370, 375^XAand ends with^XZ. -
Note
Line breaks between commands are optional. The guide's section on scripting shortcuts shows the same format written on one line and spread over several lines, and says the result is the same.
pp. 1765, 1766 - Note
-
Note
Some commands that draw no field are also sent inside their own
pp. 222, 262, 278^XAand^XZin the guide:^HH, which returns the printer configuration to the host, and^JUS, which saves the current settings. -
Note
Not stated by the guide: what the printer does with a format that is missing its
pp. 370, 375^XAor that contains a second^XA. The only rule given is that a valid ZPL II format starts with^XAand ends with^XZ.
^XA example
^XA ^FO50,50^A0N,30,30^FDMinimal label^FS ^XZ
The smallest useful format: ^XA opens it, one text field is placed 50 dots from the left and 50 dots down in the scalable font 0, and ^XZ closes it.
Guides that use ^XA
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, 222, 262, 278, 339, 370, 375, 1617, 1705, 1706, 1765, 1766.
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.