ZPL Barcode Commands

ZPL can print 1D and 2D barcodes directly — no image needed. You set the bar code defaults with ^BY, pick a symbology command (^BC, ^BQ, ^BX, and others), and supply the data with ^FD…^FS. Below: the commands, copy-paste examples, and a live renderer.

Barcode example

Ready.

Label preview

Rendered label preview

ZPL barcode commands

CommandSymbologyTypeExample
^BCCode 1281D^BCN,100,Y,N,N
^B3Code 391D^B3N,N,100,Y,N
^BEEAN-131D^BEN,100,Y,N
^BQQR Code2D^BQN,2,6 + ^FDLA,…
^BXData Matrix2D^BXN,5,200
^BYBar code defaultsmodifier^BY3,3,100

Examples

Code 128 with a human-readable line:

^XA
^FO50,50^BY3^BCN,100,Y,N,N^FD123456789^FS
^XZ

QR Code (error-correction level + data after ^FD):

^XA
^FO50,50^BQN,2,6^FDLA,https://coolconversion.com/zpl/barcode/^FS
^XZ

Data Matrix:

^XA
^FO50,50^BXN,7,200^FDHELLO WORLD^FS
^XZ

Related ZPL tools

What Is ZPL?

Zebra Programming Language explained: syntax, essential commands, and a minimal label example.

ZPL Viewer

Paste or upload ZPL and preview the rendered label online in real time.

ZPL to PDF

Convert Zebra ZPL labels to PDF or PNG and download them in one click.

ZPL Fonts

Built-in fonts A–H and the scalable font 0, with the ^A and ^CF commands.

Frequently Asked Questions

How do I create a Code 128 barcode in ZPL?

Use ^BC with a ^BY module width, then the data. Example: ^XA ^FO50,50 ^BY3 ^BCN,100,Y,N,N ^FD123456789^FS ^XZ. The Y prints the human-readable interpretation line under the bars.

How do I make a QR code in ZPL?

Use ^BQ. The field data is prefixed with the error-correction level and input mode, e.g. ^FO50,50 ^BQN,2,6 ^FDLA,https://example.com^FS. Here 2 is the QR model and 6 is the magnification.

How do I create a Data Matrix barcode in ZPL?

Use ^BX: ^FO50,50 ^BXN,5,200 ^FDHELLO^FS, where 5 is the module size and 200 the quality/ECC level. Data Matrix is a compact 2D symbology good for small items.

What does the ^BY command do?

^BY sets bar code field defaults before the barcode command: module (narrow bar) width in dots, the wide-to-narrow ratio, and the default height. Example: ^BY3,3,100. It affects the barcode commands that follow it.

Why is my ZPL barcode not scanning?

Usual causes: the module width (^BY) is too small for the print density, the barcode runs off the label edge, or the data is invalid for that symbology (e.g. non-numeric data in EAN-13). Increase ^BY, check the ^FO position, and verify the data, then re-render.