How to Create ZPL Labels
Complete tutorial for creating professional labels with Zebra Programming Language
Introduction to ZPL
ZPL (Zebra Programming Language) is the standard language for programming Zebra thermal printers. In this tutorial, you will learn the basic concepts to create your own labels from scratch.
1Basic structure of a ZPL label
Every ZPL label starts with ^XA (start format) and ends with ^XZ (end format). Between these commands, all label elements are defined.
^XA ^FO50,50^A0N,30,30^FDHello World^FS ^XZ
2Positioning with ^FO
The ^FO (Field Origin) command defines the X,Y position where the next element will be placed. Coordinates are measured in dots from the top-left corner.
^XA ^FO100,100^A0N,40,40^FDText at position 100,100^FS ^FO200,200^A0N,40,40^FDText at position 200,200^FS ^XZ
3Adding text with fonts
The ^A command defines the font to use. Parameters include: font type, orientation (N=normal, R=rotated 90°, I=inverted, B=rotated 270°), and size.
^XA ^FO50,50^A0N,50,50^FDLarge Text^FS ^FO50,120^A0N,25,25^FDSmall Text^FS ^XZ
4Basic barcodes
ZPL supports multiple barcode types. The ^BC command creates a Code 128, one of the most commonly used. Parameters control orientation, height, and whether to show interpretation.
^XA ^FO50,50^BCN,100,Y,N,N^FD123456789^FS ^XZ
5QR Codes
The ^BQ command creates QR codes. It's ideal for storing URLs, product information, or tracking data.
^XA ^FO50,50^BQN,2,5^FDMM,Ahttps://zplpdf.com^FS ^XZ
Tips for creating ZPL labels
- Always test your labels in a ZPL viewer before printing
- Use the ^PQ command to define the number of copies to print
- Calculate coordinates carefully based on your label size
- Save reusable templates for different label types
- Verify your ZPL code is valid with our validator
Test your ZPL code now
Use our ZPL viewer to see how your label will look before printing.