What Is ZPL?
ZPL stands for Zebra Programming Language. It is a text-based printer language used to describe thermal labels, including where text appears, which barcodes are generated, where graphics are placed, how large the label is, and how the printer should process the format.
ZPL is a printer command language originally developed for Zebra label printers. Instead of sending a completed picture of a label, a system can send instructions such as "place this text at these coordinates," "encode this value as Code 128," or "draw this box at this location."
ZPL is widely encountered in warehouse, manufacturing, shipping, inventory, retail, healthcare, ERP, and WMS environments where thermal barcode labels need to be generated quickly and consistently.
How does ZPL work?
A ZPL label is generally a plain-text sequence of printer commands and data. The application creating the label determines what should appear, inserts the appropriate values, and sends the resulting ZPL to a compatible printer or print service.
A receiving, picking, production, packing, inventory, or shipping process requires a label.
Item, lot, serial, location, license plate, shipment, quantity, and other values are collected.
The variable data is combined with commands that control the label's text, barcode, graphics, and layout.
The printer interprets the ZPL commands and produces the physical thermal label.
This approach makes ZPL useful for labels that change from transaction to transaction. The layout can remain mostly consistent while values such as an item number, quantity, serial number, or destination change dynamically.
A simple ZPL label explained
^XA
^PW812
^LL406
^FO50,40
^A0N,36,36
^FDPrint Envoy^FS
^FO50,120
^BY3
^BCN,100,Y,N,N
^FDPE-10001^FS
^XZ
What can ZPL put on a label?
Text
ZPL can print static text and variable data such as item descriptions, order numbers, quantities, locations, lot numbers, serial numbers, dates, and shipping information.
Common commands include ^A, ^A0, ^CF, ^FD, ^FB, and ^FS.
1D barcodes
ZPL supports multiple linear barcode types. Code 128 and Code 39 are frequently encountered in warehouse and inventory environments.
Common commands include ^BC, ^B3, and ^BY.
2D barcodes
QR Code, Data Matrix, PDF417, and other two-dimensional symbols can be generated directly through barcode commands.
Common commands include ^BQ, ^BX, and ^B7.
Shapes and graphics
ZPL can draw boxes, lines, circles, ellipses, and embedded or stored graphics for borders, logos, symbols, and visual structure.
Common commands include ^GB, ^GC, ^GD, ^GE, ^GF, and ^XG.
For a searchable list of frequently used commands and examples, see the Print Envoy ZPL Commands Reference.
Understanding ZPL coordinates, dots, and DPI
One of the most important ZPL concepts is that label coordinates are commonly measured in printer dots rather than physical inches.
DPI means dots per inch. A 203 DPI printer can place approximately 203 dots across one inch. A 300 DPI printer can place 300 dots across one inch. This means that the same coordinate value represents a different physical distance depending on the printer resolution.
| Physical distance | 203 DPI | 300 DPI | 600 DPI |
|---|---|---|---|
| 1 inch | 203 dots | 300 dots | 600 dots |
| 2 inches | 406 dots | 600 dots | 1200 dots |
| 4 inches | 812 dots | 1200 dots | 2400 dots |
| 6 inches | 1218 dots | 1800 dots | 3600 dots |
Example: 4 x 6 label
At 203 DPI, a nominal 4 x 6 inch label is approximately 812 x 1218 dots. At 300 DPI, the same physical size is 1200 x 1800 dots.
203 DPI:
^PW812
^LL1218
300 DPI:
^PW1200
^LL1800
The intended dimensions still need to fit the printer's actual printable area, media configuration, and hardware limits.
ZPL label size calculator
Use this simple calculator to estimate the dot dimensions for a physical label size. Results are rounded to the nearest whole printer dot.
Convert label size to ZPL dots
Use the result as a starting point, not as a substitute for the printer's media setup and printable-width specifications.
ZPL vs PDF vs image-based labels
ZPL is different from a PDF, PNG, or other rendered document. ZPL describes label objects and printer behavior through commands that the printer interprets.
| Characteristic | ZPL | PNG or raster image | |
|---|---|---|---|
| Primary form | Printer commands and data | Document description | Rendered pixels |
| Designed for thermal labels | Yes | General document format | General image format |
| Can create native printer barcodes | Yes | Usually barcode is already rendered | Barcode is already rendered |
| Easy to inspect as source text | Yes | No | No |
| Resolution-sensitive coordinates | Commonly yes | Handled differently by rendering workflow | Depends on image resolution and scaling |
Neither approach is universally better. The right format depends on printer hardware, label design, integration architecture, barcode requirements, label engine, performance needs, and operational workflow.
ZPL and barcode printing
A major reason ZPL appears in warehouse and supply-chain environments is its built-in barcode support. A ZPL label can specify the barcode type, dimensions, orientation, human-readable text, and encoded value as part of the same label definition.
Code 128
Created with ^BC. Code 128 provides efficient alphanumeric encoding and is commonly used in logistics and warehouse environments.
Code 39
Created with ^B3. Code 39 is widely supported and is often used for internal identifiers and asset or location labeling.
QR Code
Created with ^BQ. QR Codes can contain more information than traditional linear barcodes and can be read by many image-based scanners and mobile devices.
Data Matrix
Created with ^BX. Data Matrix is compact and useful where label space is limited.
Learn more about the differences between these symbols on the Print Envoy Barcode Types page or create test barcode images with the Print Envoy Barcode Generator.
How ZPL is used with Microsoft Dynamics 365
Microsoft Dynamics 365 Supply Chain Management supports label-printing scenarios where ZPL is used as the printer text layout. Microsoft's documentation includes ZPL examples for custom labels, license plate labels, container labels, and warehouse wave label printing.
A common enterprise pattern is:
- A warehouse or business process creates a need for a label.
- D365 supplies transaction and master-data values.
- A label layout or label engine combines those values with the required label design.
- The resulting printer-ready output is routed to the appropriate printer.
- The operator receives a barcode label that corresponds to the business transaction.
Print Envoy is designed around this broader label automation problem, including Dynamics 365 workflows, label logic, printer routing, and integrations with supported label engines.
This is also why a ZPL viewer is useful in an ERP environment. It gives developers, administrators, consultants, and support teams a way to inspect printer output independently from the physical printer.
Why use a ZPL visualizer?
Sending every test directly to a production printer can waste labels, ribbon, operator time, and troubleshooting effort. A ZPL visualizer provides an intermediate step where the code can be rendered and inspected first.
A visual preview can help identify:
- Incorrect field coordinates
- Wrong label dimensions
- Missing or misplaced text
- Unexpected barcode size
- Graphics positioned outside the label
- 203 DPI and 300 DPI design mismatches
- Unsupported or incorrect commands
- Overlapping label elements
The Print Envoy ZPL Visualizer provides a browser-based environment for previewing and troubleshooting supported ZPL. It can also export rendered output to PNG or PDF for testing, documentation, and collaboration.
Common ZPL problems and how to investigate them
The label is the wrong size
Check the printer resolution, ^PW, ^LL, media dimensions, printer configuration, and any assumptions made when converting inches or millimeters to dots.
The entire label is shifted
Review commands such as ^LH, ^LS, and ^LT. Also check physical media alignment and printer calibration.
Only one field is misplaced
Review its ^FO or ^FT coordinates, font dimensions, barcode dimensions, and orientation.
Text is missing or displays unexpected characters
Review the selected font, field data, encoding, Unicode support, and commands such as ^CI and ^FH.
A barcode looks correct but will not scan
Visual appearance alone does not guarantee barcode quality. Check the encoded data, symbology requirements, module width, quiet zones, print darkness, physical size, printer resolution, media, scanner capabilities, and any applicable GS1 requirements.
The browser preview differs from the printer
A preview primarily helps inspect label source and expected layout. A physical printer also introduces firmware behavior, printhead resolution, installed fonts, darkness, speed, media, ribbon, calibration, sensor settings, memory, and model-specific capabilities.
ZPL terminology
| Term | Meaning |
|---|---|
| ZPL | Zebra Programming Language, a command language used for label printing. |
| ZPL II | The modern ZPL generation commonly referenced in Zebra programming documentation. |
| DPI | Dots per inch, which describes printer resolution. |
| Field | A label element such as text, a barcode, or a graphic. |
| Field Origin | The position used to place a field, commonly set with ^FO. |
| Field Data | The content supplied to a field, commonly with ^FD. |
| Thermal printer | A printer that uses thermal printing technology, commonly used for barcode and shipping labels. |
| Label engine | Software that combines templates, variable data, print rules, and printer output to generate labels. |
| ZPL viewer | A tool that renders ZPL as a visual label preview for inspection or troubleshooting. |
Recommended ZPL learning resources
For technical accuracy, use official printer and standards documentation when implementing production label formats. The following resources complement the Print Envoy ZPL tools and articles.
The official reference for ZPL commands, parameters, and printer behavior.
View Zebra documentationMicrosoft Learn documentation covering custom label layouts and ZPL examples in Dynamics 365 Supply Chain Management.
View Microsoft LearnMicrosoft's guidance for license plate layouts, routing, and ZPL-based label definitions.
View Microsoft LearnOfficial information about standardized barcode identifiers, data carriers, and supply-chain barcode use.
View GS1 standardsFrequently asked questions about ZPL
What does ZPL stand for?
ZPL stands for Zebra Programming Language.
What is ZPL used for?
ZPL is used to describe and print labels containing text, barcodes, graphics, borders, and variable data. It is commonly encountered in warehouse, manufacturing, logistics, inventory, shipping, retail, healthcare, ERP, and WMS environments.
Is ZPL a file format?
ZPL is primarily a printer programming language expressed as text. ZPL code is often stored in files with extensions such as .zpl, but the important part is the command text sent to the printer.
What is the difference between ZPL and ZPL II?
ZPL II is the newer generation of Zebra Programming Language and is the version most commonly referenced in current Zebra programming documentation and modern label applications.
What starts and ends a ZPL label?
A normal ZPL label format begins with ^XA and ends with ^XZ.
Does ZPL use pixels?
ZPL commonly works in printer dots. The physical size represented by those dots depends on the printer's DPI.
What is the difference between 203 DPI and 300 DPI ZPL?
A 203 DPI printer uses 203 dots for one inch, while a 300 DPI printer uses 300 dots. A label designed with fixed dot dimensions can therefore appear at a different physical size if it is moved between printer resolutions without adjustment.
Can ZPL create QR Codes?
Yes. The ^BQ command is used for QR Code fields.
Can ZPL create Code 128 barcodes?
Yes. Code 128 barcodes are created with the ^BC command.
Can Microsoft Dynamics 365 print ZPL labels?
Microsoft Dynamics 365 Supply Chain Management documentation includes multiple label-printing scenarios that use ZPL layouts, including custom labels, license plate labels, container labels, and warehouse label printing.
Can I preview ZPL without owning a printer?
Yes. The Print Envoy ZPL Visualizer Tool can render supported ZPL in the browser so you can inspect the expected label before physical printing.
Where can I find ZPL command examples?
Visit the Print Envoy ZPL Commands Reference for common commands, categories, examples, DPI information, and troubleshooting guidance.
Learn ZPL, then test it visually
Use the ZPL command reference when you need to understand individual commands, then paste your code into the free Print Envoy ZPL Visualizer to inspect the complete label.