Barcodes
Barcodes in ZPL – 1D and 2D Symbologies
ZPL renders barcodes natively on the printer – no images required. The two most important commands are ^B barcode type and ^FD data . Barcode paramet…
ZPL renders barcodes natively on the printer – no images required. The two most important commands are ^B* (barcode type) and ^FD (data). Barcode parameters (orientation, height, interpretation line) are set directly on the ^B command.
Linear barcodes (1D)
^XA
^FO50,50^BY2,2,80^BCN,80,Y,N,N^FD4006381333931^FS
^XZ
^BY2,2,80– barcode defaults: module width 2 dots, wide/narrow ratio 2, height 80 dots^BCN,80,Y,N,N– Code 128, normal orientation, height 80, print interpretation line (Y), none above (N), no UCC check digit (N)
Common symbologies:
| Symbology | Command | Example data |
|---|---|---|
| Code 128 | ^BC | ^BCN,80,Y,N,N |
| Code 39 | ^B3 | ^B3N,N,80,Y,N |
| Code 93 | ^BA | ^BAN,80,Y,N,N |
| Codabar | ^BK | ^BKN,N,80,Y,N,A,B |
| GS1-128 (EAN-128) | ^BC with >;>8 | ^BCN,80,Y,N,N |
| Industrial 2 of 5 | ^BI | ^BIN,80,Y,N |
| Interleaved 2 of 5 | ^B2 | ^B2N,80,Y,N,N |
| MSI | ^BM | ^BMN,B,80,Y,N |
| Plessey | ^BP | ^BPN,N,80,Y,N |
| EAN-13 | ^BE | ^BEN,80,Y,N |
| EAN-8 | ^B8 | ^B8N,80,Y,N |
| UPC-A | ^BU | ^BUN,80,Y,N |
| UPC-E | ^B9 | ^B9N,80,Y,N,N |
| POSTNET | ^BZ | ^BZN,80,N,N |
| PLANET | ^B5 | ^B5N,80,N,N |
| PDF417 | ^B7 | ^B7N,80,5,5 |
2D barcodes
^XA
^FO50,50^BQN,2,8^FDMA,https://example.com^FS
^XZ
^BQN,2,8– QR Code, normal orientation, model 2, magnification 8^FDMA,– prefix of error correction (H/Q/M/L) and input mode (A = automatic, M = manual):MA= error correction M, automatic input. Data follows after the comma.
More 2D: Data Matrix ^BX, Aztec ^B0/^BO, MicroPDF417 ^BF, MaxiCode ^BD.
GS1-128 (EAN-128) uses ^BC with >;>8 (subset C plus FNC1) before the data:
^BCN,80,Y,N,N^FD>;>80104006381333931^FS
Barcode settings in the designer
Every barcode element in the zplCloud designer offers, under Text, Bars, Quiet zone and
Symbology options, exactly the settings the selected code type supports: position and size of the
human readable text including its gap to the bars, narrow bar width, bar height and ratio, check
digits, bearer bars, EAN/UPC add-ons, QR error correction, Data Matrix format, PDF417 columns and
rows, Aztec error correction and more. An empty field means "automatic" - the renderer then fits the
code to the field as before.
A few settings cannot be expressed by a resident ZPL command (marked with * in the designer). They
still print: the element is drawn as a graphic instead of a ^B command so that preview and print
match.
Tips
- Module width (first
^BYparameter) is the most common scan-quality issue: 1 dot is too thin for many media types; 2–3 are typical. - EAN/UPC data is fixed length – the printer adds check digits automatically.
- Keep the quiet zone (white space) around the barcode: at least 10× module width.