Published: · Updated:
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.
The printer decides, not taste. A Zebra prints ZPL and nothing else; a TSC, an HPRT, or one of the many TSC-compatible clones prints TSPL natively. You do not pick a language and then look for a printer — you read the model number and the language follows. The one exception worth checking is TSC's ZPL emulation: many TSC models accept a ZPL stream when switched to that mode, so an existing ZPL label base can often stay as it is. Whether a given model offers it, and how the switch is made, is in the ZPL on TSC printers guide.
Two rules save the most time. First, do not mix: a job is either a
^XA…^XZ block or a CLS…PRINT sequence, and a
printer that receives the other one prints it as text or discards it.
Second, keep one source of truth per fleet — if half the printers are Zebra
and half are TSC, generate both outputs from the same template geometry in
millimetres rather than maintaining two hand-edited files. The
TSPL hub collects the command reference and the TSPL
viewer; the ^PW and
^LL pages explain the dot-based label size
that the port has to translate into SIZE. If your other
printer language is EPL rather than ZPL, the
TSPL vs EPL guide covers that pair.
^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).The same job in three dialects. Positions and sizes are not interchangeable — ZPL and EPL count dots, TSPL sizes the label in millimetres or inches — so use the table to find the command, then re-measure.
| Concept | ZPL | TSPL | EPL |
|---|---|---|---|
| Start / end a label | ^XA … ^XZ | CLS | N |
| Label width | ^PW | SIZE | q |
| Label length | ^LL | SIZE | Q |
| Gap between labels | ^MN | GAP | Q |
| Black-mark media | ^MNM | BLINE* | — no native command |
| Origin offset | ^LH | REFERENCE | R |
| Text field | ^FO + ^A + ^FD | TEXT | A |
| Linear barcode | ^BY + ^BC | BARCODE | B |
| QR code | ^BQ | QRCODE | — no native command |
| Box | ^GB | BOX | X |
| Filled line | ^GB | BAR | LO |
| Copies | ^PQ | PRINT | P |
| Print orientation | ^PO | DIRECTION* | ZT* / ZB* |
| Darkness | ^MD | DENSITY* | D* |
| Print speed | ^PR | SPEED* | S* |
| Character set | ^CI | CODEPAGE* | I* |
* Parsed but not drawn by the Labelixa preview for that language — the printer still applies it.
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.
Use the language your printer speaks natively: Zebra printers take ZPL, TSC and TSC-compatible printers take TSPL. Many TSC models also offer a ZPL emulation mode, so an existing ZPL label base can often be kept; check the model's manual. Never mix the two in one job.
Which to use: ZPL unless the printer is a CPCL mobile unit. Side-by-side command table, how to check and switch the printer language, and how to port a label.
Arabic text prints reversed or broken in CPCLArabic or Hebrew sent with CPCL TEXT can print reversed or with disconnected letters. Why it happens and three ways to print right-to-left text.
TSPL vs EPL: migrating off a legacy fleetMoving from EPL printers to TSC hardware: what the two languages share, what has no counterpart, and how to test the migration.
Previewing and debugging CPCL without a printerMobile printer labels rendered in the browser: the session header that controls everything, the findings that matter, and what is not drawn.