← Guides & articles
ED
Eduard Diaz
IT technician at S-IE, an official Zebra partner · Updated

What is ZPL? A beginner's guide to Zebra Programming Language

You download a shipping label and see ^XA and ^FO instead of a picture. That is ZPL: instructions a compatible label printer turns into text, barcodes and graphics. You can read and preview those instructions before sending anything to a printer.

A laptop with ZPL instructions beside a generic label printer producing a Hello label.
AI-generated conceptual illustration: commands become a printed label; this is not a specific printer model.

What is ZPL?

ZPL stands for Zebra Programming Language, a command language developed by Zebra for label printers. Today, ZPL usually refers to ZPL II, the later version documented in current printer manuals. It describes where to place text, which barcode to draw and how to add images; applications use it for shipping, product and inventory labels.

With the default prefixes, format commands begin with ^ and control commands with ~. A label format starts with ^XA and ends with ^XZ. These are printer instructions, not a PDF or a photograph: a renderer or compatible printer interprets them to create the label.

What does ZPL look like?

This minimal example places the word Hello on a label. Copy only the code block into the viewer; the explanations below are separate so the example stays ready to use.

^XA
^FO50,50
^A0N,40,40
^FDHello^FS
^XZ
What does ZPL look like?
CommandWhat it does
^XAStarts a new label format.
^FO50,50Sets the field origin to x = 50, y = 50 dots, relative to the label home position.
^A0N,40,40Selects font 0, normal orientation (N), with requested height and width of 40 dots. This is not 40-point text.
^FDHello^FS^FD supplies the text Hello; ^FS ends that field.
^XZEnds the label format. In this simple job, the printer can then produce the label.

Open the ZPL viewer

Positions and font dimensions here are in dots, not millimeters. At 203 DPI, 50 dots are about 6.3 mm; at 300 DPI, about 4.2 mm. This example assumes the usual origin and orientation and does not set label dimensions, media sensing or calibration. Choose the actual label size and DPI in the viewer and configure the printer separately.

What is a .zpl file?

A typical .zpl file is a plain-text file containing these commands, sometimes with several label formats in one file. The extension tells you its intended use; it does not turn the file into an image. You can open it in Notepad, VS Code or another text editor to read the instructions.

To see the label rather than the source, open the file in a ZPL viewer. Save edits as plain text, not as a Word document. Renaming a PDF to .zpl does not convert it. Some ZPL data streams contain binary graphic or font payloads, so not every printer job is entirely readable text.

How to open a .zpl file

What can you do with ZPL?

Start with the example above, then use the tool that matches your next step. A preview helps you check the layout; physical printing also requires a compatible printer, the right media and a working connection.

View a label

Open a .zpl file or paste code to see its layout without a physical printer.

Open the ZPL viewer

Edit the design

Adjust text, positions and sizes in the editor, then review the result.

Open the ZPL editor

Export to PDF

Convert a label into a PDF for sharing or a document-based print workflow.

Convert ZPL to PDF

Add a logo

Turn an image into ZPL graphic data and insert it in your label.

Convert an image to ZPL

For logos, ^GFA is the ^GF graphic-field command with A selecting ASCII hexadecimal data. It is followed by byte counts, bytes per row and encoded image data, not a PNG filename. The image converter prepares a monochrome graphic for you. ^BC produces Code 128 barcodes; ^BQ produces QR codes.

A leaf image becomes graphic instructions marked ^GFA and then appears on a label.
AI-generated illustration of image-to-ZPL conversion. The graphic data is represented conceptually.

Print the label

Send the ZPL as raw instructions through software or a utility that supports your printer, such as Zebra Setup Utilities for compatible models. Printing the source from a text editor may print the code itself. Check the printer language, label dimensions and DPI, then test one label before a batch. A browser preview does not establish a printer connection.

Why the printer prints code or garbled text

ZPL vs other printer languages

EPL and TSPL are other label-printer command languages with different syntax. A device may support more than one language through firmware or emulation, but changing a filename does not translate the commands. Compare ZPL and EPL before reusing a template on a different printer.

ZPL vs EPL: syntax and compatibility

Frequently asked questions

Is ZPL free or open source?

You can write a ZPL label with a plain-text editor and read Zebra’s publicly available command documentation. That does not make ZPL an open-source software project. Editors, converters, fonts and printer software have their own licenses and may be free or paid.

Do I need a Zebra printer?

No printer is needed to read, edit or preview ZPL. For direct physical printing, use a Zebra or another device that explicitly supports the required ZPL commands. Emulation support varies by model and firmware. A PDF export can be printed through a PDF workflow instead.

How do I open a .zpl file?

Use a text editor to read its commands, or open it in the ZPL viewer to render the label. Select the intended label size and DPI for a meaningful preview.

What is the difference between ZPL and ZPL II?

ZPL II is the later version of Zebra’s original ZPL language. People commonly shorten ZPL II to ZPL. For new templates, follow the ZPL II documentation supported by your model; do not assume every old command or printer mode behaves identically.

Official references

ED

About the author

Eduard Diaz

Eduard Diaz is an IT technician (development) at S-IE, an official Zebra partner with more than 20 years providing identification and labelling services. He builds and maintains EditorZPL to make working with ZPL and Zebra label printers easier.

s-ie.cat

Related tools