Launch

30% off your first month of Pro30% off month one$9.90 → $6.93

See plans
ZPL em PDF

Command · ^XA

^XA and ^XZ: where a label starts and ends

If you opened a label file and the first thing in it was ^XA, you found the beginning. ^XA opens a label, ^XZ closes it and prints, and everything between them is one label — exactly one. It is the pair that explains why a single .txt holds a whole day of orders.

Checked on September 1, 2026

One pair, one label

^XA takes no parameters at all: two characters and that is the whole command. The same goes for ^XZ. What they delimit is a complete label format, and the printer only starts drawing when it receives the ^XZ — until then it is accumulating instructions.

So a file with fifty ^XA…^XZ pairs is fifty labels, one after another. There is no “next label” command: the next ^XA is the next-label command.

  • ^XA — opens the format. No parameters.
  • ^XZ — closes the format and prints. No parameters.
  • ^PQ — inside the pair, sets how many copies of that label to print.
  • A missing final ^XZ still renders here, but a printer would sit waiting for it.

Why you got fewer pages than ^XA blocks

A block that draws nothing is printer housekeeping, not a label. ^XA^MCY^XZ clears the bitmap; ^XA^IDR:FILE.GRF^FS^XZ deletes a file from memory. Neither produces an image, and turning them into blank pages would make a fifty-label file into a hundred pages, half of them empty.

So those blocks are dropped on purpose. A block that tried to draw is kept even if it comes out blank — the distinction is whether it tried, not what it produced.

What usually comes right after ^XA

The commands that apply to the whole label sit at the top, because they affect everything after them: ^PW and ^LL set the size, ^CI28 sets the character encoding, ^LH moves the origin, ^BY sets the barcode defaults.

If accented characters are coming out wrong, this is where something is missing: a ^CI28 straight after ^XA fixes it, and placing it halfway down only affects the fields from there on.

Drop a file with many ^XA blocks and page through the labels

Drag the file in, paste the code, or pick it from your device

.txt · .zpl · .prn · .zip · .pdf · .png · .jpg — 30 labels a day

The conversion happens in your browser: your file never leaves your device.How that works
Free, no signupNo uploadNo watermarkBatches of many filesPDF · PNG · ZIP

Questions

Frequently asked questions

What does ^XA mean in ZPL?

^XA opens a label — it is the start of the format. Everything up to the matching ^XZ describes one printed label. A file containing fifty ^XA blocks is fifty labels.

Does ^XA take parameters?

None at all. It is two characters after the caret and nothing else. The same is true of ^XZ, which closes the format and triggers the print.

My file has 50 ^XA blocks but produced 47 pages. Why?

Some blocks draw nothing — they are printer housekeeping, like ^XA^MCY^XZ, which clears the bitmap. Those are dropped on purpose, so the file does not become a run of blank pages interleaved with real ones.

What happens if the final ^XZ is missing?

Here, the last label still renders. On a real printer it would sit waiting for the end of the format and never print that one — it is one of the causes of the last label in a batch not coming out.

Other guides