^XA Start Format

Format start and end, separators, comments ZPL caret command

Opens a label format. A valid ZPL II format starts with ^XA and ends with ^XZ.

Format ^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 ^XA and ^XZ must be taken out of it, because the printer adds them back itself.

    pp. 1705, 1706
  • Interaction

    A stored format starts like any other. The ^DF command goes directly after ^XA, and the commands to be stored follow it.

    p. 174
  • Interaction

    The Real-Time Clock mode set with ^SL reads the time for a label when formatting begins, which the guide ties to the moment ^XA is received. The guide adds that in this mode the first label carries the same time as the last one.

    pp. 339, 1617
  • Interaction

    The format prefix, the caret by default, can be changed with ^CC. After that change the guide's example writes the start of the format with the new prefix, as /XA, in place of ^XA.

    p. 152
  • Note

    ^XA is the opening bracket of a label format. It can also be sent as the single ASCII control character STX (control-B, hexadecimal 02).

    p. 370
  • Note

    The guide states that a valid ZPL II format starts with ^XA and ends with ^XZ.

    pp. 370, 375
  • 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

    The tutorial puts ^PR, the print rate, right after the ^XA at the start of the format. The scripting examples likewise place ^PR, ^LL and ^LH between ^XA and the first field.

    pp. 54, 1765, 1766
  • Note

    Some commands that draw no field are also sent inside their own ^XA and ^XZ in the guide: ^HH, which returns the printer configuration to the host, and ^JUS, which saves the current settings.

    pp. 222, 262, 278
  • Note

    Not stated by the guide: what the printer does with a format that is missing its ^XA or that contains a second ^XA. The only rule given is that a valid ZPL II format starts with ^XA and ends with ^XZ.

    pp. 370, 375

^XA example

example.zplZPL
^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.