What Is a ZPL File?

A ZPL file is a label for a Zebra printer, written as text commands in the Zebra Programming Language. This guide covers what is inside one, how to open it and see the label, how to print it with or without a Zebra printer, and how ZPL differs from ZPL II and EPL.

Updated

Open the ZPL viewer

What ZPL is

ZPL, the Zebra Programming Language, is the language Zebra label printers read. A label is described in text commands: where each field goes, which font and size it uses, what text or barcode data it holds, and which lines, boxes and pictures it has. Zebra calls ZPL II a label-definition and printer-control language. The printer reads the commands and prints the label when the label's last command arrives.

Labels are usually written by software rather than by hand: Zebra's guide mentions label preparation systems and software packages that generate ZPL II code. So if a system gave you a ZPL file where you expected a picture, the file holds the label's instructions, and a printer or a viewer turns them into the label.

ZPL is current. Zebra published a new revision of its ZPL II programming guide in July 2026, and the spec sheet of its ZD421 desktop printer calls ZPL II the "universal language for Zebra printers".

What is inside a ZPL file

Open a ZPL file in a text editor and you see commands. Each one is a caret (^) or a tilde (~), a short code, usually two characters, and, where the command needs them, its values. Caret commands, which Zebra calls format commands, describe the label. Tilde commands, control commands, make the printer act at once, such as clearing its memory or feeding a blank label.

This is a whole label: ^XA^FO50,50^A0N,50,50^FDHello^FS^XZ

^XA starts the label. ^FO50,50 puts the next field 50 dots from the left and 50 from the top. ^A0N,50,50 chooses font 0, upright, 50 dots high and 50 wide. ^FD holds the text, ^FS ends the field, and ^XZ ends the label, which is when the printer prints it. A file can hold many labels, one after another. These are the commands you will meet most:

CommandWhat it does
^XAStarts a label
^XZEnds the label; the printer prints it when this arrives
^FOSets where a field starts, in dots from the label home, the top left corner unless ^LH moves it
^FTSets a field's position like ^FO, but from a point fixed to the field's contents that does not change with rotation
^AChooses the font, direction and size for the next field
^CFSets the default font for the fields after it
^FDThe field's data: the text to print, or the data of a barcode
^FSEnds a field
^FBWraps a field's text in a block of a set width and number of lines
^GBDraws a box or a line
^GFA picture, as dots in hexadecimal, binary or compressed form
^BYSets the narrow bar width, the wide-to-narrow ratio and the height for the barcodes after it
^BC, ^BE, ^BQ, ^BXBarcodes: Code 128, EAN-13, QR code and Data Matrix
^PW, ^LLThe print width and the label length, in dots
^PQHow many copies to print
^CIThe character set, such as ^CI28 for UTF-8
^FXA comment, which does not print

Every size is in dots, so the same file prints at a different size on printers of different density: 50 dots is about a quarter of an inch at 203 dpi and a sixth of an inch at 300 dpi. The ZPL examples show these commands in whole labels, and ZPL fonts lists each font's size.

How to open a ZPL file and see the label

A ZPL file is plain text, so any text editor opens it and shows the code; Zebra's own documentation uses Windows Notepad to write ZPL files. The file may end in .zpl, .txt, .prn or .lbl, but a text editor shows only the commands, not the label. To see the label without printing it:

  1. Open the ZPL viewer and drop the file on it, press Open file, or paste the text.
  2. Choose the print density of the printer the label is for. The viewer starts at 8 dpmm (203 dpi); Zebra's guide says a printer's density is listed on its configuration label.
  3. Choose the label size, or the size the ZPL sets, when the viewer offers it.
  4. Read the line under the preview: it gives the label's size in dots and lists any command that was not drawn.

A file named .prn is not always ZPL. If it holds no ^XA label, the viewer says "No label found. Start a label with ^XA."

On a Mac

Zebra's user guides describe sending files to a printer from Microsoft Windows, and say that other operating systems need commands from their own documentation. On a Mac, the viewer and its PDF need nothing installed: open the label in your browser, download the PDF, and print it from Preview, the Mac's own app for PDFs. Apple's steps:

  1. Open the PDF in Preview.
  2. Choose File > Print.
  3. In the Preview section of the print dialog, select Scale and enter 100.
  4. Choose the printer and print.

Do not choose Scale to Fit, which Apple describes as filling as much of the paper as possible: it changes the size of the label and its barcodes.

ZPL and ZPL II

ZPL II is the version of ZPL that Zebra printers use unless told otherwise. The ^SZ command switches a printer between ZPL (^SZ1) and ZPL II (^SZ2), and its default is ZPL II.

Zebra's 2005 ZPL II guide lists the main differences: ZPL II formats each field as it is received, while standard ZPL waits for ^XZ before it processes the fields, which lets ZPL II start printing sooner; and ZPL II added many new commands. It says ZPL II scripts are not 100 percent compatible with standard ZPL, but that most standard ZPL scripts can be changed easily.

ZPL and EPL

EPL, the Eltron Programming Language, is another label printer language. Zebra printers such as the ZD421 accept it beside ZPL: the ZD421 spec sheet lists "ZPL II and EPL2 programming languages" and says EPL2 gives compatibility with legacy applications. The two have different commands and fonts. Zebra's user guides note that ZPL can use both ZPL and EPL fonts while EPL can use only its own, and that on its G-Series printers, EPL and ZPL must be sent as separate files and cannot be used together in one format.

This viewer draws ZPL only. An EPL file has no ^XA label in it, so the viewer says "No label found. Start a label with ^XA."

Frequently asked questions

How do I open a ZPL file on Windows?

Open it in Notepad to read the code, or in the ZPL viewer to see the label it describes.

What is the difference between ZPL and ZPL II?

ZPL II is the later version, and the default on Zebra printers. It formats fields as they arrive instead of waiting for the end of the label, and adds many commands.

What is the difference between EPL and ZPL?

They are two printer languages with their own commands and fonts. Zebra's spec sheets describe EPL2 as giving compatibility with legacy applications, and ZPL II as the universal language for Zebra printers.

Do all Zebra printers support ZPL?

Each model's spec sheet lists the languages it accepts: the ZD421's, for example, lists ZPL II and EPL2. Check yours before you send it a ZPL file.

Can I convert a ZPL file to PDF?

Yes, in your browser: the ZPL to PDF converter makes one page per label at the label's real size.