ZPL dots and printer resolution
ZPL positions and sizes everything in dots, the smallest point a printer can print: ^FO positions, ^PW print width, ^LL label length, ^GB box sizes and ^BY bar widths. How big a dot is depends on the printer’s resolution.
Resolutions: dpmm, not dpi
Label printers are sold as 203, 300 or 600 dpi. Internally they work in dots per millimetre, and the dpi values are rounded:
| Sold as | Dots per mm | Actual dpi | One dot |
|---|---|---|---|
| 152 dpi | 6 | 152.4 | 0.167 mm |
| 203 dpi | 8 | 203.2 | 0.125 mm |
| 300 dpi | 12 | 304.8 | 0.083 mm |
| 600 dpi | 24 | 609.6 | 0.042 mm |
This matters for inch-based labels. A 4 inch wide label at 300 dpi is not 4 × 300 = 1200 dots but 4 × 25.4 × 12 = 1219 dots. With 1200 the layout would be 1.6 mm too narrow.
Converting to dots
dots = mm × dots per mm (rounded down)
mm = inches × 25.4
Rounding down ensures the layout never gets larger than the label. Examples: 100 mm at 8 dpmm = 800 dots. 4 in at 8 dpmm = 812 dots.
The same ZPL on a different printer
ZPL does not scale automatically. A label designed for 203 dpi printed on a 300 dpi printer comes out about one third smaller, because every dot is smaller. To keep the physical size, all dot values must be multiplied by 12 / 8 = 1.5.
Barcode module width
^BY sets the narrow bar width of 1D barcodes in whole dots. So the possible module widths depend on the resolution:
^BY | 8 dpmm | 12 dpmm | 24 dpmm |
|---|---|---|---|
| 2 | 0.250 mm | 0.167 mm | 0.083 mm |
| 3 | 0.375 mm | 0.250 mm | 0.125 mm |
| 4 | 0.500 mm | 0.333 mm | 0.167 mm |
For EAN-13 and UPC-A at the retail point of sale, GS1 specifies a nominal module width (X-dimension) of 0.330 mm and a permitted range of 0.264 mm to 0.660 mm. At 8 dpmm ^BY2 (0.250 mm) is below that range, ^BY3 (0.375 mm) is within it.
Related tools
- DPI & Dots Calculator: convert mm, inches and dots at every resolution
- Label Size Calculator:
^PWand^LLfor any label size - ZPL Viewer: preview ZPL at different resolutions
- Barcode to ZPL: generate barcode ZPL with the module width shown in mm