تخطي إلى المحتوى

What is ZPL?

ZPL (Zebra Programming Language) is the text command language that Zebra and compatible thermal printers use to draw labels. A ZPL label is plain text: commands that start with ^ or ~ place text, barcodes, lines and images at positions measured in printer dots.

تم التحديث في 2026-10-20 · Renders made with the OpenZPL engine

Open in the viewer

A complete label in eight lines

This is a whole label, with the picture the printer would print:

A simple ZPL label: a border, the title Hello, ZPL, a line of text and a Code 128 barcode
4 × 2 in label at 203 dpi (8 dpmm) · 812 × 406 px · Open in the viewer
^XA
^FX A comment: a box, two lines of text and a barcode
^FO20,20^GB772,366,3^FS
^FO50,50^A0N,50,50^FDHello, ZPL^FS
^FO50,115^A0N,28,28^FDEach FO command places the next field^FS
^BY2,3,120
^FO50,180^BCN,120,Y,N,N^FDZPL-101^FS
^XZ
  • ^XA opens the label and ^XZ closes it. Everything in between is one label.
  • ^FX is a comment; the printer skips it.
  • ^FOx,y sets where the next field starts, in dots from the top-left corner (the field origin).
  • ^GB draws a box, ^A0 picks the font and its size, ^BC a Code 128 barcode and ^BY the bar width.
  • ^FD holds the data and ^FS ends the field.

Dots, not millimetres

Positions and sizes are in printer dots. How big a dot is depends on the printer: 8 dots per millimetre on a 203 dpi printer, 12 on a 300 dpi one. The same ZPL therefore prints smaller on a 300 dpi printer, which is the most common surprise when a label moves between printers; see 203 vs 300 dpi and dpmm.

Where ZPL comes from and who uses it

ZPL was created by Zebra Technologies; the current version is ZPL II, documented in the Zebra ZPL II Programming Guide. Many other thermal printer makers accept it too, which is why shipping carriers, marketplaces and warehouse systems hand out labels as ZPL: the same text prints on most label printers in a warehouse.

A ZPL file usually has the extension .zpl, .txt or .prn. It is sent to the printer as is, over USB, the network (often TCP port 9100) or a print queue; the printer interprets it, so the computer needs no driver to lay out the label.

ZPL and EPL

EPL is an older, simpler Zebra language with commands like A and B at the start of a line instead of ^ prefixes. Most current Zebra printers read both. If a file starts with ^XA, it's ZPL.

How to see a ZPL label without a printer

Paste the ZPL in the ZPL viewer: it draws the label as you type and exports it to PDF or PNG. From code, the OpenZPL API does the same over HTTP. Both run the same engine, which emulates a printer: check what it supports and confirm critical labels on the printer itself.

The commands you'll meet first

Commandماذا يفعل
^XA / ^XZStart and end a label
^FOPosition of the next field
^A0Scalable font and its height and width in dots
^FD / ^FSField data and end of field
^GBBox or line
^BC, ^BQCode 128 barcode, QR code
^CI28Read the data as UTF-8
^PW / ^LLLabel width and length in dots

The ZPL command reference has every command with its parameters and a live example.

أسئلة

What does ZPL stand for?

Zebra Programming Language. The current version is called ZPL II.

Is ZPL only for Zebra printers?

No. Many thermal printers from other makers accept ZPL, though support for less common commands varies.

Can I open a ZPL file without a printer?

Yes. Paste it in the ZPL viewer or convert it to PDF.

Sources