^XZ marks the end of a ZPL label format. When the printer receives ^XZ, it finalizes the format buffer and queues the label for printing. Without ^XZ, the format stays open and nothing prints — this is one of the most common causes of "printer received data but printed nothing" issues.
Every ^XA must have a corresponding ^XZ. The two commands work as a matched pair: ^XA opens the format context, ^XZ closes it. Commands sent between ^XZ and the next ^XA are typically ignored or stored as persistent settings depending on firmware version.
In streaming environments (e.g., a backend TCP socket sending ZPL in real time), make sure ^XZ is always flushed to the printer. Buffering in your application layer can leave the format open and the printer waiting.
After ^XZ, the printer returns to its idle state, ready to accept the next label format. Any persistent settings (^PW, ^LH, etc.) that were set inside the format remain in effect for subsequent formats unless explicitly overridden.
Syntax
^XZ
Examples
Complete label with start and end
Try in Viewer^XA ^FO50,50^A0N,36,36^FDShip To: Warehouse A^FS ^FO50,100^A0N,28,28^FDOrder #98765^FS ^XZ
Print five copies using ^PQ before ^XZ
Try in Viewer^XA ^FO50,50^A0N,36,36^FDQty Label^FS ^FO50,100^BY2,3,80^BCN,80,Y,N,N^FDQTY-001^FS ^PQ5,0,1,Y ^XZ
Common Mistakes
- !Forgetting ^XZ at the end of the format — the printer buffers the format and prints nothing.
- !Adding extra content after ^XZ but before the next ^XA — this content is often silently dropped.
- !Sending multiple ^XZ commands without matching ^XA — this can corrupt the printer's format buffer state.