What is ZPL?
ZPL (Zebra Programming Language) is the command language of Zebra thermal printers — and, through de-facto standardization, of most barcode label printing on earth. Every UPS package, hospital wristband, warehouse bin tag and grocery shelf label you've seen was very likely produced by a block of ZPL like this:
^XA
^FO50,50^A0N,45,45^FDHello, warehouse^FS
^FO50,120^BY3^BCN,120,Y,N,N^FD0012345678^FS
^XZ
Paste that into a ZPL viewer to see it render. Reading it:
| Command | Meaning |
|---|---|
| ^XA / ^XZ | Start / end of a label format |
| ^FO50,50 | Field Origin — position the next field at x=50, y=50 dots |
| ^A0N,45,45 | Font 0 (scalable), Normal rotation, 45×45 dots tall/wide |
| ^FD…^FS | Field Data … Field Separator — the actual content |
| ^BY3 | Barcode defaults: module (narrow bar) width of 3 dots |
| ^BCN,120,Y,N,N | Code 128 barcode, No rotation, 120 dots tall, print interpretation line |
Three things make ZPL feel alien to modern developers:
- Coordinates are physical dots, and printers come in different densities (6/8/12/24 dots per mm — 152/203/300/600 dpi). The same ZPL prints at different physical sizes on different printers.
- It's a wire format, not a file format. ZPL is sent raw to TCP port 9100 (or USB,
or serial) — no driver, no spooler, no acknowledgment by default.
cat label.zpl | nc printer 9100is a complete print job. - There is no preview. The printer is the only reference implementation, and it costs a label every time you look.
The commands you'll actually meet
- Text:
^A(font/size),^FB(text block with wrapping/alignment),^FD(data) - Barcodes:
^BC(Code 128),^BQ(QR),^B3(Code 39),^BE(EAN-13),^BXN(Data Matrix),^B7(PDF417),^BD(MaxiCode — the UPS dot hexagon) - Graphics:
^GB(box/line),^GC(circle),^GF(bitmap — how images and logos get onto labels; usually with Zebra's ACS run-length compression) - Printer state:
^PW(print width),^LL(label length),^PQ(quantity),~HS(host status query — returns fault flags over the same socket) - Variables:
^DF/^XFstore and recall a template;^FNmarks the slots
Where ZPL comes from — and why it won't die
Zebra introduced ZPL in the 1980s and ZPL II in the 1990s; the installed base is so large that competitors (Honeywell, Datamax, TSC, Godex) ship ZPL emulation modes rather than fight it. Carrier APIs (UPS, FedEx, USPS, EasyPost, Shippo) offer labels as ZPL directly because warehouses print them straight to the socket. It is, in effect, the PostScript of logistics — except PostScript got PDF, previews and tooling, and ZPL got nothing.
The modern toolchain
That tooling gap is closing. Today you can:
- Preview ZPL pixel-true in the browser or via API instead of burning labels
- Convert PDFs and images to ZPL (free tool) instead of hand-porting carrier labels
- Design labels in HTML/CSS and compile to ZPL — barcodes
declared as elements and emitted as native
^BC/^BQfields - Decompile legacy ZPL to editable HTML — the reverse direction, for the template nobody at your company can read anymore
- Test label printing without hardware against
virtual Zebra printers that speak TCP 9100 and
~HSlike real firmware, including in CI
FAQ
Is ZPL the same as EPL?
No. EPL (Eltron Programming Language) is the older, simpler language of Eltron printers Zebra acquired; many desktop Zebras accept both. New integrations should target ZPL II — it's what carriers emit and what every printer made this century speaks.
How do I print a ZPL file?
Send the raw bytes to the printer, port 9100: cat label.zpl | nc 192.168.1.50 9100
on Linux/macOS, or Get-Content label.zpl -Raw | Out-Printer alternatives on Windows —
or better, open a TCP socket from your application. No driver needed.
How do I view a ZPL file?
Use a ZPL viewer — paste the ZPL, pick the label size and density, and you get the exact raster the printhead would produce.
What does a ZPL file extension look like?
There's no standard — you'll see .zpl, .txt, .prn and raw strings in databases.
It's plain ASCII (with escaped binary in ^GF graphics), so treat it as text.
Published 2026-08-24 · Ben Faerber — software engineer, five years building warehouse fulfillment and label-printing systems; maintainer of pdf-to-zpl (26,000+ installs powering production label generation).