Published:
ZPL (Zebra) and TSPL (TSC and compatibles) solve the same problem — describe a label to a thermal printer — and look superficially alike: coordinates, fonts, barcodes, a print command. The differences that cost you an afternoon are not stylistic; they are in units, job structure and how each language names the same object.
ZPL is dots, always. ^PW812 is 812 dots, which is 4 inches
at 203 dpi and 2.7 inches at 300 dpi — the same file means a different
physical size on a different printer.
TSPL takes real units at the top: SIZE 100 mm, 150 mm is
millimetres, and an unitless SIZE 4, 6 means inches. Inside the
label, coordinates are still dots. So a TSPL job declares its physical size
and positions in dots, while a ZPL job expresses both in dots and leaves the
physical size implicit in the media.
Porting a layout by copying coordinates therefore works only when both printers run the same density. Convert the geometry, not the numbers.
| Concept | ZPL | TSPL |
|---|---|---|
| Job boundaries | ^XA … ^XZ |
CLS … PRINT 1 |
| Label size | ^PW812, ^LL1218
(dots) | SIZE 100 mm, 150 mm (real units) |
| Media gap | Printer-side setting | GAP 3 mm, 0 mm in the job |
| Text | ^FO100,100^A0N,40,40^FDHELLO^FS |
TEXT 100, 100, "3", 0, 1, 1, "HELLO" |
| Barcode | ^BY3^FO100,200^BCN,100,Y,N,N^FD123456^FS
| BARCODE 100, 200, "128", 100, 1, 0, 3, 3, "123456" |
| QR code | ^FO100,400^BQN,2,6^FDQA,https://…^FS |
QRCODE 100, 400, M, 6, A, 0, "https://…" |
| Box / line | ^GB700,400,4^FS |
BOX 40, 40, 760, 400, 4 / BAR x, y, w, h |
| Copies | ^PQ3 | second argument of
PRINT 1, 3 |
Two structural notes fall out of the table. TSPL commands are
line-oriented with comma-separated arguments and quoted strings; ZPL is a
caret-prefixed stream where a field ends at ^FS. And TSPL puts
media handling (SIZE, GAP) inside the job, where
ZPL mostly leaves it to the printer's configuration.
^FS has no TSPL equivalent — a TSPL line is complete in
itself. Porting the other way, a missing ^FS silently swallows
the following commands into the previous field's data.^BC, ^BE,
^B3).Both languages are rendered by separate engines here, and each has a
documented scope. On the TSPL side, geometry and content commands draw —
SIZE, GAP, CLS, TEXT,
BARCODE, QRCODE, BOX,
BAR, REFERENCE, PRINT — while
printer-behaviour commands are recognised but deliberately not drawn:
DIRECTION, OFFSET, BLINE,
DENSITY, SPEED, SET and
CODEPAGE change physical output a screen cannot reproduce.
The TSPL barcode set covers Code 128, Code 39, EAN-13 and UPC-A.
Paste either language into its viewer to see this in practice: the ZPL viewer or the TSPL viewer. If you are not sure which language a file is written in, the language detector classifies it from the code itself.
Units and job structure. ZPL expresses everything in dots (^PW812 is 812 dots), while TSPL declares the physical label in real units (SIZE 100 mm, 150 mm) and positions in dots. A ZPL job runs from ^XA to ^XZ; a TSPL job clears the buffer with CLS and commits it with PRINT.
Only when both printers run the same resolution. Dot coordinates carry no physical size, so a 203 dpi layout lands at roughly two-thirds scale on a 300 dpi head. Recompute the geometry from millimetres instead.
ZPL is the language Zebra thermal printers understand. How to read the commands, how a label is put together, and the most common mistakes.
Which barcode symbology should I use?EAN-13, Code 128 or QR? Practical rules for picking a barcode based on your data, your space and the scanner that has to read it.
How to preview a ZPL file without a printerA ZPL file is just text — the label only exists once something draws it. Three practical ways to see a ZPL label before it reaches the printer.