^XZ End Format

Format start and end, separators, comments ZPL caret command

Closes a label format. When the printer receives it, a label prints.

Format ^XZ

^XZ parameters

This command takes no parameters.

^XZ notes and gotchas

  • Interaction

    The guide's scripting-shortcuts section says ^XZ closes the last field in the same way ^FS does, so the ^FS before ^XZ can be left out. Its later examples leave it out.

    pp. 1766, 1767
  • Interaction

    A format that starts with ^DF is stored, not printed. In the guide's stored-format walk-through such a format ends with ^XZ like any other, yet no label comes out; the data indicator goes on and then off. A second format that recalls it with ^XF is the one that prints.

    pp. 174, 1754
  • Interaction

    The tutorial says to add ^PQ just before ^XZ to print several labels, and the scripting examples end the same way, with ^PQ10 directly before ^XZ.

    pp. 54, 324, 1766
  • Interaction

    ^SP lets a label start printing before it has been completely formatted. The ^XZ entry says a label prints when ^XZ is received, and the guide does not say how the two statements fit together.

    pp. 344, 375
  • Interaction

    A control command, the ~ form, is acted on as soon as it is received. The guide's ^HL and ~HL entry shows the contrast: ~HL is processed immediately, while ^HL waits until all earlier formats, each written from ^XA to ^XZ, have been processed.

    pp. 413, 1754
  • Interaction

    The format prefix, the caret by default, can be changed with ^CC. After that change the guide's example closes the format with /XZ, using the new prefix.

    p. 152
  • Note

    ^XZ is 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).

    p. 375
  • Note

    The guide states that label formats must start with ^XA and end with ^XZ to be valid ZPL II.

    pp. 370, 375
  • Note

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

    pp. 370, 375

^XZ example

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